diff --git a/AICA/SRCS/dxm-0.9/AUTHORS b/AICA/SRCS/dxm-0.9/AUTHORS new file mode 100644 index 00000000..021e9109 --- /dev/null +++ b/AICA/SRCS/dxm-0.9/AUTHORS @@ -0,0 +1,5 @@ + +Main author +~~~~~~~~~~~ + +Lars Olsson diff --git a/AICA/SRCS/dxm-0.9/CVS/Entries b/AICA/SRCS/dxm-0.9/CVS/Entries new file mode 100644 index 00000000..9aec15bc --- /dev/null +++ b/AICA/SRCS/dxm-0.9/CVS/Entries @@ -0,0 +1,13 @@ +/AUTHORS/1.2/Sun Sep 16 00:18:33 2001// +/ChangeLog/1.2/Sun Sep 16 00:17:27 2001// +/INSTALL/1.1.1.1/Sat Sep 8 10:48:15 2001// +/Makefile.in/1.1.1.1/Sat Sep 8 10:48:15 2001// +/NEWS/1.1.1.1/Sat Sep 8 10:48:15 2001// +/README/1.1.1.1/Sat Sep 8 10:48:15 2001// +/TODO/1.1.1.1/Sat Sep 8 10:48:15 2001// +/acinclude.m4/1.1.1.1/Sat Sep 8 10:48:15 2001// +/aclocal.m4/1.1.1.1/Sat Sep 8 10:48:15 2001// +/configure/1.1.1.1/Sat Sep 8 10:48:15 2001// +/configure.in/1.1.1.1/Sat Sep 8 10:48:15 2001// +D/example//// +D/src//// diff --git a/AICA/SRCS/dxm-0.9/CVS/Repository b/AICA/SRCS/dxm-0.9/CVS/Repository new file mode 100644 index 00000000..d1979543 --- /dev/null +++ b/AICA/SRCS/dxm-0.9/CVS/Repository @@ -0,0 +1 @@ +/usr/home/ejstans/cvs/dxm diff --git a/AICA/SRCS/dxm-0.9/CVS/Root b/AICA/SRCS/dxm-0.9/CVS/Root new file mode 100644 index 00000000..e14dc10a --- /dev/null +++ b/AICA/SRCS/dxm-0.9/CVS/Root @@ -0,0 +1 @@ +/usr/home/ejstans/cvs diff --git a/AICA/SRCS/dxm-0.9/ChangeLog b/AICA/SRCS/dxm-0.9/ChangeLog new file mode 100644 index 00000000..cc0efd6b --- /dev/null +++ b/AICA/SRCS/dxm-0.9/ChangeLog @@ -0,0 +1 @@ +v0.9 - initial release diff --git a/AICA/SRCS/dxm-0.9/INSTALL b/AICA/SRCS/dxm-0.9/INSTALL new file mode 100644 index 00000000..5d9366de --- /dev/null +++ b/AICA/SRCS/dxm-0.9/INSTALL @@ -0,0 +1,150 @@ +Basic Installation +================== + + This package requires a cross-compiler suite targeted for the +ARM7 series of microprocessors. +Currently only GNU gcc is supported so make sure you have properly +installed this before attempting to build this package. Run the 'configure' +script which will attempt to guess correct values for any system- +dependent variables. If it fails to locate a cross-compiler even though +it is installed, set the environment variable $ACC to the name of the +compiler and be sure to include the directory path where it's stored +in the $PATH variable before running the script. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you can remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the configure script and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type 'make test' to compile a test program that + demonstrates the usage of the routines. + + 4. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not supports the `VPATH' +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use `make distclean' before reconfiguring for another +architecture. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. diff --git a/AICA/SRCS/dxm-0.9/Makefile.in b/AICA/SRCS/dxm-0.9/Makefile.in new file mode 100644 index 00000000..16e7d3ff --- /dev/null +++ b/AICA/SRCS/dxm-0.9/Makefile.in @@ -0,0 +1,26 @@ +# Makefile for dxm + +@SET_MAKE@ + +srcdir: + ${MAKE} -C src + +all: srcdir testdir + +clean: cleandir + +cleandir: + ${MAKE} -C src clean + ${MAKE} -C example clean + +distclean: distcleandir + rm -f config.* Makefile + +distcleandir: + ${MAKE} -C src distclean + ${MAKE} -C example distclean + +test: testdir + +testdir: + ${MAKE} -C example test diff --git a/AICA/SRCS/dxm-0.9/NEWS b/AICA/SRCS/dxm-0.9/NEWS new file mode 100644 index 00000000..6c2f9bb5 --- /dev/null +++ b/AICA/SRCS/dxm-0.9/NEWS @@ -0,0 +1 @@ +No news is good news. diff --git a/AICA/SRCS/dxm-0.9/README b/AICA/SRCS/dxm-0.9/README new file mode 100644 index 00000000..53a3cbfa --- /dev/null +++ b/AICA/SRCS/dxm-0.9/README @@ -0,0 +1,42 @@ +General Information +=================== + +DXM is an XM-module player written for the Dreamcast videogame console. +It is meant to complement my graphics library (working name: Artisan) and +provide a way to play music and sounds for use in demos or games. + +Installation +============ + +See the file 'INSTALL' for detailed instructions + + +Usage +===== + +After compiling the package there should be an ARM binary executable in the +arm subdirectory. This is the player routine and should be placed in sound +RAM. + +The module to be played must be converted to an internal format. This can +either be done beforehand by compiling the 'loader' program for the host +architecture and feeding it the module (only little-endian systems are +supported), or it can be done on-the-fly by compiling the 'loader' +program for the SH4 architecture and including the compiled object- +and header-file into your own project. The function dxm_load() will +then take as argument a pointer to the module and will convert and upload +it to sound RAM. + +In the SH4 subdirectory there is also a file named 'control.o'. This +contains a couple of small functions to give control over the playing +of the module. dxm_halt() will halt the playing, dxm_play() will +(re)start the playing, and dxm_init() (re)initializes the moduel and +takes as argument the order to initialize to. + +The file 'dxm.h' also defines a structure that contains variables that +are used by the module-player. These can be accessed in order to synchronize +effects etc. with the music. + +Bah...i suck at writing documentation normally, and now its 03:43am which +doesnt exactly improve the situation...will see if i can rewrite this to +be more understandable later.... diff --git a/AICA/SRCS/dxm-0.9/TODO b/AICA/SRCS/dxm-0.9/TODO new file mode 100644 index 00000000..e3cdb537 --- /dev/null +++ b/AICA/SRCS/dxm-0.9/TODO @@ -0,0 +1,59 @@ +Issues: + +* only handles waveforms less than 64k frames (unfortunately this seems to + be a hardware restriction so not much can be done about it) + NOTE: the 64k limit is NOT in bytes, but sample-frames! this means that + it's possible to play 128kb 16-bit samples, 64kb 8-bit samples and 32k 4-bit + ADPCM samples. also note that ping-pong loop causes part of the loop-portion + to be copied and this will eat sample-frames so try to minimize the use of + ping-pong loops. + +* arpeggio command is not fully implemented + +* tremor command is not implemented + +* set finetune command currently has no effect. + +* glissando slides are not implemented + +* delay note seems bugged (just noticed, maybe affects other similar cmds) + +* amiga frequency table is currently not (correctly) implemented + +* SH4 loader is incomplete so module must be pre-converted using the + host converter... + +* loader only handles the XM-format, though MOD, S3M, etc can be added + with "relatively" ease (or that was the intention anyway...) + +* Maybe make control.o into a library instead? (nah, not really worth it) + +* ARM was too slow so i moved one-shot waveform playing to the SH4 side instead + but this is completely untested.... + + +Known bugs: + +* sound is noisy, probably due to bug in interpolation code in envelope + processing (will look into that momentarily) + +* Still something wrong with BPM...module plays slightly out-of-sync, + this is maybe due to inaccuracy of the timer-irq..check the calculations + +* volume conversion from linear to logarithmic is incorrect + +* Figure out how to get ld to align the .o files properly. changing + the order of the module and player causes misaligned data with + a address-error as result (when trying to write to sound-ram). this + is annoying... + +* slow code. playing 32 channels is not working with full envelope + processing (maybe works at a lower BPM than 125 but still). + pan envelope can be turned off if necessary to speed things up + a bit... + +* Some (most?) modules just play incorrectly. I dont really know whats going + on...even if aica only handles 64k waveform doesnt mean that there should + be noise which is the most common symptom...others include playing of pattern + screwing up, erranously repeating part of the pattern etc... + hmm...could it be bugs in the converter? oh,well.... diff --git a/AICA/SRCS/dxm-0.9/acinclude.m4 b/AICA/SRCS/dxm-0.9/acinclude.m4 new file mode 100644 index 00000000..9059a428 --- /dev/null +++ b/AICA/SRCS/dxm-0.9/acinclude.m4 @@ -0,0 +1,11 @@ +dnl define macro to check valid arguments to compiler +AC_DEFUN(AC_CHECK_COMPILER_ARG, +[AC_CACHE_CHECK(whether $1 accepts $2, $3, +[echo 'void f(){}' > conftest.c +if test -z "`$1 $2 -c conftest.c 2>&1`"; then + $3=yes +else + $3=no +fi +rm -f conftest.c conftest.o +])]) diff --git a/AICA/SRCS/dxm-0.9/aclocal.m4 b/AICA/SRCS/dxm-0.9/aclocal.m4 new file mode 100644 index 00000000..918b4ccf --- /dev/null +++ b/AICA/SRCS/dxm-0.9/aclocal.m4 @@ -0,0 +1,24 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl define macro to check valid arguments to compiler +AC_DEFUN(AC_CHECK_COMPILER_ARG, +[AC_CACHE_CHECK(whether $1 accepts $2, $3, +[echo 'void f(){}' > conftest.c +if test -z "`$1 $2 -c conftest.c 2>&1`"; then + $3=yes +else + $3=no +fi +rm -f conftest.c conftest.o +])]) + diff --git a/AICA/SRCS/dxm-0.9/configure b/AICA/SRCS/dxm-0.9/configure new file mode 100644 index 00000000..50296b5e --- /dev/null +++ b/AICA/SRCS/dxm-0.9/configure @@ -0,0 +1,1694 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=src/main.c + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + +# AM_INIT_AUTOMAKE(dxm, 1.0.0) +# AM_CONFIG_HEADER(config.h) + +ARMPATH=$PATH:/usr/local/dc/bin:/usr/local/dcdev/bin:/usr/local/arm/bin:/usr/local/arm-elf/bin:/usr/local/dc/arm/bin:/usr/local/dc/arm-elf/bin:/usr/local/dcdev/arm/bin:/usr/local/dcdev/arm-elf/bin + +# look for ARM cross-compiler + +if test -z "$ACC"; then + # Extract the first word of "arm-gcc", so it can be a program name with args. +set dummy arm-gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:536: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_ACC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$ACC" in + /*) + ac_cv_path_ACC="$ACC" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_ACC="$ACC" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$ARMPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_ACC="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +ACC="$ac_cv_path_ACC" +if test -n "$ACC"; then + echo "$ac_t""$ACC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$ACC"; then + # Extract the first word of "arm-elf-gcc", so it can be a program name with args. +set dummy arm-elf-gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:573: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_ACC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$ACC" in + /*) + ac_cv_path_ACC="$ACC" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_ACC="$ACC" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$ARMPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_ACC="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +ACC="$ac_cv_path_ACC" +if test -n "$ACC"; then + echo "$ac_t""$ACC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$ACC"; then + { echo "configure: error: *** ARM cross-compiler not found. Check 'config.log' for more details." 1>&2; exit 1; } +fi + +# check which arguments to include + +echo $ac_n "checking whether $ACC accepts -ml""... $ac_c" 1>&6 +echo "configure:613: checking whether $ACC accepts -ml" >&5 +if eval "test \"`echo '$''{'iv_accc_ml'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`$ACC -ml -c conftest.c 2>&1`"; then + iv_accc_ml=yes +else + iv_accc_ml=no +fi +rm -f conftest.c conftest.o + +fi + +echo "$ac_t""$iv_accc_ml" 1>&6 +echo $ac_n "checking whether $ACC accepts -mcpu=arm7""... $ac_c" 1>&6 +echo "configure:629: checking whether $ACC accepts -mcpu=arm7" >&5 +if eval "test \"`echo '$''{'iv_accc_mcpu'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`$ACC -mcpu=arm7 -c conftest.c 2>&1`"; then + iv_accc_mcpu=yes +else + iv_accc_mcpu=no +fi +rm -f conftest.c conftest.o + +fi + +echo "$ac_t""$iv_accc_mcpu" 1>&6 +echo $ac_n "checking whether $ACC accepts -ffreestanding""... $ac_c" 1>&6 +echo "configure:645: checking whether $ACC accepts -ffreestanding" >&5 +if eval "test \"`echo '$''{'iv_accc_freestanding'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`$ACC -ffreestanding -c conftest.c 2>&1`"; then + iv_accc_freestanding=yes +else + iv_accc_freestanding=no +fi +rm -f conftest.c conftest.o + +fi + +echo "$ac_t""$iv_accc_freestanding" 1>&6 +echo $ac_n "checking whether $ACC accepts -O4""... $ac_c" 1>&6 +echo "configure:661: checking whether $ACC accepts -O4" >&5 +if eval "test \"`echo '$''{'iv_accc_optimize'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`$ACC -O4 -c conftest.c 2>&1`"; then + iv_accc_optimize=yes +else + iv_accc_optimize=no +fi +rm -f conftest.c conftest.o + +fi + +echo "$ac_t""$iv_accc_optimize" 1>&6 +echo $ac_n "checking whether $ACC accepts -fomit-frame-pointer""... $ac_c" 1>&6 +echo "configure:677: checking whether $ACC accepts -fomit-frame-pointer" >&5 +if eval "test \"`echo '$''{'iv_accc_fomit_frame_pointer'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`$ACC -fomit-frame-pointer -c conftest.c 2>&1`"; then + iv_accc_fomit_frame_pointer=yes +else + iv_accc_fomit_frame_pointer=no +fi +rm -f conftest.c conftest.o + +fi + +echo "$ac_t""$iv_accc_fomit_frame_pointer" 1>&6 +echo $ac_n "checking whether $ACC accepts -ffast-math""... $ac_c" 1>&6 +echo "configure:693: checking whether $ACC accepts -ffast-math" >&5 +if eval "test \"`echo '$''{'iv_accc_ffast_math'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`$ACC -ffast-math -c conftest.c 2>&1`"; then + iv_accc_ffast_math=yes +else + iv_accc_ffast_math=no +fi +rm -f conftest.c conftest.o + +fi + +echo "$ac_t""$iv_accc_ffast_math" 1>&6 +echo $ac_n "checking whether $ACC accepts -fno-builtin""... $ac_c" 1>&6 +echo "configure:709: checking whether $ACC accepts -fno-builtin" >&5 +if eval "test \"`echo '$''{'iv_accc_fno_builtin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`$ACC -fno-builtin -c conftest.c 2>&1`"; then + iv_accc_fno_builtin=yes +else + iv_accc_fno_builtin=no +fi +rm -f conftest.c conftest.o + +fi + +echo "$ac_t""$iv_accc_fno_builtin" 1>&6 +echo $ac_n "checking whether $ACC accepts -Wall""... $ac_c" 1>&6 +echo "configure:725: checking whether $ACC accepts -Wall" >&5 +if eval "test \"`echo '$''{'iv_accc_wall'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`$ACC -Wall -c conftest.c 2>&1`"; then + iv_accc_wall=yes +else + iv_accc_wall=no +fi +rm -f conftest.c conftest.o + +fi + +echo "$ac_t""$iv_accc_wall" 1>&6 + +# construct compiler flags +if test "x$iv_accc_ml" = "xyes"; then + ACFLAGS="$ACFLAGS -ml" +fi +if test "x$iv_accc_mcpu" = "xyes"; then + ACFLAGS="$ACFLAGS -mcpu=arm7" +fi +if test "x$iv_accc_freestanding" = "xyes"; then + ACFLAGS="$ACFLAGS -ffreestanding" +fi +if test "x$iv_accc_optimize" = "xyes"; then + ACFLAGS="$ACFLAGS -O4" +fi +if test "x$iv_accc_fomit_frame_pointer" = "xyes"; then + ACFLAGS="$ACFLAGS -fomit-frame-pointer" +fi +if test "x$iv_accc_ffast_math" = "xyes"; then + ACFLAGS="$ACFLAGS -ffast-math" +fi +if test "x$iv_accc_fno_builtin" = "xyes"; then + ACFLAGS="$ACFLAGS -fno-builtin" +fi +if test "x$iv_accc_wall" = "xyes"; then + ACFLAGS="$ACFLAGS -Wall" +fi + + +# look for ARM objcopy + +if test -z "$AOBJCOPY"; then + # Extract the first word of "arm-objcopy", so it can be a program name with args. +set dummy arm-objcopy; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:774: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_AOBJCOPY'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$AOBJCOPY" in + /*) + ac_cv_path_AOBJCOPY="$AOBJCOPY" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_AOBJCOPY="$AOBJCOPY" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$ARMPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_AOBJCOPY="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +AOBJCOPY="$ac_cv_path_AOBJCOPY" +if test -n "$AOBJCOPY"; then + echo "$ac_t""$AOBJCOPY" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$AOBJCOPY"; then + # Extract the first word of "arm-elf-objcopy", so it can be a program name with args. +set dummy arm-elf-objcopy; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:811: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_AOBJCOPY'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$AOBJCOPY" in + /*) + ac_cv_path_AOBJCOPY="$AOBJCOPY" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_AOBJCOPY="$AOBJCOPY" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$ARMPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_AOBJCOPY="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +AOBJCOPY="$ac_cv_path_AOBJCOPY" +if test -n "$AOBJCOPY"; then + echo "$ac_t""$AOBJCOPY" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$AOBJCOPY"; then + echo "configure: warning: *** ARM objcopy not found. Will not be able to convert to BINARY format." 1>&2 + AOBJCOPY="arm-objcopy-not-found" +fi + + +SHPATH=$PATH:/usr/local/dc/bin:/usr/local/dcdev/bin:/usr/local/sh/bin:/usr/local/sh-elf/bin:/usr/local/sh-hitachi-elf/bin:/usr/local/dc/sh-elf/bin:/usr/local/dc/sh-hitachi-elf/bin + +# search for an SH4 cross compiler + +if test -z "$DCC"; then + # Extract the first word of "dc-gcc", so it can be a program name with args. +set dummy dc-gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:858: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_DCC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$DCC" in + /*) + ac_cv_path_DCC="$DCC" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_DCC="$DCC" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$SHPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_DCC="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +DCC="$ac_cv_path_DCC" +if test -n "$DCC"; then + echo "$ac_t""$DCC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$DCC"; then + # Extract the first word of "dc-elf-gcc", so it can be a program name with args. +set dummy dc-elf-gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:895: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_DCC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$DCC" in + /*) + ac_cv_path_DCC="$DCC" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_DCC="$DCC" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$SHPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_DCC="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +DCC="$ac_cv_path_DCC" +if test -n "$DCC"; then + echo "$ac_t""$DCC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$DCC"; then + # Extract the first word of "sh-elf-gcc", so it can be a program name with args. +set dummy sh-elf-gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:932: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_DCC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$DCC" in + /*) + ac_cv_path_DCC="$DCC" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_DCC="$DCC" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$SHPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_DCC="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +DCC="$ac_cv_path_DCC" +if test -n "$DCC"; then + echo "$ac_t""$DCC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$DCC"; then + # Extract the first word of "sh-gcc", so it can be a program name with args. +set dummy sh-gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:969: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_DCC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$DCC" in + /*) + ac_cv_path_DCC="$DCC" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_DCC="$DCC" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$SHPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_DCC="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +DCC="$ac_cv_path_DCC" +if test -n "$DCC"; then + echo "$ac_t""$DCC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$DCC"; then + # Extract the first word of "sh-hitachi-elf-gcc", so it can be a program name with args. +set dummy sh-hitachi-elf-gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1006: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_DCC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$DCC" in + /*) + ac_cv_path_DCC="$DCC" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_DCC="$DCC" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$SHPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_DCC="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +DCC="$ac_cv_path_DCC" +if test -n "$DCC"; then + echo "$ac_t""$DCC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$DCC"; then + echo "configure: warning: *** SH-4 cross-compiler not found. Will not be able to build SH4 loader or test programs." 1>&2 + DCC="echo sh-gcc-not-found" +fi + +# check which arguments to include + +echo $ac_n "checking whether $DCC accepts -ml""... $ac_c" 1>&6 +echo "configure:1047: checking whether $DCC accepts -ml" >&5 +if eval "test \"`echo '$''{'iv_dccc_ml'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`$DCC -ml -c conftest.c 2>&1`"; then + iv_dccc_ml=yes +else + iv_dccc_ml=no +fi +rm -f conftest.c conftest.o + +fi + +echo "$ac_t""$iv_dccc_ml" 1>&6 +# -mhitachi is sometimes less effecient than GNU +# AC_CHECK_COMPILER_ARG($DCC, -mhitachi, iv_dccc_mhitachi) +echo $ac_n "checking whether $DCC accepts -m4-single-only""... $ac_c" 1>&6 +echo "configure:1065: checking whether $DCC accepts -m4-single-only" >&5 +if eval "test \"`echo '$''{'iv_dccc_m4_single_only'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`$DCC -m4-single-only -c conftest.c 2>&1`"; then + iv_dccc_m4_single_only=yes +else + iv_dccc_m4_single_only=no +fi +rm -f conftest.c conftest.o + +fi + +echo "$ac_t""$iv_dccc_m4_single_only" 1>&6 +# -fno-delayed-branch may fix a bug, but generates slower code +# AC_CHECK_COMPILER_ARG($DCC, -fno-delayed-branch, iv_dccc_fno_delayed_branch) +# causes gcc to crash for some reason +# AC_CHECK_COMPILER_ARG($DCC, -mrelax, iv_dccc_mrelax) +# AC_CHECK_COMPILER_ARG($DCC, -O2, iv_dccc_optimize) +echo $ac_n "checking whether $DCC accepts -O2""... $ac_c" 1>&6 +echo "configure:1086: checking whether $DCC accepts -O2" >&5 +if eval "test \"`echo '$''{'iv_dccc_optimize'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`$DCC -O2 -c conftest.c 2>&1`"; then + iv_dccc_optimize=yes +else + iv_dccc_optimize=no +fi +rm -f conftest.c conftest.o + +fi + +echo "$ac_t""$iv_dccc_optimize" 1>&6 +echo $ac_n "checking whether $DCC accepts -fomit-frame-pointer""... $ac_c" 1>&6 +echo "configure:1102: checking whether $DCC accepts -fomit-frame-pointer" >&5 +if eval "test \"`echo '$''{'iv_dccc_fomit_frame_pointer'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`$DCC -fomit-frame-pointer -c conftest.c 2>&1`"; then + iv_dccc_fomit_frame_pointer=yes +else + iv_dccc_fomit_frame_pointer=no +fi +rm -f conftest.c conftest.o + +fi + +echo "$ac_t""$iv_dccc_fomit_frame_pointer" 1>&6 +echo $ac_n "checking whether $DCC accepts -ffast-math""... $ac_c" 1>&6 +echo "configure:1118: checking whether $DCC accepts -ffast-math" >&5 +if eval "test \"`echo '$''{'iv_dccc_ffast_math'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`$DCC -ffast-math -c conftest.c 2>&1`"; then + iv_dccc_ffast_math=yes +else + iv_dccc_ffast_math=no +fi +rm -f conftest.c conftest.o + +fi + +echo "$ac_t""$iv_dccc_ffast_math" 1>&6 +echo $ac_n "checking whether $DCC accepts -fno-builtin""... $ac_c" 1>&6 +echo "configure:1134: checking whether $DCC accepts -fno-builtin" >&5 +if eval "test \"`echo '$''{'iv_dccc_fno_builtin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`$DCC -fno-builtin -c conftest.c 2>&1`"; then + iv_dccc_fno_builtin=yes +else + iv_dccc_fno_builtin=no +fi +rm -f conftest.c conftest.o + +fi + +echo "$ac_t""$iv_dccc_fno_builtin" 1>&6 +echo $ac_n "checking whether $DCC accepts -Wall""... $ac_c" 1>&6 +echo "configure:1150: checking whether $DCC accepts -Wall" >&5 +if eval "test \"`echo '$''{'iv_dccc_wall'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`$DCC -Wall -c conftest.c 2>&1`"; then + iv_dccc_wall=yes +else + iv_dccc_wall=no +fi +rm -f conftest.c conftest.o + +fi + +echo "$ac_t""$iv_dccc_wall" 1>&6 + +# construct compiler flags +if test "x$iv_dccc_ml" = "xyes"; then + DCFLAGS="$DCFLAGS -ml" +fi +if test "x$iv_dccc_mhitachi" = "xyes"; then + DCFLAGS="$DCFLAGS -mhitachi" +fi +if test "x$iv_dccc_m4_single_only" = "xyes"; then + DCFLAGS="$DCFLAGS -m4-single-only" +fi +if test "x$iv_dccc_fno_delayed_branch" = "xyes"; then + DCFLAGS="$DCFLAGS -fno-delayed-branch" +fi +if test "x$iv_dccc_mrelax" = "xyes"; then + DCFLAGS="$DCFLAGS -mrelax" +fi +if test "x$iv_dccc_optimize" = "xyes"; then + DCFLAGS="$DCFLAGS -O2" +fi +if test "x$iv_dccc_fomit_frame_pointer" = "xyes"; then + DCFLAGS="$DCFLAGS -fomit-frame-pointer" +fi +if test "x$iv_dccc_ffast_math" = "xyes"; then + DCFLAGS="$DCFLAGS -ffast-math" +fi +if test "x$iv_dccc_fno_builtin" = "xyes"; then + DCFLAGS="$DCFLAGS -fno-builtin" +fi +if test "x$iv_dccc_wall" = "xyes"; then + DCFLAGS="$DCFLAGS -Wall" +fi + + +# search for an SH4 cross linker + +if test -z "$DLD"; then + # Extract the first word of "dc-ld", so it can be a program name with args. +set dummy dc-ld; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1205: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_DLD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$DLD" in + /*) + ac_cv_path_DLD="$DLD" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_DLD="$DLD" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$SHPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_DLD="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +DLD="$ac_cv_path_DLD" +if test -n "$DLD"; then + echo "$ac_t""$DLD" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$DLD"; then + # Extract the first word of "dc-elf-ld", so it can be a program name with args. +set dummy dc-elf-ld; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1242: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_DLD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$DLD" in + /*) + ac_cv_path_DLD="$DLD" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_DLD="$DLD" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$SHPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_DLD="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +DLD="$ac_cv_path_DLD" +if test -n "$DLD"; then + echo "$ac_t""$DLD" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$DLD"; then + # Extract the first word of "sh-elf-ld", so it can be a program name with args. +set dummy sh-elf-ld; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1279: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_DLD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$DLD" in + /*) + ac_cv_path_DLD="$DLD" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_DLD="$DLD" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$SHPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_DLD="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +DLD="$ac_cv_path_DLD" +if test -n "$DLD"; then + echo "$ac_t""$DLD" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$DLD"; then + # Extract the first word of "sh-ld", so it can be a program name with args. +set dummy sh-ld; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1316: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_DLD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$DLD" in + /*) + ac_cv_path_DLD="$DLD" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_DLD="$DLD" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$SHPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_DLD="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +DLD="$ac_cv_path_DLD" +if test -n "$DLD"; then + echo "$ac_t""$DLD" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$DLD"; then + # Extract the first word of "sh-hitachi-elf-ld", so it can be a program name with args. +set dummy sh-hitachi-elf-ld; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1353: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_DLD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$DLD" in + /*) + ac_cv_path_DLD="$DLD" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_DLD="$DLD" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$SHPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_DLD="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +DLD="$ac_cv_path_DLD" +if test -n "$DLD"; then + echo "$ac_t""$DLD" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$DLD"; then + echo "configure: warning: *** SH-4 cross-linker not found. Will not be able to build test programs." 1>&2 + DCC="echo sh-ld-not-found" +fi + + + +# check for some other programs + +# AC_PROG_INSTALL +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:1397: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + + +# check endianness of host (only works for little-endian systems for now) + +#AC_C_BIGENDIAN + +# make the substitutions in the Makefiles + + + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir + +trap 'rm -fr `echo "Makefile src/Makefile example/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@ACC@%$ACC%g +s%@AOBJCOPY@%$AOBJCOPY%g +s%@DCC@%$DCC%g +s%@DLD@%$DLD%g +s%@SET_MAKE@%$SET_MAKE%g +s%@ACFLAGS@%$ACFLAGS%g +s%@DCFLAGS@%$DCFLAGS%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/AICA/SRCS/dxm-0.9/configure.in b/AICA/SRCS/dxm-0.9/configure.in new file mode 100644 index 00000000..a4285888 --- /dev/null +++ b/AICA/SRCS/dxm-0.9/configure.in @@ -0,0 +1,192 @@ +# Process this file with autoconf to produce a configure script + +# initialize + +AC_INIT(src/main.c) +# AM_INIT_AUTOMAKE(dxm, 1.0.0) +# AM_CONFIG_HEADER(config.h) + +ARMPATH=$PATH:/usr/local/dc/bin:/usr/local/dcdev/bin:/usr/local/arm/bin:/usr/local/arm-elf/bin:/usr/local/dc/arm/bin:/usr/local/dc/arm-elf/bin:/usr/local/dcdev/arm/bin:/usr/local/dcdev/arm-elf/bin + +# look for ARM cross-compiler + +if test -z "$ACC"; then + AC_PATH_PROG(ACC, arm-gcc,,$ARMPATH) +fi +if test -z "$ACC"; then + AC_PATH_PROG(ACC, arm-elf-gcc,,$ARMPATH) +fi +if test -z "$ACC"; then + AC_MSG_ERROR([*** ARM cross-compiler not found. Check 'config.log' for more details.]) +fi + +# check which arguments to include + +AC_CHECK_COMPILER_ARG($ACC, -ml, iv_accc_ml) +AC_CHECK_COMPILER_ARG($ACC, -mcpu=arm7, iv_accc_mcpu) +AC_CHECK_COMPILER_ARG($ACC, -ffreestanding, iv_accc_freestanding) +AC_CHECK_COMPILER_ARG($ACC, -O4, iv_accc_optimize) +AC_CHECK_COMPILER_ARG($ACC, -fomit-frame-pointer, iv_accc_fomit_frame_pointer) +AC_CHECK_COMPILER_ARG($ACC, -ffast-math, iv_accc_ffast_math) +AC_CHECK_COMPILER_ARG($ACC, -fno-builtin, iv_accc_fno_builtin) +AC_CHECK_COMPILER_ARG($ACC, -Wall, iv_accc_wall) + +# construct compiler flags +if test "x$iv_accc_ml" = "xyes"; then + ACFLAGS="$ACFLAGS -ml" +fi +if test "x$iv_accc_mcpu" = "xyes"; then + ACFLAGS="$ACFLAGS -mcpu=arm7" +fi +if test "x$iv_accc_freestanding" = "xyes"; then + ACFLAGS="$ACFLAGS -ffreestanding" +fi +if test "x$iv_accc_optimize" = "xyes"; then + ACFLAGS="$ACFLAGS -O4" +fi +if test "x$iv_accc_fomit_frame_pointer" = "xyes"; then + ACFLAGS="$ACFLAGS -fomit-frame-pointer" +fi +if test "x$iv_accc_ffast_math" = "xyes"; then + ACFLAGS="$ACFLAGS -ffast-math" +fi +if test "x$iv_accc_fno_builtin" = "xyes"; then + ACFLAGS="$ACFLAGS -fno-builtin" +fi +if test "x$iv_accc_wall" = "xyes"; then + ACFLAGS="$ACFLAGS -Wall" +fi + + +# look for ARM objcopy + +if test -z "$AOBJCOPY"; then + AC_PATH_PROG(AOBJCOPY, arm-objcopy,,$ARMPATH) +fi +if test -z "$AOBJCOPY"; then + AC_PATH_PROG(AOBJCOPY, arm-elf-objcopy,,$ARMPATH) +fi +if test -z "$AOBJCOPY"; then + AC_MSG_WARN([*** ARM objcopy not found. Will not be able to convert to BINARY format.]) + AOBJCOPY="arm-objcopy-not-found" +fi + + +SHPATH=$PATH:/usr/local/dc/bin:/usr/local/dcdev/bin:/usr/local/sh/bin:/usr/local/sh-elf/bin:/usr/local/sh-hitachi-elf/bin:/usr/local/dc/sh-elf/bin:/usr/local/dc/sh-hitachi-elf/bin + +# search for an SH4 cross compiler + +if test -z "$DCC"; then + AC_PATH_PROG(DCC, dc-gcc,,$SHPATH) +fi +if test -z "$DCC"; then + AC_PATH_PROG(DCC, dc-elf-gcc,,$SHPATH) +fi +if test -z "$DCC"; then + AC_PATH_PROG(DCC, sh-elf-gcc,,$SHPATH) +fi +if test -z "$DCC"; then + AC_PATH_PROG(DCC, sh-gcc,,$SHPATH) +fi +if test -z "$DCC"; then + AC_PATH_PROG(DCC, sh-hitachi-elf-gcc,,$SHPATH) +fi +if test -z "$DCC"; then + AC_MSG_WARN([*** SH-4 cross-compiler not found. Will not be able to build SH4 loader or test programs.]) + DCC="echo sh-gcc-not-found" +fi + +# check which arguments to include + +AC_CHECK_COMPILER_ARG($DCC, -ml, iv_dccc_ml) +# -mhitachi is sometimes less effecient than GNU +# AC_CHECK_COMPILER_ARG($DCC, -mhitachi, iv_dccc_mhitachi) +AC_CHECK_COMPILER_ARG($DCC, -m4-single-only, iv_dccc_m4_single_only) +# -fno-delayed-branch may fix a bug, but generates slower code +# AC_CHECK_COMPILER_ARG($DCC, -fno-delayed-branch, iv_dccc_fno_delayed_branch) +# causes gcc to crash for some reason +# AC_CHECK_COMPILER_ARG($DCC, -mrelax, iv_dccc_mrelax) +# AC_CHECK_COMPILER_ARG($DCC, -O2, iv_dccc_optimize) +AC_CHECK_COMPILER_ARG($DCC, -O2, iv_dccc_optimize) +AC_CHECK_COMPILER_ARG($DCC, -fomit-frame-pointer, iv_dccc_fomit_frame_pointer) +AC_CHECK_COMPILER_ARG($DCC, -ffast-math, iv_dccc_ffast_math) +AC_CHECK_COMPILER_ARG($DCC, -fno-builtin, iv_dccc_fno_builtin) +AC_CHECK_COMPILER_ARG($DCC, -Wall, iv_dccc_wall) + +# construct compiler flags +if test "x$iv_dccc_ml" = "xyes"; then + DCFLAGS="$DCFLAGS -ml" +fi +if test "x$iv_dccc_mhitachi" = "xyes"; then + DCFLAGS="$DCFLAGS -mhitachi" +fi +if test "x$iv_dccc_m4_single_only" = "xyes"; then + DCFLAGS="$DCFLAGS -m4-single-only" +fi +if test "x$iv_dccc_fno_delayed_branch" = "xyes"; then + DCFLAGS="$DCFLAGS -fno-delayed-branch" +fi +if test "x$iv_dccc_mrelax" = "xyes"; then + DCFLAGS="$DCFLAGS -mrelax" +fi +if test "x$iv_dccc_optimize" = "xyes"; then + DCFLAGS="$DCFLAGS -O2" +fi +if test "x$iv_dccc_fomit_frame_pointer" = "xyes"; then + DCFLAGS="$DCFLAGS -fomit-frame-pointer" +fi +if test "x$iv_dccc_ffast_math" = "xyes"; then + DCFLAGS="$DCFLAGS -ffast-math" +fi +if test "x$iv_dccc_fno_builtin" = "xyes"; then + DCFLAGS="$DCFLAGS -fno-builtin" +fi +if test "x$iv_dccc_wall" = "xyes"; then + DCFLAGS="$DCFLAGS -Wall" +fi + + +# search for an SH4 cross linker + +if test -z "$DLD"; then + AC_PATH_PROG(DLD, dc-ld,,$SHPATH) +fi +if test -z "$DLD"; then + AC_PATH_PROG(DLD, dc-elf-ld,,$SHPATH) +fi +if test -z "$DLD"; then + AC_PATH_PROG(DLD, sh-elf-ld,,$SHPATH) +fi +if test -z "$DLD"; then + AC_PATH_PROG(DLD, sh-ld,,$SHPATH) +fi +if test -z "$DLD"; then + AC_PATH_PROG(DLD, sh-hitachi-elf-ld,,$SHPATH) +fi +if test -z "$DLD"; then + AC_MSG_WARN([*** SH-4 cross-linker not found. Will not be able to build test programs.]) + DCC="echo sh-ld-not-found" +fi + + + +# check for some other programs + +# AC_PROG_INSTALL +AC_PROG_MAKE_SET + + +# check endianness of host (only works for little-endian systems for now) + +#AC_C_BIGENDIAN + +# make the substitutions in the Makefiles + +AC_SUBST(ACC) +AC_SUBST(AOBJCOPY) +AC_SUBST(DCC) +AC_SUBST(ACFLAGS) +AC_SUBST(DCFLAGS) +AC_SUBST(DLD) + +AC_OUTPUT(Makefile src/Makefile example/Makefile) diff --git a/AICA/SRCS/dxm-0.9/example/CVS/Entries b/AICA/SRCS/dxm-0.9/example/CVS/Entries new file mode 100644 index 00000000..c81a372f --- /dev/null +++ b/AICA/SRCS/dxm-0.9/example/CVS/Entries @@ -0,0 +1,8 @@ +/Makefile.in/1.1.1.1/Sat Sep 8 10:48:15 2001// +/aws_adwh.xm/1.1.1.1/Sat Sep 8 10:48:15 2001// +/crt0.S/1.1.1.1/Sat Sep 8 10:48:15 2001// +/dc.x/1.1.1.1/Sat Sep 8 10:48:15 2001// +/driver.x/1.1.1.1/Sat Sep 8 10:48:15 2001// +/main.c/1.1.1.1/Sat Sep 8 10:48:15 2001// +/module.x/1.1.1.1/Sat Sep 8 10:48:15 2001// +D diff --git a/AICA/SRCS/dxm-0.9/example/CVS/Repository b/AICA/SRCS/dxm-0.9/example/CVS/Repository new file mode 100644 index 00000000..b39097dd --- /dev/null +++ b/AICA/SRCS/dxm-0.9/example/CVS/Repository @@ -0,0 +1 @@ +/usr/home/ejstans/cvs/dxm/example diff --git a/AICA/SRCS/dxm-0.9/example/CVS/Root b/AICA/SRCS/dxm-0.9/example/CVS/Root new file mode 100644 index 00000000..e14dc10a --- /dev/null +++ b/AICA/SRCS/dxm-0.9/example/CVS/Root @@ -0,0 +1 @@ +/usr/home/ejstans/cvs diff --git a/AICA/SRCS/dxm-0.9/example/Makefile.in b/AICA/SRCS/dxm-0.9/example/Makefile.in new file mode 100644 index 00000000..26e2030b --- /dev/null +++ b/AICA/SRCS/dxm-0.9/example/Makefile.in @@ -0,0 +1,26 @@ +# Makefile for dxm + +DCC = @DCC@ +DCFLAGS = @DCFLAGS@ +DLD = @DLD@ + +test: crt0.o module.o module.dxm driver.o main.c + ${DCC} ${DCFLAGS} -nostdlib -fno-builtin -Wl,-T,dc.x crt0.o main.c driver.o module.o ../src/sh4/control.o -lgcc -o test.elf + +crt0.o: crt0.S + ${DCC} ${DCFLAGS} -c crt0.S + +driver.o: ../src/arm/player.bin + ${DLD} -A sh -b binary --oformat elf32-shl -o driver.o ../src/arm/player.bin -r -EL --no-warn-mismatch -T driver.x + +module.o: module.dxm + ${DLD} -A sh -b binary --oformat elf32-shl -o module.o module.dxm -r -EL --no-warn-mismatch -T module.x + +module.dxm: aws_adwh.xm + ../src/host/loader aws_adwh.xm module.dxm + +clean: + rm -f *.o *.elf module.dxm + +distclean: + rm -f *.o *.elf module.dxm Makefile diff --git a/AICA/SRCS/dxm-0.9/example/aws_adwh.xm b/AICA/SRCS/dxm-0.9/example/aws_adwh.xm new file mode 100644 index 00000000..ac52209f Binary files /dev/null and b/AICA/SRCS/dxm-0.9/example/aws_adwh.xm differ diff --git a/AICA/SRCS/dxm-0.9/example/crt0.S b/AICA/SRCS/dxm-0.9/example/crt0.S new file mode 100644 index 00000000..c4ff866d --- /dev/null +++ b/AICA/SRCS/dxm-0.9/example/crt0.S @@ -0,0 +1,119 @@ + .section .text + .global start + .global ___exit + .global _atexit +start: + mov.l setup_cache_k,r0 + mov.l p2_mask,r1 + or r1,r0 + jmp @r0 + nop +setup_cache: + mov.l ccr_addr,r0 + mov.w ccr_data,r1 + mov.l r1,@r0 + mov.l start_2_k,r0 + nop + nop + nop + nop + nop + nop + nop + jmp @r0 + nop +start_2: + mov.l old_stack_k,r14 + mov.l r15,@r14 + mov.l old_pr_k,r14 + sts pr,r15 + mov.l r15,@r14 + mov.l stack_k,r15 + + ! zero out bss + mov.l edata_k,r0 + mov.l end_k,r1 + mov #0,r2 +start_l: + mov.l r2,@r0 + add #4,r0 + cmp/ge r0,r1 + bt start_l + +#if defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY) + mov.l set_fpscr_k, r1 + jsr @r1 + mov #0,r4 + lds r3,fpscr +#endif /* defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__) */ + + ! call the mainline + mov.l main_k,r0 + jsr @r0 + or r0,r0 + + ! call exit + mov r0,r4 + mov.l exit_k,r0 + jsr @r0 + or r0,r0 + +___exit: + mov.l old_pr_k,r14 + mov.l @r14,r15 + lds r15,pr + mov.l old_stack_k,r14 + mov.l @r14,r15 + rts + nop + +_atexit: + rts + nop + + .align 4 +#if defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__) +set_fpscr_k: + .long ___set_fpscr +#endif /* defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(SH4_SINGLE_ONLY) */ +stack_k: + .long _stack +edata_k: + .long _edata +end_k: + .long _end +main_k: + .long _main +exit_k: + .long _exit + +old_stack_k: + .long _old_stack +old_pr_k: + .long _old_pr + +_old_stack: + .long 0 +_old_pr: + .long 0 + +setup_cache_k: + .long setup_cache +start_2_k: + .long start_2 +p2_mask: + .long 0xa0000000 +ccr_addr: + .long 0xff00001c +ccr_data: + .word 0x090b + + .align 4 + +#ifdef __ELF__ + .section .stack,"aw" +#else + .section .stack +#endif +! _stack: .long 0xdeaddead + diff --git a/AICA/SRCS/dxm-0.9/example/dc.x b/AICA/SRCS/dxm-0.9/example/dc.x new file mode 100644 index 00000000..5ea23dcb --- /dev/null +++ b/AICA/SRCS/dxm-0.9/example/dc.x @@ -0,0 +1,228 @@ +/* Sega Dreamcast linker script */ + +OUTPUT_FORMAT("elf32-shl", "elf32-shl", + "elf32-shl") +OUTPUT_ARCH(sh) +ENTRY(start) + SEARCH_DIR(/usr/local/dcdev/sh-elf/lib); +/* Do we need any of these for elf? + __DYNAMIC = 0; */ + +MEMORY +{ + ram (rwx) : ORIGIN = 0x8c010000, LENGTH = 0xfe0000 +} + +SECTIONS +{ + /* Read-only sections, merged into text segment: */ +/* . = 0x1000;*/ + .interp : { *(.interp) } + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + .rel.init : { *(.rel.init) } + .rela.init : { *(.rela.init) } + .rel.text : + { + *(.rel.text) + *(.rel.text.*) + *(.rel.gnu.linkonce.t*) + } + .rela.text : + { + *(.rela.text) + *(.rela.text.*) + *(.rela.gnu.linkonce.t*) + } + .rel.fini : { *(.rel.fini) } + .rela.fini : { *(.rela.fini) } + .rel.rodata : + { + *(.rel.rodata) + *(.rel.rodata.*) + *(.rel.gnu.linkonce.r*) + } + .rela.rodata : + { + *(.rela.rodata) + *(.rela.rodata.*) + *(.rela.gnu.linkonce.r*) + } + .rel.data : + { + *(.rel.data) + *(.rel.data.*) + *(.rel.gnu.linkonce.d*) + } + .rela.data : + { + *(.rela.data) + *(.rela.data.*) + *(.rela.gnu.linkonce.d*) + } + .rel.ctors : { *(.rel.ctors) } + .rela.ctors : { *(.rela.ctors) } + .rel.dtors : { *(.rel.dtors) } + .rela.dtors : { *(.rela.dtors) } + .rel.got : { *(.rel.got) } + .rela.got : { *(.rela.got) } + .rel.sdata : + { + *(.rel.sdata) + *(.rel.sdata.*) + *(.rel.gnu.linkonce.s*) + } + .rela.sdata : + { + *(.rela.sdata) + *(.rela.sdata.*) + *(.rela.gnu.linkonce.s*) + } + .rel.sbss : { *(.rel.sbss) } + .rela.sbss : { *(.rela.sbss) } + .rel.bss : { *(.rel.bss) } + .rela.bss : { *(.rela.bss) } + .rel.plt : { *(.rel.plt) } + .rela.plt : { *(.rela.plt) } + .init : + { + KEEP (*(.init)) + } =0 + .plt : { *(.plt) } + .text : + { + *(.text) + *(.text.*) + *(.stub) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + } =0 + _etext = .; + PROVIDE (etext = .); + .fini : + { + KEEP (*(.fini)) + } =0 + .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) } + .rodata1 : { *(.rodata1) } + /* Adjust the address for the data segment. We want to adjust up to + the same address within the page on the next page up. */ + . = ALIGN(128) + (. & (128 - 1)); + .data : + { + *(.data) + *(.data.*) + *(.gnu.linkonce.d*) + SORT(CONSTRUCTORS) + } + .data1 : { *(.data1) } + .eh_frame : { *(.eh_frame) } + .gcc_except_table : { *(.gcc_except_table) } + .ctors ALIGN(4): + { + ___ctors = .; + /* gcc uses crtbegin.o to find the start of + the constructors, so we make sure it is + first. Because this is a wildcard, it + doesn't matter if the user does not + actually link against crtbegin.o; the + linker won't look for a file to match a + wildcard. The wildcard also means that it + doesn't matter which directory crtbegin.o + is in. */ + KEEP (*crtbegin.o(.ctors)) + /* We don't want to include the .ctor section from + from the crtend.o file until after the sorted ctors. + The .ctor section from the crtend file contains the + end of ctors marker and it must be last */ + KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + ___ctors_end = .; + } + .dtors : + { + ___dtors = .; + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + ___dtors_end = .; + } + .got : { *(.got.plt) *(.got) } + .dynamic : { *(.dynamic) } + /* We want the small data sections together, so single-instruction offsets + can access them all, and initialized data all before uninitialized, so + we can shorten the on-disk segment size. */ + .sdata : + { + *(.sdata) + *(.sdata.*) + *(.gnu.linkonce.s.*) + } + _edata = .; + PROVIDE (edata = .); + __bss_start = .; + .sbss : + { + *(.dynsbss) + *(.sbss) + *(.sbss.*) + *(.scommon) + } + .bss : + { + *(.dynbss) + *(.bss) + *(.bss.*) + *(COMMON) + /* Align here to ensure that the .bss section occupies space up to + _end. Align after .bss to ensure correct alignment even if the + .bss section disappears because there are no input sections. */ + . = ALIGN(32 / 8); + } + . = ALIGN(32 / 8); + _end = .; + PROVIDE (end = .); + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } +/* .stack 0x8c00f400 : { _stack = .; *(.stack) }*/ + /* These must appear regardless of . */ +_stack = 0x8d000000; +} diff --git a/AICA/SRCS/dxm-0.9/example/driver.x b/AICA/SRCS/dxm-0.9/example/driver.x new file mode 100644 index 00000000..b0400a4a --- /dev/null +++ b/AICA/SRCS/dxm-0.9/example/driver.x @@ -0,0 +1,3 @@ +SECTIONS { + .driverdata ALIGN(32): { _driver = . ; *(.data) } +} diff --git a/AICA/SRCS/dxm-0.9/example/main.c b/AICA/SRCS/dxm-0.9/example/main.c new file mode 100644 index 00000000..7585e2cc --- /dev/null +++ b/AICA/SRCS/dxm-0.9/example/main.c @@ -0,0 +1,56 @@ +/* test.c - test prg */ + +#include "../src/types.h" +#include "../src/sh4/dxm.h" + +#define DRIVERSIZE 16000 +#define MODULESIZE 2000000 + +extern void *driver; +extern void *module; + +extern void __exit(sint32); + +/* keep gcc from whining */ +void +exit(status) + sint32 status; +{ + __exit(status); +} + +int +main() +{ + +/* printf("disabling the ARM\n"); */ + dxm_disable_arm(); + +/* printf("loading module\n"); */ + /* load module */ + dxm_sramcpy4((void *)0x00010000, &module, MODULESIZE); + +/* printf("loading driver\n"); */ + /* load driver */ + dxm_load_driver(&driver, DRIVERSIZE); + +/* printf("enabling the ARM\n"); */ + dxm_enable_arm(); + + /* wait for ARM to initialize */ + if (dxm_init_done() < 0) { +/* printf("timeout!\n"); */ + exit(0); + } + + /* set mono */ + dxm_set_stereo(FALSE); + +/* printf("start playing the XM\n"); */ + dxm_play_xm(); + +/* printf("all done!\n"); */ + + return (0); + +} diff --git a/AICA/SRCS/dxm-0.9/example/module.x b/AICA/SRCS/dxm-0.9/example/module.x new file mode 100644 index 00000000..78b7c8a2 --- /dev/null +++ b/AICA/SRCS/dxm-0.9/example/module.x @@ -0,0 +1,3 @@ +SECTIONS { + .moduledata ALIGN(32): { _module = . ; *(.data) } +} diff --git a/AICA/SRCS/dxm-0.9/src/CVS/Entries b/AICA/SRCS/dxm-0.9/src/CVS/Entries new file mode 100644 index 00000000..e74ce0a5 --- /dev/null +++ b/AICA/SRCS/dxm-0.9/src/CVS/Entries @@ -0,0 +1,14 @@ +/Makefile.in/1.1.1.1/Sat Sep 8 10:48:15 2001// +/aica.c/1.1.1.1/Sat Sep 8 10:48:15 2001// +/aica.h/1.1.1.1/Sat Sep 8 10:48:15 2001// +/arm.x/1.1.1.1/Sat Sep 8 10:48:15 2001// +/control.c/1.1.1.1/Sat Sep 8 10:48:15 2001// +/crt0.S/1.1.1.1/Sat Sep 8 10:48:15 2001// +/dxm.h/1.1.1.1/Sat Sep 8 10:48:15 2001// +/loader.c/1.1.1.1/Sat Sep 8 10:48:15 2001// +/main.c/1.1.1.1/Sat Sep 8 10:48:15 2001// +/player.c/1.1.1.1/Sat Sep 8 10:48:15 2001// +/types.h/1.1.1.1/Sat Sep 8 10:48:15 2001// +D/arm//// +D/host//// +D/sh4//// diff --git a/AICA/SRCS/dxm-0.9/src/CVS/Repository b/AICA/SRCS/dxm-0.9/src/CVS/Repository new file mode 100644 index 00000000..41366f52 --- /dev/null +++ b/AICA/SRCS/dxm-0.9/src/CVS/Repository @@ -0,0 +1 @@ +/usr/home/ejstans/cvs/dxm/src diff --git a/AICA/SRCS/dxm-0.9/src/CVS/Root b/AICA/SRCS/dxm-0.9/src/CVS/Root new file mode 100644 index 00000000..e14dc10a --- /dev/null +++ b/AICA/SRCS/dxm-0.9/src/CVS/Root @@ -0,0 +1 @@ +/usr/home/ejstans/cvs diff --git a/AICA/SRCS/dxm-0.9/src/Makefile.in b/AICA/SRCS/dxm-0.9/src/Makefile.in new file mode 100644 index 00000000..41bbb4a3 --- /dev/null +++ b/AICA/SRCS/dxm-0.9/src/Makefile.in @@ -0,0 +1,42 @@ +# Makefile for dxm + +ACC = @ACC@ +AOBJCOPY = @AOBJCOPY@ +DCC = @DCC@ +ACFLAGS = @ACFLAGS@ +DCFLAGS = @DCFLAGS@ + +all: arm/player.bin sh4/loader.o host/loader sh4/control.o + +arm/player.bin: arm/player.elf + ${AOBJCOPY} -O binary arm/player.elf arm/player.bin + +arm/player.elf: crt0.o aica.o main.o player.o + ${ACC} ${ACFLAGS} -nostartfiles -nostdlib -o arm/player.elf crt0.o main.o player.o aica.o -lgcc -Wl,-T,arm.x + +crt0.o: crt0.S + ${ACC} ${ACFLAGS} -c crt0.S + +main.o: main.c types.h dxm.h + ${ACC} ${ACFLAGS} -c main.c + +aica.o: aica.c types.h dxm.h aica.h + ${ACC} ${ACFLAGS} -c aica.c + +player.o: player.c types.h dxm.h + ${ACC} ${ACFLAGS} -c player.c + +sh4/loader.o: loader.c types.h dxm.h + ${DCC} ${DCFLAGS} -c -o sh4/loader.o loader.c + +sh4/control.o: control.c sh4/types.h sh4/dxm.h + ${DCC} ${DCFLAGS} -c -o sh4/control.o control.c + +host/loader: loader.c types.h dxm.h + ${CC} -O2 -DHOST -o host/loader loader.c + +clean: + rm -f *.o arm/player.bin arm/player.elf host/loader sh4/*.o + +distclean: + rm -f *.o arm/player.bin arm/player.elf host/loader sh4/*.o config.* Makefile diff --git a/AICA/SRCS/dxm-0.9/src/aica.c b/AICA/SRCS/dxm-0.9/src/aica.c new file mode 100644 index 00000000..74807a14 --- /dev/null +++ b/AICA/SRCS/dxm-0.9/src/aica.c @@ -0,0 +1,256 @@ +/* aica.c - sound hardware routines */ + +#include "types.h" +#include "dxm.h" +#include "aica.h" + +/* only define if debugging */ +//#define DEBUG 1 + +/* hw-regs */ +static aica_vox_t *AICA_VOX = (aica_vox_t *)0x00800000; + +/* prototypes */ +void hw_init(void); +void hw_play_waveform(XM_SM_HEADER *, uint32, uint32, uint32); +void hw_set_vol_pan_freq(uint8, uint8, uint8, uint8, uint32); +uint32 random(void); + +/* private prototypes */ +static uint16 convert_freq(uint32); +static uint16 convert_pan_vol(sint8, uint32); +static uint16 convert_volume2(uint32); + +static const char id[] __attribute__ ((section (".text"))) = + "dxm $Id: aica.c,v 1.1.1.1 2001/09/08 10:48:15 ejstans Exp $"; + +/* taken from Dan Potters s3mplay but I'm not sure it is correct */ +/* neither of these are correct, so im just using the linear volume + directly (this is not correct either but will save a few bytes of + memory and actually sounds somewhat better */ +/* +static uint8 VolTab[] = { + 0xff, 0x4a, 0x48, 0x47, 0x46, 0x44, 0x43, 0x42, 0x40, 0x3f, + 0x3e, 0x3c, 0x3b, 0x3a, 0x38, 0x37, 0x36, 0x35, 0x33, 0x32, + 0x31, 0x30, 0x2e, 0x2d, 0x2c, 0x2b, 0x2a, 0x28, 0x27, 0x26, + 0x25, 0x24, 0x23, 0x22, 0x20, 0x1f, 0x1e, 0x1d, 0x1c, 0x1b, + 0x1a, 0x19, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10, + 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07, 0x06, + 0x05, 0x04, 0x03, 0x01, 0x00, +*/ +/* + 0xff, 0x7f, 0x69, 0x5d, 0x54, 0x4d, 0x47, 0x43, 0x3f, 0x3b, + 0x38, 0x35, 0x32, 0x30, 0x2d, 0x2b, 0x29, 0x27, 0x26, 0x24, + 0x22, 0x21, 0x1f, 0x1e, 0x1d, 0x1b, 0x1a, 0x19, 0x18, 0x17, + 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10, 0x0f, 0x0f, 0x0e, + 0x0d, 0x0c, 0x0b, 0x0b, 0x0a, 0x09, 0x09, 0x08, 0x07, 0x07, + 0x06, 0x05, 0x05, 0x04, 0x04, 0x03, 0x03, 0x02, 0x02, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, + +}; + +*/ + +/* initialize hw-registers */ +void +hw_init() +{ + sint32 i, j; + uint32 *p; + + *(uint32 *)0x00802800 = 0; + + /* reset the 64 voice channels */ + for (i = 0; i < 64; i++) { + AICA_VOX[i].cfg_addr_hi = 0x8000; + AICA_VOX[i].addr_lo = 0; + AICA_VOX[i].loop_start = 0; + AICA_VOX[i].loop_end = 0; + AICA_VOX[i].adsr1 = 0x0000; + AICA_VOX[i].adsr2 = 0x0000; + AICA_VOX[i].pitch = 0; + AICA_VOX[i].lfo1 = 0x0000; + AICA_VOX[i].lfo2 = 0; + AICA_VOX[i].pan_volume = 0; + AICA_VOX[i].volume2 = 0x0020; + AICA_VOX[i].unknown[0] = 0x1fff; + AICA_VOX[i].unknown[1] = 0x1fff; + AICA_VOX[i].unknown[2] = 0x1fff; + AICA_VOX[i].unknown[3] = 0x1fff; + AICA_VOX[i].unknown[4] = 0x1fff; + for (j = 5; j < 21; j++) { + AICA_VOX[i].unknown[j] = 0; + } + } + p = (uint32 *)0x00803400; + for (i = 0; i < 0x0800/4; i++) { + p[i] = 0; + } + p = (uint32 *)0x00803000; + for (i = 0; i < 0x0200/4; i++) { + p[i] = 0; + } + p = (uint32 *)0x00803200; + for (i = 0; i < 0x0100/4; i++) { + p[i] = 0; + } + p = (uint32 *)0x00804000; + for (i = 0; i < 0x0400/4; i++) { + p[i] = 0; + } + + for (i = 0; i < 8; i++) { + *(uint32 *)0x00802d04 = 0x0008; + __asm__("nop"); + __asm__("nop"); + __asm__("nop"); + __asm__("nop"); + } + *(uint32 *)0x00802800 = 15; + +} + +void +hw_play_waveform(my_sm_hdr, ch, sample_offset, freq) + XM_SM_HEADER *my_sm_hdr; + uint32 ch; + uint32 sample_offset; + uint32 freq; +{ + + uint32 loop = 0; + uint32 format = 0; + uint32 addr = (uint32)(my_sm_hdr->data) + sample_offset; + + /* the following can be used to mask out channels */ + +#ifdef DEBUG + switch (ch) { + case 9: + case 10: + case 11: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + break; + default: + return; + break; + } +#endif /* DEBUG */ + + + /* must change sample type later if ADPCM is to be supported */ + if ((my_sm_hdr->type & 0x10) == 0x10) { + format = 0; + } else { + format = 1; + } + + /* stop any previous sound */ + AICA_VOX[ch].cfg_addr_hi = KEYOFF; + /* set lo-order bits of waveform address */ + AICA_VOX[ch].addr_lo = addr & 0xffff; + switch (my_sm_hdr->type>>5) { + case 0: + /* short waveform */ + AICA_VOX[ch].loop_start = my_sm_hdr->loop_start - sample_offset; + AICA_VOX[ch].loop_end = my_sm_hdr->loop_end - sample_offset; + if ((my_sm_hdr->type & 0x03) != 0) { + loop = 1; + } +// /* remove */ loop = 1; + break; + case 1: + case 2: + case 3: + /* the rest dont use hw-loops (at least not here) */ + AICA_VOX[ch].loop_start = 0; + AICA_VOX[ch].loop_end = 0xffff; + loop = 0; + break; + } +// AICA_VOX[ch].adsr1 = 0x07df; + AICA_VOX[ch].adsr1 = 0x07fa; + AICA_VOX[ch].adsr2 = 0x0000; + AICA_VOX[ch].pitch = convert_freq(freq); + AICA_VOX[ch].lfo1 = 0x4210; + AICA_VOX[ch].lfo2 = 0x0000; + /* dont set any volume here; will set vol+pan after env proc. */ + AICA_VOX[ch].pan_volume = 0x0000; +// AICA_VOX[ch].pan_volume = 0x0f00; +// AICA_VOX[ch].volume2 = 0x0020; + /* start playing the waveform */ + AICA_VOX[ch].cfg_addr_hi = KEYON | (loop<<9) | (format<<7) + | ((addr>>16) & 0x1f); +} + +/* convert frequency to AICA format [algorithm by Marcus Comstedt] */ +static uint16 +convert_freq(freq) + uint32 freq; +{ + + uint32 freq_lo, freq_base = 5644800; + sint32 freq_hi = 7; + + while (freq < freq_base && freq_hi > -8) { + freq_base >>= 1; + freq_hi--; + } + freq_lo = (freq<<10) / freq_base; + return ((freq_hi << 11) | (freq_lo & 1023)); + +} + +/* convert paning and global volume to AICA format */ +static uint16 +convert_pan_vol(pan, vol) + sint8 pan; + uint32 vol; +{ + if (pan < 0) { + pan = ((~pan)>>3) & 0x0f; + } else { + pan = ((pan>>3) & 0x0f) | 0x10; + } + return ((((vol>>2) & 0x0f)<<8) | pan); +} + +/* convert volume to AICA format */ +static uint16 +convert_volume2(vol) + uint32 vol; +{ + return ((vol == 0) ? 0xff20 : (((~(vol-1)) & 0x3f)<<8) | 0x20); + /* return ((VolTab[vol]<<8) | 0x20); */ +} + +/* set final volume, panning and frequency */ +void +hw_set_vol_pan_freq(ch, mvol, vol, pan, freq) + uint8 ch; + uint8 mvol; + uint8 vol; + uint8 pan; + uint32 freq; +{ + AICA_VOX[ch].pan_volume = convert_pan_vol(pan, mvol); + AICA_VOX[ch].volume2 = convert_volume2(vol); + + /* clamp frequency here (not really necessary) */ + + /* set sound frequency */ + AICA_VOX[ch].pitch = convert_freq(freq); +} + +/* returns a (hehe) "random" number */ +uint32 +random() +{ + return (*(uint32 *)0x00810004); +} diff --git a/AICA/SRCS/dxm-0.9/src/aica.h b/AICA/SRCS/dxm-0.9/src/aica.h new file mode 100644 index 00000000..4e126428 --- /dev/null +++ b/AICA/SRCS/dxm-0.9/src/aica.h @@ -0,0 +1,27 @@ +/* aica.h - definitions and structures for AICA hardware */ + +#ifndef _AICA_H_ +#define _AICA_H_ + +#include "types.h" + +#define KEYON 0xc000 +#define KEYOFF 0x8000 + +/* put voice registers in a struct */ +typedef struct { + volatile uint32 cfg_addr_hi; /* _0000 */ + volatile uint32 addr_lo; /* _0004 */ + volatile uint32 loop_start; /* _0008 */ + volatile uint32 loop_end; /* _000c */ + volatile uint32 adsr1; /* _0010 */ + volatile uint32 adsr2; /* _0014 */ + volatile uint32 pitch; /* _0018 */ + volatile uint32 lfo1; /* _001c */ + volatile uint32 lfo2; /* _0020 */ + volatile uint32 pan_volume; /* _0024 */ + volatile uint32 volume2; /* _0028 */ + volatile uint32 unknown[21]; /* _002c - _007c */ +} aica_vox_t; + +#endif /* _AICA_H_ */ diff --git a/AICA/SRCS/dxm-0.9/src/arm.x b/AICA/SRCS/dxm-0.9/src/arm.x new file mode 100644 index 00000000..f6702a65 --- /dev/null +++ b/AICA/SRCS/dxm-0.9/src/arm.x @@ -0,0 +1,225 @@ +OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", + "elf32-littlearm") +OUTPUT_ARCH(arm) +ENTRY(_start) + SEARCH_DIR(/usr/local/dc/arm-elf/lib); +/* Do we need any of these for elf? + __DYNAMIC = 0; */ + +MEMORY +{ + ram (rwx) : ORIGIN = 0x00000000, LENGTH = 0x10000 +} + + +SECTIONS +{ + /* Read-only sections, merged into text segment: */ + . = 0x8000; + .interp : { *(.interp) } + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + .rel.init : { *(.rel.init) } + .rela.init : { *(.rela.init) } + .rel.text : + { + *(.rel.text) + *(.rel.text.*) + *(.rel.gnu.linkonce.t*) + } + .rela.text : + { + *(.rela.text) + *(.rela.text.*) + *(.rela.gnu.linkonce.t*) + } + .rel.fini : { *(.rel.fini) } + .rela.fini : { *(.rela.fini) } + .rel.rodata : + { + *(.rel.rodata) + *(.rel.rodata.*) + *(.rel.gnu.linkonce.r*) + } + .rela.rodata : + { + *(.rela.rodata) + *(.rela.rodata.*) + *(.rela.gnu.linkonce.r*) + } + .rel.data : + { + *(.rel.data) + *(.rel.data.*) + *(.rel.gnu.linkonce.d*) + } + .rela.data : + { + *(.rela.data) + *(.rela.data.*) + *(.rela.gnu.linkonce.d*) + } + .rel.ctors : { *(.rel.ctors) } + .rela.ctors : { *(.rela.ctors) } + .rel.dtors : { *(.rel.dtors) } + .rela.dtors : { *(.rela.dtors) } + .rel.got : { *(.rel.got) } + .rela.got : { *(.rela.got) } + .rel.sdata : + { + *(.rel.sdata) + *(.rel.sdata.*) + *(.rel.gnu.linkonce.s*) + } + .rela.sdata : + { + *(.rela.sdata) + *(.rela.sdata.*) + *(.rela.gnu.linkonce.s*) + } + .rel.sbss : { *(.rel.sbss) } + .rela.sbss : { *(.rela.sbss) } + .rel.bss : { *(.rel.bss) } + .rela.bss : { *(.rela.bss) } + .rel.plt : { *(.rel.plt) } + .rela.plt : { *(.rela.plt) } + .init : + { + KEEP (*(.init)) + } =0 + .plt : { *(.plt) } + .text : + { + *(.text) + *(.text.*) + *(.stub) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + *(.glue_7t) *(.glue_7) + } =0 + _etext = .; + PROVIDE (etext = .); + .fini : + { + KEEP (*(.fini)) + } =0 + .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) } + .rodata1 : { *(.rodata1) } + /* Adjust the address for the data segment. We want to adjust up to + the same address within the page on the next page up. */ + . = ALIGN(256) + (. & (256 - 1)); + .data : + { + *(.data) + *(.data.*) + *(.gnu.linkonce.d*) + SORT(CONSTRUCTORS) + } + .data1 : { *(.data1) } + .eh_frame : { KEEP (*(.eh_frame)) } + .gcc_except_table : { *(.gcc_except_table) } + .ctors : + { + /* gcc uses crtbegin.o to find the start of + the constructors, so we make sure it is + first. Because this is a wildcard, it + doesn't matter if the user does not + actually link against crtbegin.o; the + linker won't look for a file to match a + wildcard. The wildcard also means that it + doesn't matter which directory crtbegin.o + is in. */ + KEEP (*crtbegin.o(.ctors)) + /* We don't want to include the .ctor section from + from the crtend.o file until after the sorted ctors. + The .ctor section from the crtend file contains the + end of ctors marker and it must be last */ + KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + } + .dtors : + { + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + } + .got : { *(.got.plt) *(.got) } + .dynamic : { *(.dynamic) } + /* We want the small data sections together, so single-instruction offsets + can access them all, and initialized data all before uninitialized, so + we can shorten the on-disk segment size. */ + .sdata : + { + *(.sdata) + *(.sdata.*) + *(.gnu.linkonce.s.*) + } + _edata = .; + PROVIDE (edata = .); + __bss_start = .; + __bss_start__ = .; + .sbss : + { + *(.dynsbss) + *(.sbss) + *(.sbss.*) + *(.scommon) + } + .bss : + { + *(.dynbss) + *(.bss) + *(.bss.*) + *(COMMON) + /* Align here to ensure that the .bss section occupies space up to + _end. Align after .bss to ensure correct alignment even if the + .bss section disappears because there are no input sections. */ + . = ALIGN(32 / 8); + } + . = ALIGN(32 / 8); + _end = .; + _bss_end__ = . ; __bss_end__ = . ; __end__ = . ; + PROVIDE (end = .); + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + .stack 0xb000 : { _stack = .; *(.stack) } + /* These must appear regardless of . */ +} diff --git a/AICA/SRCS/dxm-0.9/src/arm/CVS/Entries b/AICA/SRCS/dxm-0.9/src/arm/CVS/Entries new file mode 100644 index 00000000..17848105 --- /dev/null +++ b/AICA/SRCS/dxm-0.9/src/arm/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/AICA/SRCS/dxm-0.9/src/arm/CVS/Repository b/AICA/SRCS/dxm-0.9/src/arm/CVS/Repository new file mode 100644 index 00000000..ac2c3620 --- /dev/null +++ b/AICA/SRCS/dxm-0.9/src/arm/CVS/Repository @@ -0,0 +1 @@ +/usr/home/ejstans/cvs/dxm/src/arm diff --git a/AICA/SRCS/dxm-0.9/src/arm/CVS/Root b/AICA/SRCS/dxm-0.9/src/arm/CVS/Root new file mode 100644 index 00000000..e14dc10a --- /dev/null +++ b/AICA/SRCS/dxm-0.9/src/arm/CVS/Root @@ -0,0 +1 @@ +/usr/home/ejstans/cvs diff --git a/AICA/SRCS/dxm-0.9/src/control.c b/AICA/SRCS/dxm-0.9/src/control.c new file mode 100644 index 00000000..37972374 --- /dev/null +++ b/AICA/SRCS/dxm-0.9/src/control.c @@ -0,0 +1,417 @@ +/* control.c - SH4 control over module playing */ + +#include "sh4/dxm.h" +#include "types.h" +#include "aica.h" + +/* hardware registers */ +static aica_vox_t *AICA_VOX = (aica_vox_t *)0xa0700000; + +/* private prototypes */ +sint32 G2Write(uint32 *, uint32); +sint32 G2Read(volatile uint32 *, uint32 *); + +static void *spu_memset(void *, uint32, uint32); +static void *spu_memcpy(void *, void *, uint32); +static uint32 convert_volume(uint32); +static uint32 convert_pan(sint32); +static uint32 convert_freq(uint32); + +/* get a more appropriate timeout later */ +#define TIMEOUT 1000000 + +XM_INFO *xm_info = (XM_INFO *)XM_INFO_ADDR; +OS_HEADER os_header[32]; + +sint32 +dxm_disable_arm() +{ + sint32 val; + sint32 i; + sint32 *ptr; + + /* disable ARM cpu */ + if (G2Read((uint32 *)0xa0702c00, &val) < 0) { + return (-1); + } + G2Write((void *)0xa0702c00, val | 1); + + /* turn off all voices */ + for (i = 0, ptr = (sint32 *)0xa0700000; i < 64; i++) { + G2Write(ptr, 0x80000000); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + G2Write(ptr, 0); + } + return (0); + +} + +sint32 +dxm_enable_arm() +{ + + uint32 val; + + /* enable ARM cpu */ + if (G2Read((uint32 *)0xa0702c00, &val) < 0) { + return (-1); + } + G2Write((void *)0xa0702c00, val & (~1)); + + return (0); + +} + +sint32 +dxm_load_driver(driver, size) + void *driver; + uint32 size; +{ + + /* make sure ARM is disabled */ + dxm_disable_arm(); + + /* clear all of driver sound RAM (first 64kbytes) */ + spu_memset((void *)0x00000000, 0, 64*1024); + + /* copy driver to sound RAM */ + spu_memcpy((void *)0x00000000, driver, size); + + return (0); + +} + +void * +dxm_sramcpy4(dst, src, size) + void *dst; + void *src; + uint32 size; +{ + return (spu_memcpy(dst, src, size)); +} + +sint32 +dxm_halt_xm() +{ + G2Write(&(xm_info->play), 0); + return (0); +} + +sint32 +dxm_init_xm(order) + uint32 order; +{ + + uint32 timeout = TIMEOUT; + uint32 val; + + G2Write(&(xm_info->init), order); + + do { + if ((G2Read(&(xm_info->init), &val) < 0) || !timeout--) { + return (-1); + } + } while (val != 0); + return (0); + +} + +sint32 +dxm_init_done() +{ + + uint32 timeout = TIMEOUT; + uint32 val; + + do { + if ((G2Read(&(xm_info->done), &val) < 0) || !timeout--) { + return (-1); + } + } while (val == 0); + return (0); + +} + +sint32 +dxm_play_xm() +{ + G2Write(&(xm_info->play), 1); + return (0); +} + +sint32 +dxm_set_stereo(mode) + bool mode; +{ + G2Write(&(xm_info->play), mode); + return (0); +} + +sint32 +dxm_open_os(ch, addr, format, loop, start, end, size, freq, pan, volume) + uint32 ch; + uint32 addr; + uint32 format; + uint32 loop; + uint32 start; + uint32 end; + uint32 size; + uint32 freq; + uint32 pan; + uint32 volume; +{ + + /* fill out the structure for specified channel */ + os_header[ch].addr = addr; + os_header[ch].flags = ((format & 0x02)<<7) | ((loop & 0x01)<<9); + if (loop) { + os_header[ch].loop = (start & 0xffff) | (end<<16); + } else { + os_header[ch].loop = (size<<16); + } + os_header[ch].pitch = convert_freq(freq); + os_header[ch].pan_volume = convert_pan(pan) + | (convert_volume(volume)<<8); + return (0); + +} + +sint32 +dxm_play_os(ch) + uint32 ch; +{ + + sint32 flags; + sint32 i = ch + 32; + + /* if looping ADPCM, make sure the waveform format is MODE_ADPCM_LOOP */ + flags = os_header[ch].flags; + if (flags & 0x0300) { + flags |= 0x0080; + } + + G2Write((uint32 *)AICA_VOX[i].cfg_addr_hi, KEYOFF); + G2Write((uint32 *)AICA_VOX[i].addr_lo, os_header[ch].addr & 0xffff); + G2Write((uint32 *)AICA_VOX[i].loop_start, os_header[ch].loop & 0xffff); + G2Write((uint32 *)AICA_VOX[i].loop_end, (os_header[ch].loop>>16) & 0xffff); + G2Write((uint32 *)AICA_VOX[i].adsr1, 0x07df); + G2Write((uint32 *)AICA_VOX[i].adsr2, 0x0000); + G2Write((uint32 *)AICA_VOX[i].pitch, os_header[ch].pitch & 0xffff); + G2Write((uint32 *)AICA_VOX[i].lfo1, 0x0000); + G2Write((uint32 *)AICA_VOX[i].lfo2, 0x0000); + G2Write((uint32 *)AICA_VOX[i].pan_volume, os_header[ch].pan_volume & 0xffff); + G2Write((uint32 *)AICA_VOX[i].volume2, os_header[ch].volume2 & 0xffff); + G2Write((uint32 *)AICA_VOX[i].unknown[0], 0x0000); + G2Write((uint32 *)AICA_VOX[i].unknown[1], 0x0000); + G2Write((uint32 *)AICA_VOX[i].unknown[2], 0x0000); + G2Write((uint32 *)AICA_VOX[i].unknown[3], 0x0000); + G2Write((uint32 *)AICA_VOX[i].cfg_addr_hi, KEYON + | (os_header[ch].flags & 0x0380) + | ((os_header[ch].addr>>16) & 0x001f)); + return (0); + +} + +sint32 +dxm_stop_os(ch) + uint32 ch; +{ + + uint32 val; + sint32 i = ch + 32; + + /* move ARM stuff here instead */ + + if (G2Read((uint32 *)AICA_VOX[i].cfg_addr_hi, &val) < 0) { + return (-1); + } + G2Write((uint32 *)AICA_VOX[i].cfg_addr_hi, (val & ~0x4200) | 0x8000); + return (0); + +} + +sint32 +dxm_set_volume_os(ch, volume) + uint32 ch; + uint32 volume; +{ + sint32 i = ch + 32; + + os_header[ch].pan_volume = (os_header[ch].pan_volume & 0xf0ff) + | (convert_volume(volume)<<8); + + G2Write((uint32 *)AICA_VOX[i].pan_volume, os_header[ch].pan_volume); + + return (0); + +} + +sint32 +dxm_set_pan_os(ch, pan) + uint32 ch; + sint32 pan; +{ + + sint32 i = ch + 32; + + os_header[ch].pan_volume = (os_header[ch].pan_volume & 0xffe0) + | convert_pan(pan); + + G2Write((uint32 *)AICA_VOX[i].pan_volume, os_header[ch].pan_volume); + + return (0); + +} + +/* 0: no sound, 128: max sound */ +static uint32 +convert_volume(volume) + uint32 volume; +{ + return ((volume>>3) & 0x0f); +} + +/* -128 = panned to the left, 0 = center, 128 = panned to the right */ +static uint32 +convert_pan(pan) + sint32 pan; +{ + pan += 128; + pan = pan>>3; + if (pan < 16) { + pan = ~(pan - 16); + } + return (pan & 0x1f); +} + +/* converts to floating-point form (algo by Marcus Comstedt) */ +static uint32 +convert_freq(freq) + uint32 freq; +{ + + uint32 freq_lo, freq_base = 5644800; + sint32 freq_hi = 7; + + while (freq < freq_base && freq_hi > -8) { + freq_base >>= 1; + --freq_hi; + } + freq_lo = (freq<<10) / freq_base; + return ((freq_hi << 11) | (freq_lo & 1023)); + +} + +sint32 +G2Write(addr, val) + uint32 *addr; + uint32 val; +{ + + /* should disable IRQs + DMA here */ + + while (*(volatile uint32 *)0xa05f688c & 0x11); + + *addr = val; + + while (*(volatile uint32 *)0xa05f688c & 0x11); + + /* should enable IRQs + DMA here */ + + return (0); + +} + +sint32 +G2Read(addr, val) + volatile uint32 *addr; + uint32 *val; +{ + + uint32 val1, val2; + uint32 timeout = 0; + + while (*(volatile uint32 *)0xa05f688c & 0x11); + + do { + val1 = *addr; + val2 = *addr; + + while (*(volatile uint32 *)0xa05f688c & 0x11); + + if (timeout++ > 10000) { + return (-1); + } + } while (val1 != val2); + + *val = val1; + + return (0); + +} + +/* only 32-bit writes */ +static void * +spu_memset(s, c, n) + void *s; + uint32 c; + uint32 n; +{ + + uint32 i; + uint32 *ptr = (uint32 *)s + 0xa0800000/4; + + for (i = 0, n >>= 2; i < n; i++) { + G2Write(ptr++, c); + } + + return (s); + +} + +/* only 32-bit writes */ +static void * +spu_memcpy(dst, src, n) + void *dst; + void *src; + uint32 n; +{ + + uint32 i; + uint32 *s = (uint32 *)src, *d = (uint32 *)dst + 0xa0800000/4; + + for (i = 0, n >>= 2; i < n; i++) { + G2Write(d++, *(s++)); + } + + return (dst); + +} diff --git a/AICA/SRCS/dxm-0.9/src/crt0.S b/AICA/SRCS/dxm-0.9/src/crt0.S new file mode 100644 index 00000000..7a48e645 --- /dev/null +++ b/AICA/SRCS/dxm-0.9/src/crt0.S @@ -0,0 +1,79 @@ +# crt0.S - ARM startup + interrupt routines + + .globl _start, interval, counter + .xref main + .text + +_start: + b reset + b not_handled + b not_handled + b not_handled + b not_handled + b not_handled + b not_handled + +# FIQ directly without a branch (wow! this is major optimization =) + ldr r8,intpend + ldr r9,[r8] + and r9,r9,#7 + cmp r9,#2 + bne done + +# set interrupt interval + ldr r8,timerctrl + ldr r9,interval + str r9,[r8,#0x10] +# this prolly enables the interrupt + mov r9,#0x40 + str r9,[r8,#0x24] + +# update counter + ldr r8,counter + add r8,r8,#1 + str r8,counter + +done: + ldr r8,intclear + mov r9,#1 +# the sega-driver does these 4 writes... + str r9,[r8] + str r9,[r8] + str r9,[r8] + str r9,[r8] +not_handled: + subs pc,lr,#4 + +stackptr: + .long 0x00000000 + +intpend: + .long 0x00802d00 +intclear: + .long 0x00802d04 +timerctrl: + .long 0x00802880 +interval: + .long (256-(44100/4410)) +counter: + .long 0x00000000 + +id: + .ascii "dxm $Id: crt0.S,v 1.1.1.1 2001/09/08 10:48:15 ejstans Exp $" + .byte 0 + + .align 2 +reset: +# setup stacks +# save 0xb000 at address 0xaffc and read it back to USER sp + mov sp,#0xb000 + stmfd sp,{sp} + ldmea sp,{sp}^ + nop +# enable FIQ and go from SUPERVISOR to USER mode + mrs r14,cpsr + bic r14,r14,#0x43 + msr cpsr,r14 + +# call main routine + b main diff --git a/AICA/SRCS/dxm-0.9/src/dxm.h b/AICA/SRCS/dxm-0.9/src/dxm.h new file mode 100644 index 00000000..6f29e794 --- /dev/null +++ b/AICA/SRCS/dxm-0.9/src/dxm.h @@ -0,0 +1,167 @@ +/* dxm.h - definitions, structs etc for dxm */ + +#ifndef _DXM_H_ +#define _DXM_H_ + +#include "types.h" + +#define NO_LOOP 0 +#define LOOP 1 + +#define MODE_16BIT 0 +#define MODE_8BIT 1 +#define MODE_ADPCM 2 +#define MODE_ADPCM_LOOP 3 + +/* keeps info & controls about the module */ +/* this structure is placed in soundRAM so as to be accessible from both + cpus. elements are either readonly or writeonly from respective cpu so as + to not cause any race-conditions +*/ +typedef struct _XM_INFO { + /* written by SH4 */ + bool stereo; /* really...shouldnt be in this struct at all... */ + uint32 play; /* when != 0 play else no playing */ + uint32 init; /* when != 0 initialize module (number-1 == order) */ + uint32 done; /* when != 0 initialization is done */ + sint32 mvol; /* master volume control */ + /* bookkeeping stuff */ + /* written by ARM */ + uint32 inst; /* number of instruments */ + uint32 order; /* current order */ + uint32 pattern; /* current pattern */ + uint32 row; /* current row */ + uint32 row_ofs; /* offset to row in pat */ + uint32 speed; /* current speed */ + uint32 bpm; /* current bpm */ + uint32 tick; /* current tick */ + sint32 gvol; /* global volume */ + /* channels */ + uint8 cnot[32]; /* current note */ + uint16 cper[32]; /* current period */ + uint8 cins[32]; /* current ch instrument */ + uint8 cvef[32]; /* current ch vol effect */ + uint8 ceff[32]; /* current effect */ + uint8 cefp[32]; /* current effect parameter */ + /* all the different parameters for the effects need to be remmeberde */ + uint8 ce01[32]; /* current portaup param */ + uint8 ce02[32]; /* current portadown param */ + uint8 ce030[32]; /* current toneporta param speed */ + uint16 ce031[32]; /* current toneporta period */ + uint8 ce04[32]; /* current vibrato param */ + uint8 ce07[32]; /* current tremolo param */ + uint8 ce0a[32]; /* current volumeslide param */ + uint8 cee1[32]; /* current fineportaup param */ + uint8 cee2[32]; /* current fineportadown param */ + uint8 cee3[32]; /* current glissando control */ + uint8 cee4[32]; /* current vibrato control */ + uint8 cee7[32]; /* current tremolo control */ + uint8 ceea[32]; /* current finevolumeslideup param */ + uint8 ceeb[32]; /* current finevolumeslidedown param */ + uint8 ceec[32]; /* current cut note param */ + uint8 ceed[32]; /* current delay note param */ + uint8 ce0h[32]; /* current global volume slide param */ + uint8 ce0p[32]; /* current panning slide param */ + uint8 ce0r[32]; /* current multiretrignote param */ + uint8 ce0t[32]; /* current tremor param */ + uint8 cex1[32]; /* current extrafineportaup param */ + uint8 cex2[32]; /* current extrafineportadown param */ + /* effect variables */ + uint8 vib_pos[32]; /* vibrato position */ + uint8 trm_pos[32]; /* tremolo position */ + uint32 pat_dly; /* how long delay is */ + uint32 pat_loop_row; /* row number */ + uint32 pat_loop_row_ofs; /* row offset (no extra calcing) */ + uint32 pat_loop_tmp; /* temporary storage of row offset */ + uint32 pat_loop_cnt; /* times left to loop */ + uint8 pbrk; /* lock to prevent multiple pattern breaks */ + /* envelopes */ + uint16 vol_cnt[32]; /* frame counter for volume */ + uint16 pan_cnt[32]; /* frame counter for panning */ + sint32 fadeout_vol[32]; /* fadeout volume */ + uint8 env_vol[32]; /* envelope volume */ + uint8 env_pan[32]; /* envelope panning */ + uint8 keyoff[32]; /* keyoff status */ + uint16 avib_cnt[32]; /* frame counter for auto-vibrato */ + uint8 avib_pos[32]; /* auto-vibrato position */ + sint16 cvib_per[32]; /* current vibrato delta */ + /* variables */ + uint8 carp[32]; /* current ch arpeggio counter */ + sint8 cvol[32]; /* current ch vol */ + uint8 cpan[32]; /* current ch pan */ + sint8 cfin[32]; /* current finetune value */ +} XM_INFO; + +/* since driver is only 1/4th of this, maybe reduce this and fit more data */ +#define XM_INFO_ADDR 0x0000b000 +#define XM_HEADER_ADDR 0x00010000 + +typedef struct _XM_SM_HEADER { + uint32 sample_length; + uint32 loop_start; + uint32 loop_end; + uint8 volume; + sint8 finetune; + uint8 type; + uint8 pan; + sint8 relative_note; + uint8 pad[3]; + void *data; /* ptr to sample */ +} XM_SM_HEADER; + +typedef struct _XM_XI_HEADER2 { /* this is aligned (without padding) */ + uint8 note_sample_nr[96]; + struct { + uint16 frame; + uint16 value; + } vol_envelope[12]; + struct { + uint16 frame; + uint16 value; + } pan_envelope[12]; + uint8 vol_points; + uint8 pan_points; + uint8 vol_sustain_point; + uint8 vol_loop_start; + uint8 vol_loop_end; + uint8 pan_sustain_point; + uint8 pan_loop_start; + uint8 pan_loop_end; + uint8 vol_type; + uint8 pan_type; + uint8 vibrato_type; + uint8 vibrato_sweep; + uint8 vibrato_depth; + uint8 vibrato_rate; + uint16 fadeout_vol; + uint16 reserved; + XM_SM_HEADER *sample; +} XM_XI_HEADER2; + +typedef struct _XM_PT_HEADER{ /* this is aligned (without padding) */ + uint16 rows; + uint16 size; + uint8 *data; +} XM_PT_HEADER; + +typedef struct _XM_XI_HEADER { /* this is aligned (with padding) */ + uint16 samples; + uint16 pad; + XM_XI_HEADER2 *instrument; /* if no sample this is NULL */ +} XM_XI_HEADER; + +typedef struct _XM_HEADER { /* all of this is aligned without padding */ + uint16 song_length; + uint16 restart_pos; + uint16 channels; + uint16 patterns; + uint16 instruments; + uint16 flags; + uint16 tempo; + uint16 bpm; + uint8 pattern_order_table[256]; + XM_PT_HEADER *hdr_pat; + XM_XI_HEADER *hdr_inst; +} XM_HEADER; + +#endif /* _DXM_H_ */ diff --git a/AICA/SRCS/dxm-0.9/src/host/CVS/Entries b/AICA/SRCS/dxm-0.9/src/host/CVS/Entries new file mode 100644 index 00000000..17848105 --- /dev/null +++ b/AICA/SRCS/dxm-0.9/src/host/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/AICA/SRCS/dxm-0.9/src/host/CVS/Repository b/AICA/SRCS/dxm-0.9/src/host/CVS/Repository new file mode 100644 index 00000000..f3e9bc98 --- /dev/null +++ b/AICA/SRCS/dxm-0.9/src/host/CVS/Repository @@ -0,0 +1 @@ +/usr/home/ejstans/cvs/dxm/src/host diff --git a/AICA/SRCS/dxm-0.9/src/host/CVS/Root b/AICA/SRCS/dxm-0.9/src/host/CVS/Root new file mode 100644 index 00000000..e14dc10a --- /dev/null +++ b/AICA/SRCS/dxm-0.9/src/host/CVS/Root @@ -0,0 +1 @@ +/usr/home/ejstans/cvs diff --git a/AICA/SRCS/dxm-0.9/src/loader.c b/AICA/SRCS/dxm-0.9/src/loader.c new file mode 100644 index 00000000..d8ceb01e --- /dev/null +++ b/AICA/SRCS/dxm-0.9/src/loader.c @@ -0,0 +1,819 @@ +/* loader.c - convert + load a module to sound RAM */ + +/* this is code is really due for a cleanup... */ + +//#define DEBUG 1 + +#if defined (DEBUG) || defined (HOST) +#include +#include +#include +#include +#include "types.h" +#else +#ifdef VERBOSE +#include +#endif /* VERBOSE */ +#endif /* DEBUG || HOST */ +#include "types.h" +#include "dxm.h" + +#define PCM 0 +#define ADPCM 1 /* not yet supported */ + +static sint32 spu_memcpy(void *, void *, uint32); +static uint16 short2little(uint8 *); +static uint32 word2little(uint8 *); +static sint32 load_xm(uint8 *); +static sint32 load_mod(uint8 *, uint32); +static sint32 load_s3m(uint8 *); + +#if defined (DEBUG) || defined (HOST) + char *outputname; +#else + static void *memcpy(void *, void *, uint32); + static sint8 strncmp(sint8 *, sint8 *, uint32); +#endif /* DEBUG || HOST */ + +static const char id[] __attribute__ ((section (".text"))) = + "dxm $Id: loader.c,v 1.1.1.1 2001/09/08 10:48:15 ejstans Exp $"; + +/* put a check in this one to make sure we're dont overrun available + sound RAM +*/ +static sint32 +spu_memcpy(dst, src, size) + void *dst; + void *src; + uint32 size; +{ + +#if defined (DEBUG) || defined (HOST) + int fd; +#endif /* DEBUG || HOST */ + + if (dst + size >= (void *)0x00200000) { +#if defined (DEBUG) || defined(HOST) || defined(VERBOSE) + printf("module is too large - doesnt fit in sound RAM!\n"); +#endif /* DEBUG || HOST || VERBOSE */ + return (-1); + } + +#if defined (DEBUG) || defined (HOST) + /* do writing to file here */ + fd = open(outputname, O_WRONLY | O_CREAT, + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + if (fd < 0) { + printf("couldn't open output file for writing\n"); + return (-1); + } + if (lseek(fd, ((int)dst) - XM_HEADER_ADDR, SEEK_SET) != ((int)dst) - XM_HEADER_ADDR) { + printf("lseek() failed\n"); + return (-1); + } + + while (size > 0) { + int n; + n = write(fd, src, size); + if (n < 0) { + printf("write() failed\n"); + return (-1); + } + size -= n; + } + + close (fd); + +#else + /* do writing to soudn RAM here */ + +#endif /* DEBUG || HOST */ + + return (0); + +} + +static uint16 +short2little(buf) + uint8 *buf; +{ + sint32 i; + uint16 ret = 0; + + for (i = 1; i >= 0; i--) { + ret = ret<<8; + ret |= buf[i] & 0xff; + } + return (ret); + +} + +static uint32 +word2little(buf) + uint8 *buf; +{ + sint32 i; + uint32 ret = 0; + + for (i = 3; i >= 0; i--) { + ret = ret<<8; + ret |= buf[i] & 0xff; + } + return (ret); +} + +/* initializes the module by loading samples to sound RAM aswell as doing + conversion from big endian to little endian and initializing all internal + variables. + + if it is not an XM module but a subset (such as MOD or S3M) we convert + it to the internal (XM) format. possibly look into how different IT is + ...and maybe MO3 also? =) + + possibly add ADPCM compression when that's been figured out (unless there's + a patent on yamaha's algorithm?) actually, ADPCM will unfortunately not + work because of looping :( + + also, recompressing of the patterns to conserve space? (nah, XM compression + isnt the best, but it is probably good enough) + +*/ + +sint32 +dxm_load(module) + uint8 *module; +{ + +#if defined (DEBUG) || defined(HOST) || defined(VERBOSE) + printf("DXM-Loader v0.1 (c) 2001 Lars Olsson\n"); +#endif /* DEBUG + HOST + VERBOSE */ + + /* check that this is a format we understand */ + if (strncmp(&module[0], "Extended Module: ", 17) == 0) { + /* XM */ + return (load_xm(module)); + } + else if (strncmp(&module[1080], "M.K.", 4) == 0) { + /* 4 channel mod */ + return (load_mod(module, 4)); + } + else if (strncmp(&module[1080], "M!K!", 4) == 0) { + /* pro-tracker */ + return (load_mod(module, 4)); + } + else if (strncmp(&module[1080], "6CHN", 4) == 0) { + /* 6 channel mod */ + return (load_mod(module, 6)); + } + else if (strncmp(&module[1080], "8CHN", 4) == 0) { + /* 8 channel mod */ + return (load_mod(module, 8)); + } + else if (strncmp(&module[1082], "CH", 2) == 0) { + /* multichannel mod */ + return (load_mod(module, (module[1080] - '0') * 10 + (module[1081] - '0'))); + } + else if (strncmp(&module[44], "SCRM", 4) == 0) { + /* screamtracker mod */ + return (load_s3m(module)); + } + + /* unknown format */ +#if defined (HOST) || defined (VERBOSE) + printf("dxm: unknown format\n"); +#endif /* HOST || VERBOSE */ + return (-1); + +} + +/* converts from XM delta values to absolute values + generates inverted loop + sequence if ping-pong loop is specified (since there is no known way of + getting the AICA to play the sample backwards as far as i know) + uploads to soundRAM while comverting + + upload is done on 32bit boundaries (rounded up) so remember to adjust + sample address in sample header accordingly. + +XXX: fix 16-bit sample...segfaulting because of something... + +TODO: add support for converting to ADPCM-samples, for now only normal PCM +*/ +static int +convert_waveform(dst, src, size, type, loop, start, end, compress) + void *dst; + void *src; + uint32 size; + uint32 type; + uint32 loop; + uint32 start; + uint32 end; + uint32 compress; +{ + + uint32 i, j, k; + + switch (loop) { + case 0: + break; + case 1: + size = end; + break; + case 2: + size = end>>1; + break; + } + + if (type == 0) { + /* 8-bit samples */ + sint8 buf[32]; + sint8 old = 0; + sint8 start_value = 0; +#ifdef DEBUG + printf("8-bit sample\n"); +#endif + + for (i = 0; i < size;) { + for (j = 0; j < 256/8; j++) { + if (i < size) { + old = buf[j] = ((sint8 *)src)[i] + old; + if (i == start) { + start_value = old; + } + i++; + } else { + buf[j] = 0; + } + } + /* upload to sound RAM here */ + spu_memcpy(dst + i, buf, 32); + } + /* check if we need to generate pingpong loop */ + if (loop == 2) { +#ifdef DEBUF + printf("generating ping-pong loop\n"); +#endif + k = i; + + old = start_value; + for (i = size; i > start;) { + for (j = 0; j < 256/8; j++) { + if (i > start) { + old = buf[j] = ((sint8 *)src)[i] + old; + i--; + } else { + buf[j] = 0; + } + } + /* upload to sound RAM here */ + spu_memcpy(dst + k, buf, 32); + k += 32; + } + } + } else { + /* 16-bit samples */ + sint16 buf[16]; + sint16 old = 0; + sint16 start_value = 0; +#ifdef DEBUG + printf("16-bit sample\n"); +#endif + + for (i = 0; i < size;) { + for (j = 0; j < 256/16; j++) { + if (i < size) { + old = buf[j] = (sint16)short2little((uint8 *)&((sint16 *)src)[i]) + old; + if (i == start) { + start_value = old; + } + i++; + } else { + buf[j] = 0; + } + } + /* upload to sound RAM here */ + spu_memcpy(dst + (i<<1), buf, 32); + } + /* check if we need to generate pingpong loop */ + if (loop == 2) { +#ifdef DEBUG + printf("generating ping-pong loop\n"); +#endif + k = i; + + old = start_value; + for (i = size; i > start;) { + for (j = 0; j < 256/16; j++) { + if (i > start) { + old = buf[j] = (sint16)short2little((uint8 *)&((sint16 *)src)[i]) + old; + i--; + } else { + buf[j] = 0; + } + } + /* upload to sound RAM here */ + spu_memcpy(dst + k, buf, 32); + k += 32; + } + } + } + return (0); + +} + +static int +load_xm(module) + uint8 *module; +{ + + XM_HEADER xm_header; + XM_PT_HEADER xm_pt_header; + XM_XI_HEADER xm_xi_header; + XM_XI_HEADER2 xm_xi_header2; + XM_SM_HEADER xm_sm_header; + + uint32 version; + + uint32 mod_offset; + uint32 tmp_offset; + + uint32 hdr_dst; + uint32 pat_dst; + uint32 inst_dst; + uint32 pat_data_dst; + uint32 inst2_dst; + uint32 sample_dst; + uint32 sample_data_dst; + + uint32 real_instruments, real_samples; + + uint32 i, j; + +#if defined (DEBUG) || defined (HOST) || defined (VERBOSE) + uint8 tmpbuf[256]; + uint32 headersize; +#endif /* DEBUG || HOST || VERBOSE */ + +#if defined (DEBUG) || defined (HOST) || defined (VERBOSE) + printf("XM-format\n"); + + memset(tmpbuf, 0, sizeof(tmpbuf)); + memcpy(tmpbuf, &module[17], 20); + printf("name: %s\n", tmpbuf); + + memset(tmpbuf, 0, sizeof(tmpbuf)); + memcpy(tmpbuf, &module[38], 20); + printf("tracker: %s\n", tmpbuf); +#endif /* DEBUG || HOST || VERBOSE */ + + version = short2little(&module[58]); + +#if defined (DEBUG) || defined (HOST) || defined (VERBOSE) + printf("version: $%04x\n", version); +#endif /* DEBUG || HOST || VERBOSE */ + + if (version != 0x0104) { +#if defined (DEBUG) || defined (HOST) || defined (VERBOSE) + printf("unsupported version\n"); +#endif /* DEBUG || HOST || VERBOSE */ + return (-1); + } + +#ifdef DEBUG + headersize = word2little(&module[60]); + printf("headersize: %d\n", headersize); +#endif /* DEBUG */ + + mod_offset = 60; + hdr_dst = XM_HEADER_ADDR; + pat_dst = hdr_dst + sizeof(XM_HEADER); + + /* setup header info */ + xm_header.song_length = short2little(&module[mod_offset+4]); + xm_header.restart_pos = short2little(&module[mod_offset+6]); + xm_header.channels = short2little(&module[mod_offset+8]); + xm_header.patterns = short2little(&module[mod_offset+10]); + /* now we know how big the pattern array will be */ + inst_dst = pat_dst + (sizeof(XM_PT_HEADER) * xm_header.patterns); + xm_header.instruments = short2little(&module[mod_offset+12]); + xm_header.flags = short2little(&module[mod_offset+14]); + xm_header.tempo = short2little(&module[mod_offset+16]); + xm_header.bpm = short2little(&module[mod_offset+18]); + memcpy(xm_header.pattern_order_table, &module[mod_offset+20], 256); + xm_header.hdr_pat = (XM_PT_HEADER *)pat_dst; + xm_header.hdr_inst = (XM_XI_HEADER *)inst_dst; + +#ifdef DEBUG + printf("xm_header.song_length: %d\n", xm_header.song_length); + printf("xm_header.restart_pos: %d\n", xm_header.restart_pos); + printf("xm_header.channels: %d\n", xm_header.channels); + printf("xm_header.patterns: %d\n", xm_header.patterns); + printf("xm_header.instruments: %d\n", xm_header.instruments); + printf("xm_header.flags: %d\n", xm_header.flags); + printf("xm_header.tempo: %d\n", xm_header.tempo); + printf("xm_header.bpm: %d\n", xm_header.bpm); + printf("xm_header.patterns: 0x%08x\n", xm_header.hdr_pat); + printf("xm_header.instruments: 0x%08x\n", xm_header.hdr_inst); +#endif /* DEBUG */ + + /* copy to sound RAM */ + spu_memcpy((void *)hdr_dst, &xm_header, sizeof(XM_HEADER)); + + /* do patterns */ + mod_offset += 276; + pat_data_dst = inst_dst + (sizeof(XM_XI_HEADER) * xm_header.instruments); + for (i = 0; i < xm_header.patterns; i++) { + xm_pt_header.rows = short2little(&module[mod_offset+5]); + xm_pt_header.size = short2little(&module[mod_offset+7]); + xm_pt_header.data = (uint8 *)pat_data_dst; +#ifdef DEBUG + printf("xm_pt_header.rows: %d\n", xm_pt_header.rows); + printf("xm_pt_header.size: %d\n", xm_pt_header.size); + printf("xm_pt_header.data: 0x%08x\n", xm_pt_header.data); +#endif /* DEBUG */ + /* copy structure to sound RAM */ + spu_memcpy((void *)pat_dst, &xm_pt_header, sizeof(XM_PT_HEADER)); + /* copy pattern data to sound RAM */ + if (xm_pt_header.size > 0) { + spu_memcpy((void *)pat_data_dst, + &module[mod_offset + 9], + xm_pt_header.size); + } + + /* get ready for next pattern */ + mod_offset += xm_pt_header.size + 9; + pat_dst += sizeof(XM_PT_HEADER); + /* 32-bit align */ + pat_data_dst += ((xm_pt_header.size + 3) & 0xfffffffc); + } + + + /* go through instrument list and check how many instruments + there really are (ie instruments that actually have sample(s). + we need this because we have to be able to calculate the + location of all the sound RAM buffers beforehand in order to + correctly fill out the structures... + */ + tmp_offset = mod_offset; + real_instruments = 0; + real_samples = 0; + for (i = 0; i < xm_header.instruments; i++) { + if (short2little(&module[tmp_offset + 27]) > 0) { + uint32 samples; + uint32 sample_hdr_length; + uint32 total_sample_length; + + real_instruments++; + sample_hdr_length = word2little(&module[tmp_offset + 29]); + samples = short2little(&module[tmp_offset + 27]); + real_samples += samples; +#ifdef DEBUG + printf("instrument: %d\n", real_instruments); + printf("samples: %d\n", samples); + printf("sample_hdr_length: %d\n", sample_hdr_length); +#endif /* DEBUG */ + tmp_offset += word2little(&module[tmp_offset]); + total_sample_length = 0; + for (j = 0; j < samples; j++) { +#ifdef DEBUG + printf("samplelength: %d\n", word2little(&module[tmp_offset])); + memset(tmpbuf, 0, sizeof(tmpbuf)); + memcpy(tmpbuf, &module[tmp_offset + 18], 22); + printf("samplename: %s\n", tmpbuf); +#endif /* DEBUG */ + total_sample_length += word2little(&module[tmp_offset]); + tmp_offset += sample_hdr_length; + } + tmp_offset += total_sample_length; + } else { + tmp_offset += word2little(&module[tmp_offset]); + } + } + +#ifdef DEBUG + printf("number of real instruments: %d\n", real_instruments); +#endif /* DEBUG */ + + /* now do instruments */ + inst2_dst = pat_data_dst; /* already added offset */ + sample_dst = inst2_dst + (sizeof(XM_XI_HEADER2) * real_instruments); + sample_data_dst = sample_dst + (sizeof(XM_SM_HEADER) * real_samples); + for (i = 0; i < xm_header.instruments; i++) { + xm_xi_header.samples = short2little(&module[mod_offset + 27]); +#ifdef DEBUG + printf("current instrument: %d\n", i+1); + printf("xm_xi_header.samples: %d\n", xm_xi_header.samples); +#endif /* DEBUG */ + if (xm_xi_header.samples > 0) { + uint32 sample_hdr_length; + uint32 tmp_sample_length, tmp_sample_length2; + + /* do extended xi header here - getting complex */ + xm_xi_header.instrument = (XM_XI_HEADER2 *)inst2_dst; + /* fill out structure */ + memcpy(xm_xi_header2.note_sample_nr, + &module[mod_offset + 33], 96); + for (j = 0; j < 12; j++) { + xm_xi_header2.vol_envelope[j].frame = short2little(&module[mod_offset + 129 + j*4]); + xm_xi_header2.vol_envelope[j].value = short2little(&module[mod_offset + 131 + j*4]); + xm_xi_header2.pan_envelope[j].frame = short2little(&module[mod_offset + 177 + j*4]); + xm_xi_header2.pan_envelope[j].value = short2little(&module[mod_offset + 179 + j*4]); + } + xm_xi_header2.vol_points = module[mod_offset + 225]; + xm_xi_header2.pan_points = module[mod_offset + 226]; + xm_xi_header2.vol_sustain_point = module[mod_offset + 227]; + xm_xi_header2.vol_loop_start = module[mod_offset + 228]; + xm_xi_header2.vol_loop_end = module[mod_offset + 229]; + xm_xi_header2.pan_sustain_point = module[mod_offset + 230]; + xm_xi_header2.pan_loop_start = module[mod_offset + 231]; + xm_xi_header2.pan_loop_end = module[mod_offset + 232]; + xm_xi_header2.vol_type = module[mod_offset + 233]; + xm_xi_header2.pan_type = module[mod_offset + 234]; + xm_xi_header2.vibrato_type = module[mod_offset + 235]; + xm_xi_header2.vibrato_sweep = module[mod_offset + 236]; + xm_xi_header2.vibrato_depth = module[mod_offset + 237]; + xm_xi_header2.vibrato_rate = module[mod_offset + 238]; + xm_xi_header2.fadeout_vol = short2little(&module[mod_offset + 239]); + xm_xi_header2.sample = (XM_SM_HEADER *)sample_dst; + +#ifdef DEBUG + printf("xm_xi_header2.vol_points: %d\n", xm_xi_header2.vol_points); + printf("xm_xi_header2.pan_points: %d\n", xm_xi_header2.pan_points); + printf("xm_xi_header2.vol_sustain_point: %d\n", xm_xi_header2.vol_sustain_point); + printf("xm_xi_header2.vol_loop_start: %d\n", xm_xi_header2.vol_loop_start); + printf("xm_xi_header2.vol_loop_end: %d\n", xm_xi_header2.vol_loop_end); + printf("xm_xi_header2.pan_sustain_point: %d\n", xm_xi_header2.pan_sustain_point); + printf("xm_xi_header2.pan_loop_start: %d\n", xm_xi_header2.pan_loop_start); + printf("xm_xi_header2.pan_loop_end: %d\n", xm_xi_header2.pan_loop_end); + printf("xm_xi_header2.vol_type: %d\n", xm_xi_header2.vol_type); + printf("xm_xi_header2.pan_type: %d\n", xm_xi_header2.pan_type); + printf("xm_xi_header2.vibrato_type: %d\n", xm_xi_header2.vibrato_type); + printf("xm_xi_header2.vibrato_sweep: %d\n", xm_xi_header2.vibrato_sweep); + printf("xm_xi_header2.vibrato_depth: %d\n", xm_xi_header2.vibrato_depth); + printf("xm_xi_header2.vibrato_rate: %d\n", xm_xi_header2.vibrato_rate); + printf("xm_xi_header2.fadeout_vol: %d\n", xm_xi_header2.fadeout_vol); + printf("xm_xi_header2.sample: 0x%08x\n", xm_xi_header2.sample); +#endif + + /* copy structure to sound RAM */ + spu_memcpy((void *)inst2_dst, &xm_xi_header2, + sizeof(XM_XI_HEADER2)); + + /* prepare for next part */ + sample_hdr_length = word2little(&module[mod_offset + 29]); + mod_offset += word2little(&module[mod_offset]); + tmp_offset = mod_offset + sample_hdr_length + * xm_xi_header.samples; + inst2_dst += sizeof(XM_XI_HEADER2); + + /* do sample headers here */ + /* have to do both header + data in one pass here */ + for (j = 0; j < xm_xi_header.samples; j++) { + tmp_sample_length = xm_sm_header.sample_length = word2little(&module[mod_offset]); + xm_sm_header.loop_start = word2little(&module[mod_offset + 4]); + xm_sm_header.loop_end = word2little(&module[mod_offset + 8]) + xm_sm_header.loop_start; + xm_sm_header.volume = module[mod_offset + 12]; + xm_sm_header.finetune = module[mod_offset + 13]; + xm_sm_header.type = module[mod_offset + 14]; + /* add bits here depending on which case the sample belongs to; there are enough bits i think */ + xm_sm_header.pan = module[mod_offset + 15]; + xm_sm_header.relative_note = module[mod_offset + 16]; + xm_sm_header.data = (void *)sample_data_dst; + + /* if loop point is earlier than sample + end, cut sample since the last part + will never be played anyway */ + if ((xm_sm_header.type & 0x03) == 1) { + xm_sm_header.sample_length = xm_sm_header.loop_end; + /* if pingpong extend length to include + the reversed part of the loop */ + } + if ((xm_sm_header.type & 0x03) == 2) { + xm_sm_header.sample_length = + xm_sm_header.loop_end<<1; + /* change loop end to include + the reverse-portion of sample + aswell */ + xm_sm_header.loop_end <<= 1; + } + + tmp_sample_length2 = xm_sm_header.sample_length; + + + /* change length + loop points to frames + instead of bytes which means dividing by 2 + for 16-bit samples */ + if ((xm_sm_header.type & 0x10) == 0x10) { + xm_sm_header.sample_length >>= 1; + xm_sm_header.loop_start >>= 1; + xm_sm_header.loop_end >>= 1; + } + + /* clear any spuriously setted bits */ + xm_sm_header.type &= 0x1f; + + /* enter new sample type into the header to make long sample + loop processing easier */ + if ((xm_sm_header.sample_length < 65536) && + (xm_sm_header.type & 0x03) != 2) { + /* small sample; all hardware */ + xm_sm_header.type |= 0<<5; + } + /* i guess it would cause problems if the sample is exactly 65536 frames (or just about)...maybe cut it if thats the case? */ + else if ((xm_sm_header.sample_length >= 65536) + && ((xm_sm_header.type & 0x03) != 0) + && (xm_sm_header.loop_end < 65536)) { + /* long sample, short loop */ + xm_sm_header.type |= 1<<5; + } + else if ((xm_sm_header.sample_length >= 65536) + && ((xm_sm_header.type & 0x03) != 0)) { + /* long sample, long loop */ + xm_sm_header.type |= 2<<5; + } else { + /* long sample, no loop */ + xm_sm_header.type |= 3<<5; + } + + xm_sm_header.loop_end = xm_sm_header.sample_length; + +#ifdef DEBUG + printf("xm_sm_header.sample_length: %d\n", xm_sm_header.sample_length); + printf("xm_sm_header.loop_start: %d\n", xm_sm_header.loop_start); + printf("xm_sm_header.loop_end: %d\n", xm_sm_header.loop_end); + printf("xm_sm_header.volume: %d\n", xm_sm_header.volume); + printf("xm_sm_header.finetune: %d\n", xm_sm_header.finetune); + printf("xm_sm_header.type: %d\n", xm_sm_header.type); + printf("xm_sm_header.pan: %d\n", xm_sm_header.pan); + printf("xm_sm_header.relative_note: %d\n", xm_sm_header.relative_note); + printf("xm_sm_header.data: 0x%08x\n", xm_sm_header.data); +#endif /* DEBUG */ + /* copy header to sound RAM */ + spu_memcpy((void *)sample_dst, &xm_sm_header, sizeof(XM_SM_HEADER)); + + /* copy sample data to sound RAM */ + /* need to do delta2absolute conv here + possibly insert ADPCM compression later */ + /* i need to check loop type aswell and + manually copy+invert loop if pingpong */ + convert_waveform(sample_data_dst, + &module[tmp_offset], + xm_sm_header.sample_length, + (xm_sm_header.type & 0x10)>>4, + xm_sm_header.type & 0x03, + xm_sm_header.loop_start, + xm_sm_header.loop_end, + PCM); + + /* prepare for next sample header */ + mod_offset += sample_hdr_length; + tmp_offset += tmp_sample_length; + sample_dst += sizeof(XM_SM_HEADER); + /* 32-bit align */ + /* change here since size may be changed */ + sample_data_dst += (tmp_sample_length2 + 3) + & 0xfffffffc; + } + /* skip the sampledata we have already transfered */ + mod_offset = tmp_offset; + } else { + xm_xi_header.instrument = NULL; + mod_offset += word2little(&module[mod_offset]); + } + + /* copy to sound RAM */ + spu_memcpy((void *)inst_dst, &xm_xi_header, + sizeof(XM_XI_HEADER)); + + /* get ready for next instrument */ + inst_dst += sizeof(XM_XI_HEADER); + } + return (0); + +} + +static sint32 +load_mod(module, channel) + uint8 *module; + uint32 channel; +{ +#if defined (DEBUG) || defined(HOST) || defined(VERBOSE) + printf("MOD-format\n"); +#endif /* DEBUG + HOST + VERBOSE */ + return (0); +} + +static sint32 +load_s3m(module) + uint8 *module; +{ +#if defined (DEBUG) || defined(HOST) || defined(VERBOSE) + printf("S3M-format\n"); +#endif /* DEBUG + HOST + VERBOSE */ + return (0); +} + +#if defined (DEBUG) || defined (HOST) + +int +main(argc, argv) + int argc; + char **argv; +{ + + int fd; + int i, j; + char *module; + + struct stat st; + + if (argc != 3) { + printf("usage: %s \n", argv[0]); + exit (-1); + } + + outputname = argv[2]; + + if (stat(argv[1], &st) < 0) { + printf("stat() failed\n"); + exit (-1); + } + + if ((module = (char *)malloc(st.st_size)) == NULL) { + printf("malloc() failed\n"); + exit (-1); + } + + if ((fd = open(argv[1], O_RDONLY)) < 0) { + printf("open() failed\n"); + exit (-1); + } + + i = 0; + while (i < st.st_size) { + j = read(fd, &module[i], st.st_size); + if (j < 0) { + printf("read() failed\n"); + exit (-1); + } + if (j == 0) + break; + i += j; + } + + unlink(outputname); + + dxm_load(module); + + free(module); + + printf("done\n"); + + return (0); + +} + +#else +#ifndef VERBOSE +/* some libc-type routines thats needed */ + +/* memcpy.c - copy memory block */ + +static void * +memcpy(dst, src, n) + void *dst; + void *src; + uint32 n; +{ + + uint32 i; + sint8 *s = (sint8 *)src, *d = (sint8 *)dst; + + for (i = 0; i < n; i++) + *(d++) = *(s++); + + return (dst); + +} + +/* strncmp.c - compare two character strings w/ maximum length */ + +static sint8 +strncmp(s1, s2, n) + sint8 *s1; + sint8 *s2; + uint32 n; +{ + sint8 b1, b2; + uint32 i = 0; + + do { + i++; + b1 = *(s1++); + b2 = *(s2++); + } while ((b1 == b2) && (b1 != '\0') && (b2 != '\0') && (i < n)); + + return (b1 - b2); + +} + +#endif /* !VERBOSE */ +#endif diff --git a/AICA/SRCS/dxm-0.9/src/main.c b/AICA/SRCS/dxm-0.9/src/main.c new file mode 100644 index 00000000..7080a63b --- /dev/null +++ b/AICA/SRCS/dxm-0.9/src/main.c @@ -0,0 +1,51 @@ +/* main.c - main routines */ + +#include "types.h" +#include "dxm.h" + +/* extern prototypes */ +extern void hw_init(void); + +/* prototypes */ +void init_xm(uint32); +void play_xm(void); + +static const char id[] __attribute__ ((section (".text"))) = + "dxm $Id: main.c,v 1.1.1.1 2001/09/08 10:48:15 ejstans Exp $"; + + +/* this should of course be in soundRAM */ +static XM_INFO *xm_info = (XM_INFO *)XM_INFO_ADDR; + +extern sint32 FIQ_div; /* divisor for irq counter to get proper + tick rate */ +extern uint32 counter; /* interrupt counter */ + +/* keep gcc from complaining */ +void +atexit() +{ +} + +/* main */ +int +main() +{ + + /* initialize voice channels */ + hw_init(); + + /* initialize variables */ + init_xm(0); + + /* inform SH4 that initialization is done */ + xm_info->done = 1; + + /* main-loop */ + while (1) { + if ((counter % FIQ_div) == 0) { + play_xm(); + } + } + +} diff --git a/AICA/SRCS/dxm-0.9/src/player.c b/AICA/SRCS/dxm-0.9/src/player.c new file mode 100644 index 00000000..621b5646 --- /dev/null +++ b/AICA/SRCS/dxm-0.9/src/player.c @@ -0,0 +1,1489 @@ +/* player.c - the XM player...next to no hw-specifics in this file */ + +#include "types.h" +#include "dxm.h" + +/* define this if debugging */ +//#define DEBUG 1 + +/* comment this out if you want pan envelope. WARNING: player may be too slow */ +/* #define NO_PAN_ENVELOPE 1 */ + +/* extern prototypes */ +extern void hw_init(void); +extern void hw_play_waveform(XM_SM_HEADER *, uint32, uint32, uint32); +extern void hw_set_vol_pan_freq(uint8, uint8, uint8, uint8, uint32); +extern uint32 random(void); + +/* prototypes */ +void init_xm(uint32); +void play_xm(void); + +/* private prototypes */ +static uint16 convert_note(uint8, uint8, uint8); +static uint32 convert_period(uint16); +static uint8 convert_bpm(uint8); +static void process_volume_fx(uint8, uint8); +static void process_row_fx(uint8, uint8, uint8); +static void update_row(void); +static void update_effects(void); +static void update_envelopes(void); +static void set_final_vol_pan_freq(void); + +static const char id[] __attribute__ ((section (".text"))) = + "dxm $Id: player.c,v 1.1.1.1 2001/09/08 10:48:15 ejstans Exp $"; + +/* these should of course be in soundRAM */ +static XM_INFO *xm_info = (XM_INFO *)XM_INFO_ADDR; +static XM_HEADER *xm_header = (XM_HEADER *)XM_HEADER_ADDR; + +/* this is just needed for AICA hw...really belongs in a different file */ +sint32 FIQ_div = 88; /* divisor for irq counter to get proper + tick rate */ + /* this seems a bit inaccurate in some + cases :( */ + +/* used for amiga periods */ +static uint16 PeriodTab[] = { + 907,900,894,887,881,875,868,862,856,850,844,838,832,826,820,814, + 808,802,796,791,785,779,774,768,762,757,752,746,741,736,730,725, + 720,715,709,704,699,694,689,684,678,675,670,665,660,655,651,646, + 640,636,632,628,623,619,614,610,604,601,597,592,588,584,580,575, + 570,567,563,559,555,551,547,543,538,535,532,528,524,520,516,513, + 508,505,502,498,494,491,487,484,480,477,474,470,467,463,460,457, +}; + +/* used to convert linear periods to frequency - probably should think up + a better way of doing this... */ +static uint16 FreqTab[] = { + 493, 493, 494, 494, 495, 495, 496, 496, 496, 497, 497, 498, 498, + 499, 499, 500, 500, 500, 501, 501, 502, 502, 503, 503, 504, 504, + 505, 505, 505, 506, 506, 507, 507, 508, 508, 509, 509, 510, 510, + 511, 511, 511, 512, 512, 513, 513, 514, 514, 515, 515, 516, 516, + 517, 517, 517, 518, 518, 519, 519, 520, 520, 521, 521, 522, 522, + 523, 523, 524, 524, 525, 525, 526, 526, 526, 527, 527, 528, 528, + 529, 529, 530, 530, 531, 531, 532, 532, 533, 533, 534, 534, 535, + 535, 536, 536, 537, 537, 538, 538, 538, 539, 539, 540, 540, 541, + 541, 542, 542, 543, 543, 544, 544, 545, 545, 546, 546, 547, 547, + 548, 548, 549, 549, 550, 550, 551, 551, 552, 552, 553, 553, 554, + 554, 555, 555, 556, 556, 557, 557, 558, 558, 559, 559, 560, 560, + 561, 561, 562, 562, 563, 563, 564, 564, 565, 565, 566, 566, 567, + 567, 568, 568, 569, 569, 570, 571, 571, 572, 572, 573, 573, 574, + 574, 575, 575, 576, 576, 577, 577, 578, 578, 579, 579, 580, 580, + 581, 581, 582, 583, 583, 584, 584, 585, 585, 586, 586, 587, 587, + 588, 588, 589, 589, 590, 590, 591, 592, 592, 593, 593, 594, 594, + 595, 595, 596, 596, 597, 597, 598, 599, 599, 600, 600, 601, 601, + 602, 602, 603, 603, 604, 604, 605, 606, 606, 607, 607, 608, 608, + 609, 609, 610, 611, 611, 612, 612, 613, 613, 614, 614, 615, 615, + 616, 617, 617, 618, 618, 619, 619, 620, 621, 621, 622, 622, 623, + 623, 624, 624, 625, 626, 626, 627, 627, 628, 628, 629, 630, 630, + 631, 631, 632, 632, 633, 634, 634, 635, 635, 636, 636, 637, 638, + 638, 639, 639, 640, 640, 641, 642, 642, 643, 643, 644, 645, 645, + 646, 646, 647, 647, 648, 649, 649, 650, 650, 651, 652, 652, 653, + 653, 654, 654, 655, 656, 656, 657, 657, 658, 659, 659, 660, 660, + 661, 662, 662, 663, 663, 664, 665, 665, 666, 666, 667, 668, 668, + 669, 669, 670, 671, 671, 672, 672, 673, 674, 674, 675, 676, 676, + 677, 677, 678, 679, 679, 680, 680, 681, 682, 682, 683, 683, 684, + 685, 685, 686, 687, 687, 688, 688, 689, 690, 690, 691, 692, 692, + 693, 693, 694, 695, 695, 696, 697, 697, 698, 698, 699, 700, 700, + 701, 702, 702, 703, 704, 704, 705, 705, 706, 707, 707, 708, 709, + 709, 710, 711, 711, 712, 712, 713, 714, 714, 715, 716, 716, 717, + 718, 718, 719, 720, 720, 721, 722, 722, 723, 724, 724, 725, 725, + 726, 727, 727, 728, 729, 729, 730, 731, 731, 732, 733, 733, 734, + 735, 735, 736, 737, 737, 738, 739, 739, 740, 741, 741, 742, 743, + 743, 744, 745, 745, 746, 747, 747, 748, 749, 749, 750, 751, 751, + 752, 753, 754, 754, 755, 756, 756, 757, 758, 758, 759, 760, 760, + 761, 762, 762, 763, 764, 764, 765, 766, 767, 767, 768, 769, 769, + 770, 771, 771, 772, 773, 774, 774, 775, 776, 776, 777, 778, 778, + 779, 780, 781, 781, 782, 783, 783, 784, 785, 785, 786, 787, 788, + 788, 789, 790, 790, 791, 792, 793, 793, 794, 795, 795, 796, 797, + 798, 798, 799, 800, 801, 801, 802, 803, 803, 804, 805, 806, 806, + 807, 808, 809, 809, 810, 811, 811, 812, 813, 814, 814, 815, 816, + 817, 817, 818, 819, 820, 820, 821, 822, 823, 823, 824, 825, 825, + 826, 827, 828, 828, 829, 830, 831, 831, 832, 833, 834, 834, 835, + 836, 837, 837, 838, 839, 840, 841, 841, 842, 843, 844, 844, 845, + 846, 847, 847, 848, 849, 850, 850, 851, 852, 853, 854, 854, 855, + 856, 857, 857, 858, 859, 860, 860, 861, 862, 863, 864, 864, 865, + 866, 867, 868, 868, 869, 870, 871, 871, 872, 873, 874, 875, 875, + 876, 877, 878, 879, 879, 880, 881, 882, 883, 883, 884, 885, 886, + 887, 887, 888, 889, 890, 891, 891, 892, 893, 894, 895, 895, 896, + 897, 898, 899, 899, 900, 901, 902, 903, 903, 904, 905, 906, 907, + 908, 908, 909, 910, 911, 912, 913, 913, 914, 915, 916, 917, 917, + 918, 919, 920, 921, 922, 922, 923, 924, 925, 926, 927, 927, 928, + 929, 930, 931, 932, 933, 933, 934, 935, 936, 937, 938, 938, 939, + 940, 941, 942, 943, 944, 944, 945, 946, 947, 948, 949, 950, 950, + 951, 952, 953, 954, 955, 956, 956, 957, 958, 959, 960, 961, 962, + 962, 963, 964, 965, 966, 967, 968, 969, 969, 970, 971, 972, 973, + 974, 975, 976, 976, 977, 978, 979, 980, 981, 982, 983, 984, 984, + 985, 986, 987, 988, 989, 990, 991, 992, 992, 993, 994, 995, 996, + 997, 998, 999, 1000, 1001, 1001, 1002, 1003, 1004, 1005, 1006, 1007, + 1008, 1009, 1010, 1011, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, + 1019, 1020, 1021, 1022, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1035, 1036, 1037, 1038, 1039, 1040, + 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, + 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, + 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, + 1076, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, + 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, + 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, +}; + +/* used for vibrato and tremolo */ +static uint8 SinTab[] = { + 0, 24, 49, 74, 97, 120, 141, 161, + 180, 197, 212, 224, 235, 244, 250, 253, + 255, 253, 250, 244, 235, 224, 212, 197, + 180, 161, 141, 120, 97, 74, 49, 24, +}; + +/* called to re-initialize the module */ +void +init_xm(order) + uint32 order; +{ + + sint32 i; + uint8 *ptr = (uint8 *)&(xm_info->mvol); + + /* halt playing */ + xm_info->play = 0; + + /* clear rest of structure */ + for (i = 8; i < sizeof(XM_INFO); i++) { + *(ptr++) = 0; + } + + /* fill in some defaults */ + xm_info->mvol = 40; + xm_info->inst = xm_header->instruments; + xm_info->order = order; + xm_info->speed = xm_header->tempo; + xm_info->tick = xm_header->tempo; + xm_info->bpm = xm_header->bpm; + xm_info->gvol = 64; + + FIQ_div = convert_bpm(xm_header->bpm); + +} + +/* called every tick to play module */ +void +play_xm() +{ + /* play waveform (for debugging) */ +/* + hw_play_waveform(&xm_header->hdr_inst[19-1].instrument->sample[0], 0, 0, 22050); + + while (1); +*/ + + /* re-init module */ + if (xm_info->init != 0) { + init_xm(xm_info->init - 1); + xm_info->init = 0; + } + + /* check if playing has started yet */ + if (xm_info->play == 0) + return; +#ifdef DEBUG + /* use to repeat a patter (for debugging) */ + xm_info->order = 9; +#endif /* DEBUG */ + + if (++xm_info->tick >= xm_info->speed) { + xm_info->tick = 0; + if (xm_info->pat_dly == 0) { + update_row(); + xm_info->pbrk = 0; + if (++xm_info->row >= xm_header->hdr_pat[xm_info->pattern].rows) { + /* implement FT2 pattern loop bug */ + xm_info->row = xm_info->pat_loop_row; + xm_info->row_ofs = xm_info->pat_loop_row_ofs; + if (++xm_info->order >= xm_header->song_length) { + xm_info->order = xm_header->restart_pos; + } + } + } else { + xm_info->pat_dly--; + } + } else { + + update_effects(); + } + + /* envelopes are global and processed for every tick */ + update_envelopes(); + + /* calculate and set final values */ + set_final_vol_pan_freq(); + +} + + +static void +update_row() +{ + + uint32 i; + sint16 anot; + uint8 cnot, cins, cvef, ceff, cefp; + uint8 nnot; + uint8 *ptr, *ptr2; + uint32 period; + sint32 pan; + uint32 vol; + uint32 sample; + uint32 sample_offset = 0; + + XM_XI_HEADER2 *my_hdr; + + xm_info->pattern = xm_header->pattern_order_table[xm_info->order]; + ptr = (uint8 *)xm_header->hdr_pat[xm_info->pattern].data; + ptr += xm_info->row_ofs; + + /* store first point in row of row offset for pattern loop effect */ + xm_info->pat_loop_tmp = xm_info->row_ofs; + + for (i = 0; i < xm_header->channels; i++) { + /* best is probably to keep an offset for the row and + add to this for every row processed. since rows most + of the time grow incrementally 1 row at the time this + gives the least overhead. whenever we have a loop command + or pattern break we need extra processing though */ + cnot = cins = cvef = ceff = cefp = 0; + nnot = 0; + period = 0; + pan = 0; + vol = 0; + sample_offset = 0; + + /* get compressed note information */ + if (ptr[0] & 0x80) { + ptr2 = ptr + 1; + if (ptr[0] & 0x01) { + cnot = *(ptr2++); + } + if (ptr[0] & 0x02) { + cins = *(ptr2++); + } + if (ptr[0] & 0x04) { + cvef = *(ptr2++); + } + if (ptr[0] & 0x08) { + ceff = *(ptr2++); + } + if (ptr[0] & 0x10) { + cefp = *(ptr2++); + } + xm_info->row_ofs += ptr2 - ptr; + ptr += ptr2 - ptr; + } else { + cnot = ptr[0]; + cins = ptr[1]; + cvef = ptr[2]; + ceff = ptr[3]; + cefp = ptr[4]; + xm_info->row_ofs += 5; + ptr += 5; + } + + /* reset vibrato delta */ + xm_info->cvib_per[i] = 0; + + /* check for new note */ + if (cnot > 0 && cnot < 97) { + /* KeyOn event */ + nnot = 1; + xm_info->cnot[i] = cnot--; + } + else if (cnot == 97) { + /* KeyOff event */ + nnot = 2; + xm_info->keyoff[i] = 1; + } else { + nnot = 0; + cnot = xm_info->cnot[i] - 1; + } + + /* check for new instrument */ + if (cins > 0) { + xm_info->cins[i] = --cins; /* set new instrument */ + my_hdr = (xm_header->hdr_inst[cins].instrument); + sample = my_hdr->note_sample_nr[cnot]; + /* only reset if not tone porta effect */ + if (ceff != 0x03 && ceff != 0x05) { + /* reset volume + pan */ + xm_info->cvol[i] = my_hdr->sample[sample].volume; + xm_info->cpan[i] = my_hdr->sample[sample].pan; + + /* reset envelopes */ + xm_info->fadeout_vol[i] = 65536; /* set default fadeout vol */ + xm_info->vol_cnt[i] = 0; /* reset vol env */ + xm_info->pan_cnt[i] = 0; /* reset pan env */ + xm_info->keyoff[i] = 0; /* remove keyoff */ + xm_info->avib_pos[i] = 0; /* reset vibrato pos */ + } + } else { + cins = xm_info->cins[i]; /* get old instrument */ + my_hdr = (xm_header->hdr_inst[cins].instrument); + sample = my_hdr->note_sample_nr[cnot]; + } + + /* check if there was a new note */ + if (nnot == 1) { + /* only reset if not tone porta effect */ + if (ceff != 0x03 && ceff != 0x05) { + /* reset envelopes */ + xm_info->fadeout_vol[i] = 65536; /* set default fadeout vol */ + xm_info->vol_cnt[i] = 0; /* reset vol env */ + xm_info->pan_cnt[i] = 0; /* reset pan env */ + xm_info->keyoff[i] = 0; /* remove keyoff */ + xm_info->avib_pos[i] = 0; /* reset vibrato pos */ + } + + /* get absolute note */ + anot = cnot + my_hdr->sample[sample].relative_note; + /* clamp the values */ + if (anot < 1) + anot = 1; + if (anot > 119) + anot = 119; + + /* convert from note to period */ + period = convert_note(anot, cins, sample); + + /* check for portamento to note effect */ + if (ceff == 0x03 || ceff == 0x05) { + /* grab destination period */ + xm_info->ce031[i] = period; + /* zero out speed (so we dont use old value) */ + xm_info->ce030[i] = 0; + } else { + /* otherwise set new period */ + xm_info->cper[i] = period; + } + } + + /* move effects before period calculation so we can use fine + tune from effect in this calculation (used for setfinetune + and glissando slide (maybe), vibrato, autovibrato */ + + /* save volume column effect */ + xm_info->cvef[i] = cvef; + /* save normal effect */ + xm_info->ceff[i] = ceff; + + /* check if there are any volume column effects first */ + if (cvef != 0) { + /* do volume effects processing here */ + process_volume_fx(i, cvef); + } + + /* check if there are any normal effects to process */ + if (ceff != 0 || cefp != 0) { + /* only save parameter if there actually is one */ + if (cefp != 0) { + xm_info->cefp[i] = cefp; + } + /* do row-based effects here */ + process_row_fx(i, ceff, cefp); + + /* process sample offset effect here instead */ + /* XXX: this is tricky - we cant just add the offset + to the waveform address if looping is on and loop + start happens to be before the offset :/ */ + if (ceff == 0x09) { + sample_offset = cefp<<8; + } + } + + /* effect processing done! */ + + /* check if we're supposed to play a new instrument here + and if so do the necessary processing */ + if (period > 0 || sample_offset > 0) { + /* check for tone portamento or note delay */ + if (ceff != 0x03 && ceff != 0x05 && !(ceff == 0x0e && cefp == 0xd0)) { + /* start playing the note */ + hw_play_waveform(&(my_hdr->sample[sample]), + i, sample_offset, + convert_period(period)); + } + } + } + +} + +static void +process_volume_fx(ch, eff) + uint8 ch; + uint8 eff; +{ + + switch (eff & 0xf0) { + case 0x10: + case 0x20: + case 0x30: + case 0x40: + case 0x50: + /* set volume */ + xm_info->cvol[ch] = eff - 0x10; + break; + + case 0x80: + /* fine volume slide down */ + xm_info->cvol[ch] -= eff & 0x0f; + break; + + case 0x90: + /* fine volume slide up */ + xm_info->cvol[ch] += eff & 0x0f; + break; + + case 0xa0: + /* set vibrato speed */ + xm_info->ce04[ch] = ((xm_info->ce04[ch] & 0x0f) | (eff & 0x0f)<<4); + break; + + case 0xb0: + /* vibrato - set depth */ + xm_info->ce04[ch] = ((xm_info->ce04[ch] & 0xf0) | (eff & 0x0f)); + break; + + case 0xc0: + /* set panning */ + xm_info->cpan[ch] = (eff & 0x0f)<<8; + break; + + case 0xf0: + /* portamento to note */ + if ((eff & 0x0f) != 0) { + xm_info->ce030[ch] = eff & 0x0f; + } + break; + + default: + break; + } + +} + +static void +process_row_fx(ch, eff, param) + uint8 ch; + uint8 eff; + uint8 param; +{ + + switch (eff) { + case 0x00: + /* arpeggio - reset arpeggio counter */ + xm_info->carp[ch] = 0; + break; + + case 0x01: + /* portamento up - save parameter */ + if (param != 0) { + xm_info->ce01[ch] = param; + } + break; + + case 0x02: + /* portamento down - save parameter */ + if (param != 0) { + xm_info->ce02[ch] = param; + } + break; + + case 0x03: + /* portamento to note - save parameter (period already + saved in main routine) */ + if (param != 0) { + xm_info->ce030[ch] = param; + } + break; + + case 0x04: + /* vibrato - save parameters */ + if (param != 0) { + xm_info->ce04[ch] = param; + } + break; + + case 0x05: + /* portamento to note + volume slide - save parameter */ + if (param != 0) { + xm_info->ce0a[ch] = param; + } + break; + + case 0x06: + /* vibrato + volume slide - save parameter */ + if (param != 0) { + xm_info->ce0a[ch] = param; + } + break; + + case 0x07: + /* tremolo - save parameter */ + if (param != 0) { + xm_info->ce07[ch] = param; + } + break; + + case 0x08: + /* set panning */ + xm_info->cpan[ch] = param; + break; + + case 0x0a: + /* volume slide - save parameter here */ + if (param != 0) { + xm_info->ce0a[ch] = param; + } + break; + + case 0x0b: + /* position jump */ + xm_info->order = param; + xm_info->row = 0; + xm_info->row_ofs = 0; + xm_info->pat_loop_row = 0; + xm_info->pat_loop_row_ofs = 0; + break; + + case 0x0c: + /* set volume */ + xm_info->cvol[ch] = param; + break; + + case 0x0d: + /* pattern break */ + /* this is a drawback to XM-packed patterns since + a lot of extra processing is needed to find the + proper row offset */ + if (xm_info->pbrk == 0) { + uint8 *ptr, *ptr2; + uint32 i, j; + + /* reset pattern loop position */ + xm_info->pat_loop_row = 0; + xm_info->pat_loop_row_ofs = 0; + + /* prevent multiple pattern breaks on the same + row from triggering more than once */ + xm_info->pbrk = 1; + + xm_info->order++; + xm_info->row = ((param>>4) & 0x0f) * 10 + (param & 0x0f); + xm_info->row_ofs = 0; + + xm_info->pattern = xm_header->pattern_order_table[xm_info->order]; + ptr = (uint8 *)xm_header->hdr_pat[xm_info->pattern].data; + /* calculate correct row_ofs here */ + for (i = 0; i < xm_info->row; i++) { + ptr += xm_info->row_ofs; + for (j = 0; j < xm_header->channels; j++) { + if (ptr[0] & 0x80) { + ptr2 = ptr + 1; + if (ptr[0] & 0x01) { + ptr2++; + } + if (ptr[0] & 0x02) { + ptr2++; + } + if (ptr[0] & 0x04) { + ptr2++; + } + if (ptr[0] & 0x08) { + ptr2++; + } + if (ptr[0] & 0x10) { + ptr2++; + } + xm_info->row_ofs += ptr2 - ptr; + ptr += ptr2 - ptr; + } else { + xm_info->row_ofs += 5; + ptr += 5; + } + } + xm_info->row++; + } + } + break; + + case 0x0e: + /* extended */ + switch (param & 0xf0) { + case 0x10: + /* fine portamento up */ + if (param & 0x0f) { + xm_info->cper[ch] -= (param & 0x0f)<<2; + xm_info->cee1[ch] = param & 0x0f; + } else { + xm_info->cper[ch] -= xm_info->cee1[ch]<<2; + } + break; + + case 0x20: + /* fine portamento down */ + if (param & 0x0f) { + xm_info->cper[ch] += (param & 0x0f)<<2; + xm_info->cee2[ch] = param & 0x0f; + } else { + xm_info->cper[ch] += xm_info->cee2[ch]<<2; + } + break; + + case 0x30: + /* set glissando control */ + xm_info->cee3[ch] = param & 0x0f; + break; + + case 0x40: + /* set vibrato control */ + if ((param & 0x0f) == 0x03) { + xm_info->cee4[ch] = random() & 0x03; + } + else if ((param & 0x0f) == 0x07) { + xm_info->cee4[ch] = (random() & 0x03)<<4; + } + else { + xm_info->cee4[ch] = param & 0x0f; + } + break; + + case 0x50: + /* set finetune */ + /* XXX: must change so this is + considered in main routine when + converting. now it is just skipped + over :( */ + xm_info->cfin[ch] = (param & 0x0f)<<8; + break; + + case 0x60: + /* pattern loop */ + if ((param & 0x0f) == 0) { + /* set loop point */ + xm_info->pat_loop_row = xm_info->row; + xm_info->pat_loop_row_ofs = xm_info->pat_loop_tmp; + xm_info->pat_loop_cnt = 0; + } else { + if (xm_info->pat_loop_cnt != (param & 0x0f)) { + xm_info->pat_loop_cnt++; + xm_info->row = xm_info->pat_loop_row; + xm_info->row_ofs = xm_info->pat_loop_row_ofs; + } + } + break; + + case 0x70: + /* set tremolo control */ + if ((param & 0x0f) == 0x03) { + xm_info->cee7[ch] = random() & 0x03; + } + else if ((param & 0x0f) == 0x07) { + xm_info->cee7[ch] = (random() & 0x03)<<4; + } + else { + xm_info->cee7[ch] = param & 0x0f; + } + break; + + case 0xa0: + /* fine volume slide up */ + if (param & 0x0f) { + xm_info->cvol[ch] += param & 0x0f; + xm_info->ceea[ch] = param & 0x0f; + } else { + xm_info->cvol[ch] += xm_info->ceea[ch]; + } + break; + + case 0xb0: + /* fine volume slide down */ + if (param & 0x0f) { + xm_info->cvol[ch] -= param & 0x0f; + xm_info->ceeb[ch] = param & 0x0f; + } else { + xm_info->cvol[ch] -= xm_info->ceeb[ch]; + } + break; + + case 0xc0: + /* cut note */ + xm_info->ceec[ch] = param; + break; + + case 0xd0: + /* delay note */ + xm_info->ceed[ch] = param; + break; + + case 0xe0: + /* pattern delay */ + xm_info->pat_dly = param; + break; + + default: + /* not processed */ + break; + + } + break; + + case 0x0f: + if (param < 32) { + /* set tempo */ + xm_info->speed = param; + } else { + /* set BPM */ + xm_info->bpm = param; + FIQ_div = convert_bpm(param); + } + break; + + case 0x10: + /* set global volume */ + xm_info->gvol = param; + break; + + case 0x11: + /* global volume slide - save parameter */ + if (param) { + xm_info->ce0h[ch] = param; + } + break; + + case 0x14: + /* key off */ + xm_info->keyoff[ch] = 1; + break; + + case 0x15: + /* set envelope position */ + xm_info->vol_cnt[ch] = param; + xm_info->pan_cnt[ch] = param; + break; + + case 0x18: + /* panning slide - save parameter */ + if (param) { + xm_info->ce0p[ch] = param; + } + break; + + case 0x1a: + /* multi retrig note */ + if (param) { + xm_info->ce0r[ch] = param; + } + break; + + case 0x1c: + /* tremor */ + if (param) { + xm_info->ce0t[ch] = param; + } + break; + + case 0x1f: + /* extended2 */ + switch (param & 0xf0) { + case 0x10: + /* extra fine portamento up */ + if (param & 0x0f) { + xm_info->cper[ch] -= (param & 0x0f); + xm_info->cex1[ch] = param & 0x0f; + } else { + xm_info->cper[ch] -= xm_info->cex1[ch]; + } + break; + + case 0x20: + /* extra fine portamento down */ + if (param & 0x0f) { + xm_info->cper[ch] += (param & 0x0f); + xm_info->cex2[ch] = param & 0x0f; + } else { + xm_info->cper[ch] += xm_info->cex2[ch]; + } + break; + + default: + /* not processed here */ + break; + } + break; + + default: + /* not processed here */ + break; + } + +} + +/* convert period to frequency */ +static uint32 +convert_period(period) + uint16 period; +{ + + uint32 freq; + uint32 per = 7744 - period; + + if (xm_header->flags & 0x01) { + /* linear period table */ + freq = (1<<(per / 768)) * FreqTab[per % 768]; + } else { + /* amiga period table */ + freq = (8363 * 1712)/period; + } + + return (freq); + +} + +/* convert note to period */ +static uint16 +convert_note(not, cins, sample) + uint8 not; + uint8 cins; + uint8 sample; +{ + + uint16 period; + + if ((xm_header->flags & 0x01) == 0) { + /* amiga period */ + /* XXX: this is completely bugged!!!! dont know what i was + thinking... */ + sint32 finetune = xm_header->hdr_inst[cins].instrument->sample[sample].finetune; + uint32 fracfine = finetune<<6; + uint32 divfine = finetune/16; + uint32 modnot = (not % 12)<<3; + + period = ((PeriodTab[modnot + divfine] + * (1024 - fracfine) + + (PeriodTab[modnot + divfine] + * fracfine)) + * (16 / (1<<(not / 12)))) + / 1024; + } else { + /* linear period */ + sint32 finetune = xm_header->hdr_inst[cins].instrument->sample[sample].finetune; + period = 7680 - (not<<6) - (finetune / 2); + } + + return (period); +} + +/* convert bpm to counter divisor value - really belongs in diff. file */ +static uint8 +convert_bpm(bpm) + uint8 bpm; +{ + return (4410/((2 * bpm)/5)); +} + +/* process tick-based effects here */ +static void +update_effects() +{ + + uint32 i; + uint8 cvef; + + for (i = 0; i < xm_header->channels; i++) { + cvef = xm_info->cvef[i]; + /* do volume column effects first */ + switch (cvef & 0xf0) { + case 0x60: + /* volume slide down */ + xm_info->cvol[i] -= cvef & 0x0f; + break; + + case 0x70: + /* volume slide up */ + xm_info->cvol[i] += cvef & 0x0f; + break; + + case 0xb0: + /* vibrato */ + goto dovibrato; + break; + + case 0xd0: + /* panning slide left */ + xm_info->cpan[i] -= cvef & 0x0f; + break; + + /* 17847259 */ + case 0xe0: + /* panning slide right */ + xm_info->cpan[i] += cvef & 0x0f; + break; + + case 0xf0: + /* portamento to note */ + goto doportatonote; + break; + + default: + /* effect not processed here */ + break; + } + + /* then process normal effects */ + switch (xm_info->ceff[i]) { + case 0x00: + /* arpeggio */ + if (++xm_info->carp[i] > 2) { + xm_info->carp[i] = 0; + } + switch (xm_info->carp[i]) { + case 0: + /* XXX: left to implement */ + break; + case 1: + /* XXX: left to implement */ + break; + default: + /* XXX: left to implement */ + break; + } + break; + + case 0x01: + /* portamento up */ + if (xm_info->cefp[i] != 0) { + xm_info->cper[i] -= xm_info->cefp[i]<<2; + } else { + xm_info->cper[i] -= xm_info->ce01[i]<<2; + } + break; + + case 0x02: + /* portamento down */ + if (xm_info->cefp[i] != 0) { + xm_info->cper[i] += xm_info->cefp[i]<<2; + } else { + xm_info->cper[i] += xm_info->ce02[i]<<2; + } + break; + + case 0x03: + /* portamento to note */ +doportatonote: + { + uint16 slide; + + /* check if glissando is active */ + if (xm_info->cee3[i] == 0) { + + slide = xm_info->ce030[i]<<2; + } else { + /* XXX: do glissando slide later + */ + slide = xm_info->ce030[i]; + } + + if (xm_info->cper[i] > xm_info->ce031[i]) { + xm_info->cper[i] -= slide; + if (xm_info->cper[i] < xm_info->ce031[i]) { + xm_info->cper[i] = xm_info->ce031[i]; + } + } + else if (xm_info->cper[i] < xm_info->ce031[i]) { + xm_info->cper[i] += slide; + if (xm_info->cper[i] > xm_info->ce031[i]) { + xm_info->cper[i] = xm_info->ce031[i]; + } + } + } + break; + + case 0x04: + /* vibrato */ +dovibrato: + /* i suspect vibrato should rather use rate * + 16th of semitone instead of just directly + modifying the period like this since when + using amiga-periods, depth will depend on + frequency :/ */ + { + uint8 rate = (xm_info->vib_pos[i] & 0x3f); + uint8 depth = (xm_info->ce04[i] & 0x0f); + + xm_info->vib_pos[i] = rate + ((xm_info->ce04[i]>>4) & 0x0f); + switch (xm_info->cee4[i]) { + case 0: + case 4: + /* sine */ + if (rate < 32) { + xm_info->cvib_per[i] = xm_info->cvib_per[i] + ((SinTab[rate] * depth)>>7); + } else { + xm_info->cvib_per[i] = xm_info->cvib_per[i] - ((SinTab[rate & 0x1f] * depth)>>7); + } + break; + case 1: + case 5: + /* ramp down */ + xm_info->cvib_per[i] = xm_info->cvib_per[i] + (((depth<<8) - ((depth * rate)<<3))>>7); + + break; + case 2: + case 6: + /* square */ + if (rate < 32) { + xm_info->cvib_per[i] = (xm_info->cvib_per[i] + (depth)*2); + } else { + xm_info->cvib_per[i] = (xm_info->cvib_per[i] - (depth)*2); + } + break; + + default: + break; + } + } + break; + + case 0x05: /* portamento to note + volume slide */ + case 0x06: /* vibrato + volume slide */ + case 0x0a: /* volume slide */ + { + uint8 cefp; + + if (xm_info->cefp[i] == 0) { + cefp = xm_info->ce0a[i]; + } else { + cefp = xm_info->cefp[i]; + } + if (cefp & 0xf0) { + xm_info->cvol[i] += cefp & 0xf0; + } + else if (cefp & 0x0f) { + xm_info->cvol[i] -= cefp & 0x0f; + } + } + switch (xm_info->ceff[i]) { + case 0x05: + goto doportatonote; + break; + case 0x06: + goto dovibrato; + break; + case 0x0a: + break; + } + break; + + case 0x07: + /* tremolo */ + { + uint8 rate = (xm_info->trm_pos[i] & 0x3f); + uint8 depth = (xm_info->ce07[i] & 0x0f); + + xm_info->trm_pos[i] = rate + ((xm_info->ce07[i]>>4) & 0x0f); + + switch (xm_info->cee7[i]) { + case 0: + case 4: + /* sine */ + if (rate < 32) { + xm_info->cvol[i] = xm_info->cvol[i] + ((SinTab[rate] * depth)>>6); + } else { + xm_info->cvol[i] = xm_info->cvol[i] - ((SinTab[rate & 0x1f] * depth)>>6); + } + break; + case 1: + case 5: + /* ramp down */ + xm_info->cvol[i] = xm_info->cvol[i] + (((depth<<8) - ((depth * rate)<<3))>>6); + + break; + case 2: + case 6: + /* square */ + if (rate < 32) { + xm_info->cvol[i] = (xm_info->cvol[i] + (depth*2)); + } else { + xm_info->cvol[i] = (xm_info->cvol[i] - (depth*2)); + } + break; + default: + break; + } + } + break; + + case 0x0e: + /* extended effect */ + switch (xm_info->cefp[i] & 0xf0) { + case 0x90: + /* retrig note */ + if ((xm_info->tick % (xm_info->cefp[i] & 0x0f)) == 0) { + /* nice long line... */ + hw_play_waveform(&xm_header->hdr_inst[xm_info->cins[i]].instrument->sample[xm_header->hdr_inst[xm_info->cins[i]].instrument->note_sample_nr[xm_info->cnot[i]]], i, 0, convert_period(xm_info->cper[i])); + } + break; + + case 0xc0: + /* cut note */ + if (xm_info->tick == xm_info->ceec[i]) { + xm_info->cvol[i] = 0; + } + break; + + case 0xd0: + /* delay note */ + if (xm_info->tick == xm_info->ceed[i]) { + hw_play_waveform(&xm_header->hdr_inst[xm_info->cins[i]].instrument->sample[xm_header->hdr_inst[xm_info->cins[i]].instrument->note_sample_nr[xm_info->cnot[i]]], i, 0, convert_period(xm_info->cper[i])); + } + break; + + default: + /* effect not processed here */ + break; + } + break; + + case 0x11: + /* global volume slide */ + { + uint8 cefp; + + if (xm_info->cefp[i] == 0) { + cefp = xm_info->ce0h[i]; + } else { + cefp = xm_info->cefp[i]; + } + if (cefp & 0xf0) { + xm_info->gvol += cefp & 0xf0; + } + else if (cefp & 0x0f) { + xm_info->gvol -= cefp & 0x0f; + } + } + break; + + case 0x18: + /* panning slide */ + { + uint8 cefp; + + if (xm_info->cefp[i] == 0) { + cefp = xm_info->ce0p[i]; + } else { + cefp = xm_info->cefp[i]; + } + if (cefp & 0xf0) { + xm_info->cpan[i] += cefp & 0xf0; + } + else if (cefp & 0x0f) { + xm_info->cpan[i] -= cefp & 0x0f; + } + } + break; + + case 0x1a: + /* multi-retrig-note */ + if ((xm_info->tick % (xm_info->cefp[i] & 0x0f)) == 0) { + switch (xm_info->cefp[i] & 0x0f) { + case 0x00: + break; + case 0x01: + xm_info->cvol[i] -= 1; + break; + case 0x02: + xm_info->cvol[i] -= 2; + break; + case 0x03: + xm_info->cvol[i] -= 4; + break; + case 0x04: + xm_info->cvol[i] -= 8; + break; + case 0x05: + xm_info->cvol[i] -= 16; + break; + case 0x06: + xm_info->cvol[i] = (xm_info->cvol[i] * 2)/3; + break; + case 0x07: + xm_info->cvol[i] >>= 1; + break; + case 0x08: + break; + case 0x09: + xm_info->cvol[i] += 1; + break; + case 0x0a: + xm_info->cvol[i] += 2; + break; + case 0x0b: + xm_info->cvol[i] += 4; + break; + case 0x0c: + xm_info->cvol[i] += 8; + break; + case 0x0d: + xm_info->cvol[i] += 16; + break; + case 0x0e: + xm_info->cvol[i] = (xm_info->cvol[i] * 3)>>1; + break; + case 0x0f: + xm_info->cvol[i] <<= 1; + break; + } + hw_play_waveform(&xm_header->hdr_inst[xm_info->cins[i]].instrument->sample[xm_header->hdr_inst[xm_info->cins[i]].instrument->note_sample_nr[xm_info->cnot[i]]], i, 0, convert_period(xm_info->cper[i])); + } + break; + + case 0x1c: + /* tremor - need to find out exactly how this + works...should it trigger just + once or cycle through the on-time/ + off-time repeatedly? */ + break; + + default: + /* effect not processed here */ + break; + } + } + +} + +static void +update_envelopes() +{ + uint32 i, j; + XM_XI_HEADER2 *my_hdr; + sint32 x1, x2; + uint8 y1, y2; + uint8 type; + uint8 depth; + uint8 rate; + + /* loop through all the channels */ + for (i = 0; i < xm_header->channels; i++) { + /* get the instrument on the channel */ + my_hdr = (xm_header->hdr_inst[xm_info->cins[i]].instrument); + /* check if instrument is playing */ + if (xm_info->cnot[i] > 0) { + type = my_hdr->vol_type; + /* volume envelope enabled? */ + if (type & 0x01) { + /* check if we've reached last env. point */ + if (xm_info->vol_cnt[i] < my_hdr->vol_envelope[my_hdr->vol_points-1].frame) { + /* no, check if sustain is enabled */ + if (type & 0x02) { + if ((xm_info->keyoff[i] != 0) + || (xm_info->vol_cnt[i] < my_hdr->vol_envelope[my_hdr->vol_sustain_point].frame) ) { + xm_info->vol_cnt[i]++; + } + } else { + xm_info->vol_cnt[i]++; + } + } + /* envelope looping */ + if (type & 0x04) { + if (xm_info->vol_cnt[i] >= my_hdr->vol_envelope[my_hdr->vol_loop_end].frame) { + xm_info->vol_cnt[i] = my_hdr->vol_envelope[my_hdr->vol_loop_start].frame; + } + } + + /* volume envelope processing */ + if (my_hdr->vol_points == 1) { + xm_info->env_vol[i] = my_hdr->vol_envelope[0].value; + } else { + for (j = 1; j < my_hdr->vol_points; j++) { + if ((xm_info->vol_cnt[i] < my_hdr->vol_envelope[j].frame) && (xm_info->vol_cnt[i] >= my_hdr->vol_envelope[j-1].frame)) { + break; + } + } + x1 = my_hdr->vol_envelope[j-1].frame; + y1 = my_hdr->vol_envelope[j-1].value; + x2 = my_hdr->vol_envelope[j].frame; + y2 = my_hdr->vol_envelope[j].value; + + /* set final volume */ + xm_info->env_vol[i] = (((y2 - y1) * (xm_info->vol_cnt[i] - x1)) / (x2 - x1)) + y1; + } + + } else { + xm_info->env_vol[i] = 64; + } + + /* fadeout volume */ + if (xm_info->keyoff[i] != 0) { + if (xm_info->fadeout_vol[i] < my_hdr->fadeout_vol) { + xm_info->fadeout_vol[i] = 0; + } else { + xm_info->fadeout_vol[i] -= my_hdr->fadeout_vol; + } + } + + +/* + Bah...ARM is too slow to handle 32 voices + full envelope processing so + pan_env can been removed...we shall see if i can improve code enough later... +*/ + +#ifndef NO_PAN_ENVELOPE + + /* pan envelope enabled? */ + type = my_hdr->pan_type; + if (type & 0x01) { + /* check if we've reached last env. point */ + if (xm_info->pan_cnt[i] < my_hdr->pan_envelope[my_hdr->pan_points-1].frame) { + /* no, check if sustain is enabled */ + if (type & 0x02) { + if ((xm_info->keyoff[i] != 0) + || (xm_info->pan_cnt[i] < my_hdr->pan_envelope[my_hdr->pan_sustain_point ].frame) ) { + xm_info->pan_cnt[i]++; + } + } else { + xm_info->pan_cnt[i]++; + } + } + /* envelope looping */ + if (type & 0x04) { + if (xm_info->pan_cnt[i] > my_hdr->pan_envelope[my_hdr->pan_loop_end].frame) { + xm_info->pan_cnt[i] = my_hdr->pan_envelope[my_hdr->pan_loop_start].frame; + } + } + + /* pan envelope processing */ + if (my_hdr->pan_points == 1) { + xm_info->env_vol[i] = my_hdr->pan_envelope[0].value; + } else { + for (j = 1; j < my_hdr->pan_points; j++) { + if ((xm_info->pan_cnt[i] < my_hdr->pan_envelope[j].frame) && (xm_info->pan_cnt[i] >= my_hdr->pan_envelope[j-1].frame)) { + break; + } + } + x1 = my_hdr->pan_envelope[j-1].frame; + y1 = my_hdr->pan_envelope[j-1].value; + x2 = my_hdr->pan_envelope[j].frame; + y2 = my_hdr->pan_envelope[j].value; + + /* set final pan */ + xm_info->env_pan[i] = (((y2 - y1) * (xm_info->pan_cnt[i] - x1)) / (x2 - x1)) + y1; + } + + } else { + xm_info->env_pan[i] = 0; + } +#else + xm_info->env_pan[i] = 0; +#endif /* NO_PAN_ENVELOPE */ + + /* auto-vibrato */ + /* ok..not sure this is correct...found old mod-doc + which states something about y/16 of a semitone etc + which is different :/ */ + if (my_hdr->vibrato_depth != 0) { + if (xm_info->keyoff[i] == 0) { + if (xm_info->avib_cnt[i] < my_hdr->vibrato_sweep) { + depth = ((xm_info->avib_cnt[i]++) * my_hdr->vibrato_depth) / my_hdr->vibrato_sweep; + } else { + depth = my_hdr->vibrato_depth; + } + } else { + depth = (xm_info->avib_cnt[i] * my_hdr->vibrato_depth) / my_hdr->vibrato_sweep; + } + /* update vibrato position */ + rate = xm_info->avib_pos[i] & 0x3f; + xm_info->avib_pos[i] = rate + my_hdr->vibrato_rate; + + /* depth is now set */ + switch (my_hdr->vibrato_type) { + /* square */ + case 1: + if (rate < 32) { + xm_info->cvib_per[i] = (xm_info->cvib_per[i] + (depth<<1)); + } else { + xm_info->cvib_per[i] = (xm_info->cvib_per[i] - ((depth)<<1)); + } + break; + /* ramp-down */ + case 2: + xm_info->cvib_per[i] = xm_info->cvib_per[i] + (((depth<<8) - ((depth * rate)<<3))>>7); + break; + /* ramp-up */ + case 3: + xm_info->cvib_per[i] = xm_info->cvib_per[i] - (((depth<<8) - ((depth * rate)<<3))>>7); + break; + /* sine */ + default: + if (rate < 32) { + xm_info->cvib_per[i] = xm_info->cvib_per[i] + ((SinTab[rate] * depth)>>7); + } else { + xm_info->cvib_per[i] = xm_info->cvib_per[i] - ((SinTab[rate & 0x1f] * depth)>>7); + } + break; + } + } + } + } +} + +static void +set_final_vol_pan_freq() +{ + + uint32 i; + uint8 finalvol; + sint8 finalpan; + sint16 pan, absp; + + /* clamp global volumes */ + if (xm_info->gvol > 64) { + xm_info->gvol = 64; + } + if (xm_info->gvol < 0) { + xm_info->gvol = 0; + } + if (xm_info->mvol > 64) { + xm_info->mvol = 64; + } + if (xm_info->mvol < 0) { + xm_info->mvol = 0; + } + + for (i = 0; i < xm_header->channels; i++) { + if (xm_info->stereo) { + pan = absp = xm_info->cpan[i]; + + absp -= 128; + if (absp < 0) { + absp = -absp; + } + + finalpan = pan + (((xm_info->env_pan[i] - 32)*(128-absp)) / 32); + } else { + finalpan = 127; /* for mono, pan everything to left */ + } + + /* clamp volume */ + if (xm_info->cvol[i] > 64) { + xm_info->cvol[i] = 64; + } + if (xm_info->cvol[i] < 0) { + xm_info->cvol[i] = 0; + } + + finalvol = ((xm_info->fadeout_vol[i]>>10) * xm_info->env_vol[i] + * xm_info->gvol * xm_info->cvol[i])>>18; + + hw_set_vol_pan_freq(i, xm_info->mvol, finalvol, finalpan, + convert_period(xm_info->cper[i]) + xm_info->cvib_per[i]); + } + +} diff --git a/AICA/SRCS/dxm-0.9/src/sh4/CVS/Entries b/AICA/SRCS/dxm-0.9/src/sh4/CVS/Entries new file mode 100644 index 00000000..1f942997 --- /dev/null +++ b/AICA/SRCS/dxm-0.9/src/sh4/CVS/Entries @@ -0,0 +1,4 @@ +/dxm.h/1.1.1.1/Sat Sep 8 10:48:15 2001// +/loader.h/1.1.1.1/Sat Sep 8 10:48:15 2001// +/types.h/1.1.1.1/Sat Sep 8 10:48:15 2001// +D diff --git a/AICA/SRCS/dxm-0.9/src/sh4/CVS/Repository b/AICA/SRCS/dxm-0.9/src/sh4/CVS/Repository new file mode 100644 index 00000000..70db1f24 --- /dev/null +++ b/AICA/SRCS/dxm-0.9/src/sh4/CVS/Repository @@ -0,0 +1 @@ +/usr/home/ejstans/cvs/dxm/src/sh4 diff --git a/AICA/SRCS/dxm-0.9/src/sh4/CVS/Root b/AICA/SRCS/dxm-0.9/src/sh4/CVS/Root new file mode 100644 index 00000000..e14dc10a --- /dev/null +++ b/AICA/SRCS/dxm-0.9/src/sh4/CVS/Root @@ -0,0 +1 @@ +/usr/home/ejstans/cvs diff --git a/AICA/SRCS/dxm-0.9/src/sh4/dxm.h b/AICA/SRCS/dxm-0.9/src/sh4/dxm.h new file mode 100644 index 00000000..584f1302 --- /dev/null +++ b/AICA/SRCS/dxm-0.9/src/sh4/dxm.h @@ -0,0 +1,128 @@ +/* dxm.h - include file for SH4 programs to control the module aswell as + allowing access to internal variables used by the module-player +*/ + +#ifndef _DXM_H_ +#define _DXM_H_ + +#include "types.h" + +/* prototypes */ +sint32 dxm_disable_arm(void); +sint32 dxm_enable_arm(void); +sint32 dxm_load_driver(void *, uint32); +void *dxm_sramcpy4(void *, void *, uint32); +sint32 dxm_halt_xm(void); +sint32 dxm_init_xm(uint32); +sint32 dxm_init_done(void); +sint32 dxm_play_xm(void); +sint32 dxm_set_stereo(bool); +sint32 dxm_open_os(uint32, uint32, uint32, uint32, uint32, uint32, uint32, uint32, uint32, uint32); +sint32 dxm_play_os(uint32); +sint32 dxm_stop_os(uint32); +sint32 dxm_set_volume_os(uint32, uint32); +sint32 dxm_set_pan_os(uint32, sint32); + +sint32 G2Write(uint32 *, uint32); +sint32 G2Read(volatile uint32 *, uint32 *); + +#define NO_LOOP 0 +#define LOOP 1 + +#define MODE_16BIT 0 +#define MODE_8BIT 1 +#define MODE_ADPCM 2 +#define MODE_ADPCM_LOOP 3 + +/* keeps info & controls about the module */ +/* this structure is placed in soundRAM so as to be accessible from both + cpus. elements are either readonly or writeonly from respective cpu so as + to not cause any race-conditions +*/ +typedef struct _XM_INFO { + /* written by SH4 */ + bool stereo; /* really...shouldnt be in this struct at all... */ + uint32 play; /* when != 0 play else no playing */ + uint32 init; /* when != 0 initialize module (number-1 == order) */ + uint32 done; /* when != 0 initialization is done */ + sint32 mvol; /* master volume control */ + /* bookkeeping stuff */ + /* written by ARM */ + uint32 inst; /* number of instruments */ + uint32 order; /* current order */ + uint32 pattern; /* current pattern */ + uint32 row; /* current row */ + uint32 row_ofs; /* offset to row in pat */ + uint32 speed; /* current speed */ + uint32 bpm; /* current bpm */ + uint32 tick; /* current tick */ + sint32 gvol; /* global volume */ + /* channels */ + uint8 cnot[32]; /* current note */ + uint16 cper[32]; /* current period */ + uint8 cins[32]; /* current ch instrument */ + uint8 cvef[32]; /* current ch vol effect */ + uint8 ceff[32]; /* current effect */ + uint8 cefp[32]; /* current effect parameter */ + /* all the different parameters for the effects need to be remmeberde */ + uint8 ce01[32]; /* current portaup param */ + uint8 ce02[32]; /* current portadown param */ + uint8 ce030[32]; /* current toneporta param speed */ + uint16 ce031[32]; /* current toneporta period */ + uint8 ce04[32]; /* current vibrato param */ + uint8 ce07[32]; /* current tremolo param */ + uint8 ce0a[32]; /* current volumeslide param */ + uint8 cee1[32]; /* current fineportaup param */ + uint8 cee2[32]; /* current fineportadown param */ + uint8 cee3[32]; /* current glissando control */ + uint8 cee4[32]; /* current vibrato control */ + uint8 cee7[32]; /* current tremolo control */ + uint8 ceea[32]; /* current finevolumeslideup param */ + uint8 ceeb[32]; /* current finevolumeslidedown param */ + uint8 ceec[32]; /* current cut note param */ + uint8 ceed[32]; /* current delay note param */ + uint8 ce0h[32]; /* current global volume slide param */ + uint8 ce0p[32]; /* current panning slide param */ + uint8 ce0r[32]; /* current multiretrignote param */ + uint8 ce0t[32]; /* current tremor param */ + uint8 cex1[32]; /* current extrafineportaup param */ + uint8 cex2[32]; /* current extrafineportadown param */ + /* effect variables */ + uint8 vib_pos[32]; /* vibrato position */ + uint8 trm_pos[32]; /* tremolo position */ + uint32 pat_dly; /* how long delay is */ + uint32 pat_loop_row; /* row number */ + uint32 pat_loop_row_ofs; /* row offset (no extra calcing) */ + uint32 pat_loop_tmp; /* temporary storage of row offset */ + uint32 pat_loop_cnt; /* times left to loop */ + uint8 pbrk; /* lock to prevent multiple pattern breaks */ + /* envelopes */ + uint16 vol_cnt[32]; /* frame counter for volume */ + uint16 pan_cnt[32]; /* frame counter for panning */ + sint32 fadeout_vol[32]; /* fadeout volume */ + uint8 env_vol[32]; /* envelope volume */ + uint8 env_pan[32]; /* envelope panning */ + uint8 keyoff[32]; /* keyoff status */ + uint16 avib_cnt[32]; /* frame counter for auto-vibrato */ + uint8 avib_pos[32]; /* auto-vibrato position */ + sint16 cvib_per[32]; /* current vibrato delta */ + /* variables */ + uint8 carp[32]; /* current ch arpeggio counter */ + sint8 cvol[32]; /* current ch vol */ + uint8 cpan[32]; /* current ch pan */ + sint8 cfin[32]; /* current finetune value */ +} XM_INFO; + +/* keeps information about one-shot waveforms */ +typedef struct _OS_HEADER { + uint32 addr; + uint32 flags; + uint32 loop; + uint32 pitch; + uint32 pan_volume; + uint32 volume2; +} OS_HEADER; + +#define XM_INFO_ADDR 0xa080b000 + +#endif /* _DXM_H_ */ diff --git a/AICA/SRCS/dxm-0.9/src/sh4/loader.h b/AICA/SRCS/dxm-0.9/src/sh4/loader.h new file mode 100644 index 00000000..662dba02 --- /dev/null +++ b/AICA/SRCS/dxm-0.9/src/sh4/loader.h @@ -0,0 +1,10 @@ +/* loader.h */ + +#ifndef _LOADER_H_ +#define _LOADER_H_ + +#include "types.h" + +sint32 dxm_load(uint8 *); + +#endif /* _LOADER_H_ */ diff --git a/AICA/SRCS/dxm-0.9/src/sh4/types.h b/AICA/SRCS/dxm-0.9/src/sh4/types.h new file mode 100644 index 00000000..e728350d --- /dev/null +++ b/AICA/SRCS/dxm-0.9/src/sh4/types.h @@ -0,0 +1,22 @@ +/* types.h */ + +#ifndef _TYPES_H +#define _TYPES_H + +#ifndef NULL +#define NULL ((void *)0) +#endif /* NULL */ + +typedef unsigned char uint8; +typedef signed char sint8; +typedef unsigned short uint16; +typedef signed short sint16; +typedef unsigned int uint32; +typedef signed int sint32; + +typedef enum { + FALSE = 0, + TRUE = 1, +} bool; + +#endif /* _TYPE_H */ diff --git a/AICA/SRCS/dxm-0.9/src/types.h b/AICA/SRCS/dxm-0.9/src/types.h new file mode 100644 index 00000000..e728350d --- /dev/null +++ b/AICA/SRCS/dxm-0.9/src/types.h @@ -0,0 +1,22 @@ +/* types.h */ + +#ifndef _TYPES_H +#define _TYPES_H + +#ifndef NULL +#define NULL ((void *)0) +#endif /* NULL */ + +typedef unsigned char uint8; +typedef signed char sint8; +typedef unsigned short uint16; +typedef signed short sint16; +typedef unsigned int uint32; +typedef signed int sint32; + +typedef enum { + FALSE = 0, + TRUE = 1, +} bool; + +#endif /* _TYPE_H */ diff --git a/AICA/SRCS/libs3mplay/Makefile b/AICA/SRCS/libs3mplay/Makefile new file mode 100644 index 00000000..6d752be7 --- /dev/null +++ b/AICA/SRCS/libs3mplay/Makefile @@ -0,0 +1,18 @@ +# LibS3MPlay Example (C) Josh PH3NOM Pearson 2011 + +OPTFLAGS=-m4-single-only + +TARGET = libs3mplay.elf + +OBJS = main.o + +all: clean $(TARGET) + +include $(KOS_BASE)/Makefile.rules + +clean: + -rm -f $(TARGET) $(OBJS) + +$(TARGET): $(OBJS) + kos-cc -o $(TARGET) $(OBJS) $(DATAOBJS) $(OBJEXTRA) -ls3mplay + diff --git a/AICA/SRCS/libs3mplay/README b/AICA/SRCS/libs3mplay/README new file mode 100644 index 00000000..c05ebab2 --- /dev/null +++ b/AICA/SRCS/libs3mplay/README @@ -0,0 +1,10 @@ +This is an example player for the new library LibS3MPlay. +LibS3MPlay is heavily based on the work of Dan Pottter. + +First, build the library +s3mplay/libs3mplay/makefile + +Then you are ready to build the main application +s3mplay/makefile + +-Josh PH3NOM Pearson 2011 \ No newline at end of file diff --git a/AICA/SRCS/libs3mplay/libs3mplay/Makefile b/AICA/SRCS/libs3mplay/libs3mplay/Makefile new file mode 100644 index 00000000..a9702291 --- /dev/null +++ b/AICA/SRCS/libs3mplay/libs3mplay/Makefile @@ -0,0 +1,8 @@ +#LibS3MPlay (C) PH3NOM +#Based on work of Dan Potter + +TARGET = libs3mplay.a + +OBJS = libs3mplay.o + +include $(KOS_BASE)/addons/Makefile.prefab diff --git a/AICA/SRCS/libs3mplay/libs3mplay/libs3mplay.c b/AICA/SRCS/libs3mplay/libs3mplay/libs3mplay.c new file mode 100644 index 00000000..ab17d6dd --- /dev/null +++ b/AICA/SRCS/libs3mplay/libs3mplay/libs3mplay.c @@ -0,0 +1,76 @@ +/* KallistiOS ##version## + + libs3mplay.c + (C) 2011 Josh Pearson + + Based on: + 2ndmix.c + (c)2000-2002 Dan Potter + +*/ + +#include +#include +#include + +/**********************************************************/ +#include "libs3mplay.h" +#include "s3mplay.h" + +volatile unsigned long *snd_dbg = (unsigned long*)0xa080ffc0; +static int s3m_size=0; + +/* Load and start an S3M file from disk or memory */ +int s3m_play(char *fn) { + int idx, r; + FILE * fd; + + unsigned char buffer[2048]; + + spu_disable(); + + printf("LibS3MPlay: Loading %s\r\n", fn); + fd = fopen( fn, "rb" ); + if (fd == 0) + return S3M_ERROR_IO; + + fseek( fd, 0, SEEK_END ); + s3m_size = ftell( fd ); + fseek( fd, 0, SEEK_SET ); + + if( s3m_size > 1024*512*3 ) + return S3M_ERROR_MEM; + + idx = 0x10000; + /* Load 2048 bytes at a time */ + while ( (r=fread(buffer, 1, 2048, fd)) > 0) { + spu_memload(idx, buffer, r); + idx += r; + } + fclose(fd); + + printf("LibS3MPlay: Loading ARM program\r\n"); + spu_memload(0, s3mplay, sizeof(s3mplay)); + + spu_enable(); + + while (*snd_dbg != 3) + ; + + while (*snd_dbg == 3) + ; + + printf("S3M File Now Plays on the AICA processor\r\n"); + + return S3M_SUCCESS; +} + +/* Stop the AICA SPU and reset the memory */ +void s3m_stop() +{ + printf("LibS3MPlay: Stopping\n"); + spu_disable(); + spu_memset(0x10000, 0, s3m_size ); + spu_memset(0, 0, sizeof(s3mplay) ); +} + diff --git a/AICA/SRCS/libs3mplay/libs3mplay/libs3mplay.h b/AICA/SRCS/libs3mplay/libs3mplay/libs3mplay.h new file mode 100644 index 00000000..f70cae60 --- /dev/null +++ b/AICA/SRCS/libs3mplay/libs3mplay/libs3mplay.h @@ -0,0 +1,9 @@ +/* LibS3MPLAY (C) PH3NOM 2011 */ + +void s3m_stop(); +int s3m_play(char *fn); + +#define S3M_NULL 0x00 +#define S3M_SUCCESS 0x01 +#define S3M_ERROR_MEM 0x02 +#define S3M_ERROR_IO 0x03 diff --git a/AICA/SRCS/libs3mplay/libs3mplay/s3mplay.h b/AICA/SRCS/libs3mplay/libs3mplay/s3mplay.h new file mode 100644 index 00000000..07baf621 --- /dev/null +++ b/AICA/SRCS/libs3mplay/libs3mplay/s3mplay.h @@ -0,0 +1,1126 @@ +const unsigned char s3mplay[] ={ + 0x20, 0x00, 0x00, 0xea, 0x26, 0x00, 0x00, 0xea, + 0x25, 0x00, 0x00, 0xea, 0x25, 0x00, 0x00, 0xea, + 0x24, 0x00, 0x00, 0xea, 0x23, 0x00, 0x00, 0xea, + 0x22, 0x00, 0x00, 0xea, 0x50, 0x80, 0x9f, 0xe5, + 0x00, 0x90, 0x98, 0xe5, 0x07, 0x90, 0x09, 0xe2, + 0x02, 0x00, 0x59, 0xe3, 0x09, 0x00, 0x00, 0x1a, + 0x48, 0x80, 0x8f, 0xe2, 0x00, 0x90, 0x98, 0xe5, + 0x01, 0x90, 0x89, 0xe2, 0x00, 0x90, 0x88, 0xe5, + 0x34, 0x80, 0x9f, 0xe5, 0xf6, 0x90, 0xa0, 0xe3, + 0x10, 0x90, 0x88, 0xe5, 0x40, 0x90, 0xa0, 0xe3, + 0x24, 0x90, 0x88, 0xe5, 0xff, 0xff, 0xff, 0xea, + 0x18, 0x80, 0x9f, 0xe5, 0x01, 0x90, 0xa0, 0xe3, + 0x00, 0x90, 0x88, 0xe5, 0x00, 0x90, 0x88, 0xe5, + 0x00, 0x90, 0x88, 0xe5, 0x00, 0x90, 0x88, 0xe5, + 0x04, 0xf0, 0x5e, 0xe2, 0x00, 0x2d, 0x80, 0x00, + 0x04, 0x2d, 0x80, 0x00, 0x80, 0x28, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, + 0x0b, 0xda, 0xa0, 0xe3, 0x00, 0xa0, 0x0f, 0xe1, + 0x80, 0xa0, 0x8a, 0xe3, 0x40, 0xa0, 0xca, 0xe3, + 0x0a, 0xf0, 0x29, 0xe1, 0x0a, 0x00, 0x00, 0xeb, + 0xfe, 0xff, 0xff, 0xea, 0x0e, 0xf0, 0xa0, 0xe1, + 0x04, 0xf0, 0x4e, 0xe2, 0x14, 0x10, 0x9f, 0xe5, + 0x00, 0x30, 0x91, 0xe5, 0x00, 0x20, 0x83, 0xe0, + 0x00, 0x30, 0x91, 0xe5, 0x02, 0x00, 0x53, 0xe1, + 0xfc, 0xff, 0xff, 0xda, 0x0e, 0xf0, 0xa0, 0xe1, + 0x80, 0x00, 0x00, 0x00, 0x0d, 0xc0, 0xa0, 0xe1, + 0x10, 0xd8, 0x2d, 0xe9, 0x48, 0x40, 0x9f, 0xe5, + 0x00, 0x10, 0x94, 0xe5, 0x00, 0x20, 0xa0, 0xe3, + 0x01, 0x30, 0xa0, 0xe3, 0x04, 0xb0, 0x4c, 0xe2, + 0x04, 0x20, 0x81, 0xe5, 0x08, 0x20, 0x81, 0xe5, + 0x02, 0x20, 0x82, 0xe2, 0x00, 0x30, 0x81, 0xe5, + 0x00, 0x20, 0x81, 0xe5, 0x09, 0x00, 0x00, 0xeb, + 0x00, 0x20, 0x94, 0xe5, 0x03, 0x30, 0xa0, 0xe3, + 0x00, 0x30, 0x82, 0xe5, 0x32, 0x01, 0x00, 0xeb, + 0x00, 0x20, 0x94, 0xe5, 0x04, 0x30, 0xa0, 0xe3, + 0x00, 0x30, 0x82, 0xe5, 0x10, 0x68, 0x9d, 0xe8, + 0xa1, 0x05, 0x00, 0xea, 0x84, 0x1d, 0x00, 0x00, + 0x02, 0x35, 0xa0, 0xe3, 0x00, 0x20, 0xa0, 0xe3, + 0x0a, 0x3b, 0x83, 0xe2, 0x30, 0x40, 0x2d, 0xe9, + 0x02, 0xc5, 0xa0, 0xe3, 0x14, 0xc0, 0x8c, 0xe2, + 0x02, 0x00, 0xa0, 0xe1, 0x02, 0x55, 0xa0, 0xe3, + 0x02, 0x49, 0xa0, 0xe3, 0x1f, 0xe0, 0xa0, 0xe3, + 0x00, 0x20, 0x83, 0xe5, 0x82, 0x33, 0xa0, 0xe1, + 0x02, 0x35, 0x83, 0xe2, 0x7c, 0x10, 0xa0, 0xe3, + 0x04, 0x10, 0x51, 0xe2, 0x04, 0x00, 0x83, 0xe4, + 0xfc, 0xff, 0xff, 0x5a, 0x82, 0x43, 0x85, 0xe7, + 0x82, 0xe3, 0x8c, 0xe7, 0x01, 0x20, 0x82, 0xe2, + 0x3f, 0x00, 0x52, 0xe3, 0xf4, 0xff, 0xff, 0xda, + 0x02, 0x35, 0xa0, 0xe3, 0x0a, 0x3b, 0x83, 0xe2, + 0x0f, 0x20, 0xa0, 0xe3, 0x00, 0x20, 0x83, 0xe5, + 0x30, 0x80, 0xbd, 0xe8, 0x14, 0x30, 0x9f, 0xe5, + 0x80, 0x00, 0xa0, 0xe1, 0x7f, 0x0f, 0x00, 0xe2, + 0x03, 0x00, 0x80, 0xe0, 0x00, 0x02, 0x90, 0xe5, + 0xff, 0x00, 0x60, 0xe2, 0x0e, 0xf0, 0xa0, 0xe1, + 0x8c, 0x1d, 0x00, 0x00, 0x02, 0x25, 0xa0, 0xe3, + 0x80, 0x33, 0x92, 0xe7, 0x01, 0x39, 0xc3, 0xe3, + 0x02, 0x39, 0x83, 0xe3, 0x80, 0x33, 0x82, 0xe7, + 0x0e, 0xf0, 0xa0, 0xe1, 0x0d, 0xc0, 0xa0, 0xe1, + 0xf0, 0xdf, 0x2d, 0xe9, 0x04, 0xb0, 0x4c, 0xe2, + 0x56, 0x48, 0xa0, 0xe3, 0x03, 0x60, 0xa0, 0xe1, + 0x00, 0xa0, 0xa0, 0xe1, 0x22, 0x4c, 0x84, 0xe2, + 0x07, 0x80, 0xa0, 0xe3, 0x08, 0xd0, 0x4d, 0xe2, + 0x08, 0x50, 0x9b, 0xe5, 0x2c, 0x10, 0x0b, 0xe5, + 0x10, 0x90, 0x9b, 0xe5, 0x30, 0x20, 0x0b, 0xe5, + 0xeb, 0xff, 0xff, 0xeb, 0xff, 0x30, 0xa0, 0xe3, + 0x00, 0x00, 0xa0, 0xe1, 0x00, 0x00, 0xa0, 0xe1, + 0x00, 0x00, 0xa0, 0xe1, 0x00, 0x00, 0xa0, 0xe1, + 0x01, 0x30, 0x53, 0xe2, 0xf9, 0xff, 0xff, 0x5a, + 0x0c, 0x00, 0x9b, 0xe5, 0xda, 0xff, 0xff, 0xeb, + 0x80, 0x00, 0x59, 0xe3, 0x0c, 0x00, 0x8b, 0xe5, + 0x80, 0x90, 0x49, 0x02, 0x02, 0x00, 0x00, 0x0a, + 0x7f, 0x00, 0x59, 0xe3, 0x0f, 0x90, 0xa0, 0xc3, + 0x1f, 0x90, 0xa0, 0xd3, 0x04, 0x10, 0x9b, 0xe5, + 0x04, 0x00, 0x55, 0xe1, 0x00, 0xc0, 0xa0, 0x23, + 0x01, 0xc0, 0xa0, 0x33, 0x02, 0x35, 0xa0, 0xe3, + 0x07, 0x00, 0x78, 0xe3, 0x03, 0x20, 0xa0, 0xe1, + 0x06, 0x08, 0xa0, 0xe1, 0x01, 0x18, 0xa0, 0xe1, + 0x00, 0xc0, 0xa0, 0xb3, 0x08, 0x30, 0x83, 0xe2, + 0x20, 0x08, 0xa0, 0xe1, 0x0c, 0x20, 0x82, 0xe2, + 0x21, 0x18, 0xa0, 0xe1, 0x00, 0x00, 0x5c, 0xe3, + 0x8a, 0x03, 0x83, 0xe7, 0x8a, 0x13, 0x82, 0xe7, + 0x08, 0x00, 0x00, 0x0a, 0xa4, 0x40, 0xa0, 0xe1, + 0x01, 0x80, 0x48, 0xe2, 0x04, 0x00, 0x55, 0xe1, + 0x00, 0x30, 0xa0, 0x23, 0x01, 0x30, 0xa0, 0x33, + 0x07, 0x00, 0x78, 0xe3, 0x00, 0x30, 0xa0, 0xb3, + 0x00, 0x00, 0x53, 0xe3, 0xf6, 0xff, 0xff, 0x1a, + 0x04, 0x10, 0xa0, 0xe1, 0x05, 0x05, 0xa0, 0xe1, + 0xaa, 0x05, 0x00, 0xeb, 0x2c, 0x30, 0x1b, 0xe5, + 0x00, 0x0b, 0xa0, 0xe1, 0x02, 0x25, 0xa0, 0xe3, + 0x03, 0x78, 0xa0, 0xe1, 0x20, 0x0b, 0xa0, 0xe1, + 0x14, 0x30, 0x9b, 0xe5, 0x02, 0x10, 0xa0, 0xe1, + 0x02, 0xc0, 0xa0, 0xe1, 0x02, 0xe0, 0xa0, 0xe1, + 0x02, 0x40, 0xa0, 0xe1, 0x02, 0x50, 0xa0, 0xe1, + 0x02, 0x60, 0xa0, 0xe1, 0x88, 0x05, 0x80, 0xe1, + 0x18, 0x20, 0x82, 0xe2, 0x00, 0x00, 0x53, 0xe3, + 0x8a, 0x03, 0x82, 0xe7, 0x0f, 0x30, 0xa0, 0xe3, + 0x24, 0x20, 0xa0, 0xe3, 0x24, 0x10, 0x81, 0xe2, + 0x25, 0xc0, 0x8c, 0xe2, 0x28, 0xe0, 0x8e, 0xe2, + 0x8a, 0x93, 0xc1, 0xe7, 0x29, 0x40, 0x84, 0xe2, + 0x10, 0x50, 0x85, 0xe2, 0x04, 0x60, 0x86, 0xe2, + 0x27, 0x78, 0xa0, 0xe1, 0x8a, 0x33, 0xcc, 0xe7, + 0x10, 0x30, 0x83, 0xe2, 0x02, 0x05, 0xa0, 0xe3, + 0x8a, 0x23, 0xce, 0xe7, 0x0c, 0x20, 0x9b, 0xe5, + 0x8a, 0x23, 0xc4, 0xe7, 0x2c, 0x20, 0x1b, 0x15, + 0x2c, 0x20, 0x1b, 0x05, 0x8a, 0x33, 0x85, 0xe7, + 0x22, 0x38, 0xa0, 0x11, 0x22, 0x38, 0xa0, 0x01, + 0x30, 0x20, 0x1b, 0x15, 0x30, 0x20, 0x1b, 0x05, + 0x82, 0x33, 0x83, 0x11, 0x82, 0x33, 0x83, 0x01, + 0xc2, 0x3c, 0x83, 0x13, 0x03, 0x39, 0x83, 0x03, + 0x8a, 0x73, 0x86, 0xe7, 0x8a, 0x33, 0x80, 0xe7, + 0x28, 0xd0, 0x4b, 0xe2, 0xf0, 0xaf, 0x9d, 0xe8, + 0x0d, 0xc0, 0xa0, 0xe1, 0x10, 0xd8, 0x2d, 0xe9, + 0x00, 0x40, 0xa0, 0xe1, 0x04, 0xb0, 0x4c, 0xe2, + 0x01, 0x00, 0xa0, 0xe1, 0x80, 0xff, 0xff, 0xeb, + 0x02, 0x35, 0xa0, 0xe3, 0x29, 0x30, 0x83, 0xe2, + 0x84, 0x03, 0xc3, 0xe7, 0x10, 0xa8, 0x9d, 0xe8, + 0x80, 0x00, 0x51, 0xe3, 0x80, 0x10, 0x41, 0x02, + 0x02, 0x00, 0x00, 0x0a, 0x7f, 0x00, 0x51, 0xe3, + 0x0f, 0x10, 0xa0, 0xc3, 0x1f, 0x10, 0xa0, 0xd3, + 0x02, 0x35, 0xa0, 0xe3, 0x24, 0x30, 0x83, 0xe2, + 0x80, 0x13, 0xc3, 0xe7, 0x0e, 0xf0, 0xa0, 0xe1, + 0x56, 0x28, 0xa0, 0xe3, 0x22, 0x2c, 0x82, 0xe2, + 0x0d, 0xc0, 0xa0, 0xe1, 0x02, 0x00, 0x51, 0xe1, + 0x30, 0xd8, 0x2d, 0xe9, 0x04, 0xb0, 0x4c, 0xe2, + 0x00, 0x50, 0xa0, 0xe1, 0x07, 0x40, 0xa0, 0xe3, + 0x08, 0x00, 0x00, 0x2a, 0xa2, 0x20, 0xa0, 0xe1, + 0x01, 0x40, 0x44, 0xe2, 0x02, 0x00, 0x51, 0xe1, + 0x00, 0x30, 0xa0, 0x23, 0x01, 0x30, 0xa0, 0x33, + 0x07, 0x00, 0x74, 0xe3, 0x00, 0x30, 0xa0, 0xb3, + 0x00, 0x00, 0x53, 0xe3, 0xf6, 0xff, 0xff, 0x1a, + 0x01, 0x05, 0xa0, 0xe1, 0x02, 0x10, 0xa0, 0xe1, + 0x52, 0x05, 0x00, 0xeb, 0x00, 0x0b, 0xa0, 0xe1, + 0x20, 0x0b, 0xa0, 0xe1, 0x02, 0x35, 0xa0, 0xe3, + 0x84, 0x05, 0x80, 0xe1, 0x18, 0x30, 0x83, 0xe2, + 0x85, 0x03, 0x83, 0xe7, 0x30, 0xa8, 0x9d, 0xe8, + 0x0c, 0x30, 0x9f, 0xe5, 0x00, 0x20, 0xa0, 0xe3, + 0x01, 0x00, 0xa0, 0xe3, 0x00, 0x20, 0x83, 0xe5, + 0x0e, 0xf0, 0xa0, 0xe1, 0x2c, 0x2b, 0x00, 0x00, + 0x0e, 0xf0, 0xa0, 0xe1, 0x70, 0x40, 0x2d, 0xe9, + 0x92, 0x01, 0x04, 0xe0, 0x00, 0x00, 0x54, 0xe3, + 0x02, 0x60, 0xa0, 0xe1, 0x00, 0xc0, 0xa0, 0xe3, + 0x0b, 0x00, 0x00, 0xda, 0x30, 0xe0, 0x9f, 0xe5, + 0x30, 0x50, 0x9f, 0xe5, 0x00, 0x30, 0x9e, 0xe5, + 0x00, 0x20, 0x95, 0xe5, 0x02, 0x20, 0x83, 0xe0, + 0x01, 0x30, 0x83, 0xe2, 0x00, 0x30, 0x8e, 0xe5, + 0x00, 0x10, 0xd2, 0xe5, 0x0c, 0x10, 0xc0, 0xe7, + 0x01, 0xc0, 0x8c, 0xe2, 0x0c, 0x00, 0x54, 0xe1, + 0xf5, 0xff, 0xff, 0xca, 0x06, 0x00, 0xa0, 0xe1, + 0x70, 0x80, 0xbd, 0xe8, 0x2c, 0x2b, 0x00, 0x00, + 0x10, 0x23, 0x00, 0x00, 0x20, 0x00, 0x9f, 0xe5, + 0x00, 0x00, 0x52, 0xe3, 0x00, 0x30, 0x90, 0x05, + 0x01, 0x30, 0x83, 0x00, 0x00, 0x30, 0x80, 0x05, + 0x01, 0x00, 0x00, 0x0a, 0x01, 0x00, 0x52, 0xe3, + 0x00, 0x10, 0x80, 0x05, 0x00, 0x00, 0x90, 0xe5, + 0x0e, 0xf0, 0xa0, 0xe1, 0x2c, 0x2b, 0x00, 0x00, + 0x04, 0x30, 0x9f, 0xe5, 0x00, 0x00, 0x93, 0xe5, + 0x0e, 0xf0, 0xa0, 0xe1, 0x2c, 0x2b, 0x00, 0x00, + 0x10, 0x30, 0x9f, 0xe5, 0x10, 0x20, 0x9f, 0xe5, + 0x00, 0x10, 0x93, 0xe5, 0x00, 0x00, 0x92, 0xe5, + 0x00, 0x00, 0x81, 0xe0, 0x0e, 0xf0, 0xa0, 0xe1, + 0x10, 0x23, 0x00, 0x00, 0x2c, 0x2b, 0x00, 0x00, + 0x18, 0xc0, 0x9f, 0xe5, 0x18, 0x20, 0x9f, 0xe5, + 0x00, 0x30, 0x9c, 0xe5, 0x00, 0x10, 0x92, 0xe5, + 0x01, 0x00, 0xd3, 0xe7, 0x01, 0x30, 0x83, 0xe2, + 0x00, 0x30, 0x8c, 0xe5, 0x0e, 0xf0, 0xa0, 0xe1, + 0x2c, 0x2b, 0x00, 0x00, 0x10, 0x23, 0x00, 0x00, + 0x20, 0x10, 0x9f, 0xe5, 0xc0, 0x3f, 0xa0, 0xe1, + 0x00, 0x20, 0x91, 0xe5, 0x23, 0x0f, 0x80, 0xe0, + 0x03, 0x00, 0xc0, 0xe3, 0x02, 0x00, 0x80, 0xe0, + 0x01, 0x00, 0x80, 0xe2, 0x00, 0x00, 0x81, 0xe5, + 0x02, 0x00, 0xa0, 0xe1, 0x0e, 0xf0, 0xa0, 0xe1, + 0x0c, 0x23, 0x00, 0x00, 0x0e, 0xf0, 0xa0, 0xe1, + 0x00, 0x00, 0x52, 0xe3, 0x0e, 0xf0, 0xa0, 0xd1, + 0x01, 0x20, 0x42, 0xe2, 0x01, 0x30, 0xd1, 0xe4, + 0x00, 0x00, 0x52, 0xe3, 0x01, 0x30, 0xc0, 0xe4, + 0xfa, 0xff, 0xff, 0xca, 0x0e, 0xf0, 0xa0, 0xe1, + 0x00, 0x00, 0x52, 0xe3, 0x0e, 0xf0, 0xa0, 0xd1, + 0x01, 0x20, 0x42, 0xe2, 0x00, 0x00, 0x52, 0xe3, + 0x01, 0x10, 0xc0, 0xe4, 0xfb, 0xff, 0xff, 0xca, + 0x0e, 0xf0, 0xa0, 0xe1, 0x00, 0x20, 0xd0, 0xe5, + 0x00, 0x00, 0x52, 0xe3, 0x08, 0x00, 0x00, 0x0a, + 0x00, 0x30, 0xd1, 0xe5, 0x00, 0x00, 0x53, 0xe3, + 0x05, 0x00, 0x00, 0x0a, 0x03, 0x00, 0x52, 0xe1, + 0x05, 0x00, 0x00, 0x1a, 0x01, 0x20, 0xf0, 0xe5, + 0x00, 0x00, 0x52, 0xe3, 0x01, 0x10, 0x81, 0xe2, + 0xf6, 0xff, 0xff, 0x1a, 0x00, 0x00, 0xa0, 0xe3, + 0x0e, 0xf0, 0xa0, 0xe1, 0x00, 0x00, 0xe0, 0xe3, + 0x0e, 0xf0, 0xa0, 0xe1, 0x0d, 0xc0, 0xa0, 0xe1, + 0xf0, 0xdf, 0x2d, 0xe9, 0x04, 0xb0, 0x4c, 0xe2, + 0xc4, 0x56, 0x9f, 0xe5, 0xc4, 0x76, 0x9f, 0xe5, + 0x00, 0x60, 0xa0, 0xe3, 0x93, 0xdf, 0x4d, 0xe2, + 0x03, 0x00, 0x95, 0xe8, 0x30, 0x00, 0x0b, 0xe5, + 0xb4, 0x06, 0x9f, 0xe5, 0x2c, 0x10, 0x4b, 0xe5, + 0xb0, 0x16, 0x9f, 0xe5, 0x89, 0xff, 0xff, 0xeb, + 0x00, 0x00, 0x50, 0xe3, 0x00, 0x00, 0x87, 0xe5, + 0x02, 0x00, 0x00, 0x1a, 0x06, 0x00, 0xa0, 0xe1, + 0x28, 0xd0, 0x4b, 0xe2, 0xf0, 0xaf, 0x9d, 0xe8, + 0x00, 0x30, 0xa0, 0xe1, 0x1c, 0x10, 0xa0, 0xe3, + 0x01, 0x20, 0xa0, 0xe3, 0x88, 0x06, 0x9f, 0xe5, + 0x85, 0xff, 0xff, 0xeb, 0x00, 0x00, 0x97, 0xe5, + 0xb0, 0xff, 0xff, 0xeb, 0x00, 0x00, 0x97, 0xe5, + 0xae, 0xff, 0xff, 0xeb, 0x10, 0x00, 0x50, 0xe3, + 0xf1, 0xff, 0xff, 0x1a, 0x00, 0x00, 0x97, 0xe5, + 0x68, 0x86, 0x9f, 0xe5, 0xa9, 0xff, 0xff, 0xeb, + 0x00, 0x00, 0x97, 0xe5, 0xa7, 0xff, 0xff, 0xeb, + 0x02, 0x10, 0xa0, 0xe3, 0x01, 0x20, 0xa0, 0xe3, + 0x00, 0x30, 0x97, 0xe5, 0x08, 0x00, 0xa0, 0xe1, + 0x75, 0xff, 0xff, 0xeb, 0x02, 0x10, 0xa0, 0xe3, + 0x01, 0x20, 0xa0, 0xe3, 0x00, 0x30, 0x97, 0xe5, + 0x3c, 0x06, 0x9f, 0xe5, 0x70, 0xff, 0xff, 0xeb, + 0x02, 0x10, 0xa0, 0xe3, 0x01, 0x20, 0xa0, 0xe3, + 0x00, 0x30, 0x97, 0xe5, 0x2c, 0x06, 0x9f, 0xe5, + 0x6b, 0xff, 0xff, 0xeb, 0x00, 0x00, 0x97, 0xe5, + 0x96, 0xff, 0xff, 0xeb, 0x00, 0x00, 0x97, 0xe5, + 0x94, 0xff, 0xff, 0xeb, 0x00, 0x00, 0x97, 0xe5, + 0x92, 0xff, 0xff, 0xeb, 0x00, 0x00, 0x97, 0xe5, + 0x90, 0xff, 0xff, 0xeb, 0x00, 0x00, 0x97, 0xe5, + 0x8e, 0xff, 0xff, 0xeb, 0x00, 0x30, 0xa0, 0xe1, + 0xff, 0x30, 0x03, 0xe2, 0x30, 0x40, 0x4b, 0xe2, + 0x00, 0x00, 0x97, 0xe5, 0x60, 0x32, 0x0b, 0xe5, + 0x88, 0xff, 0xff, 0xeb, 0x04, 0x10, 0xa0, 0xe3, + 0x01, 0x20, 0xa0, 0xe3, 0x00, 0x30, 0x97, 0xe5, + 0x04, 0x00, 0xa0, 0xe1, 0x56, 0xff, 0xff, 0xeb, + 0x05, 0x10, 0xa0, 0xe1, 0x04, 0x00, 0xa0, 0xe1, + 0xa5, 0xff, 0xff, 0xeb, 0x60, 0x12, 0x1b, 0xe5, + 0x02, 0x00, 0x51, 0xe3, 0x00, 0x10, 0xa0, 0x03, + 0x00, 0x00, 0x50, 0xe3, 0x60, 0x12, 0x0b, 0xe5, + 0xbf, 0xff, 0xff, 0x1a, 0x00, 0x00, 0x97, 0xe5, + 0x78, 0xff, 0xff, 0xeb, 0xa8, 0x35, 0x9f, 0xe5, + 0x00, 0x00, 0x83, 0xe5, 0x00, 0x00, 0x97, 0xe5, + 0x74, 0xff, 0xff, 0xeb, 0x9c, 0x35, 0x9f, 0xe5, + 0x00, 0x00, 0x83, 0xe5, 0x00, 0x00, 0x97, 0xe5, + 0x70, 0xff, 0xff, 0xeb, 0x90, 0x35, 0x9f, 0xe5, + 0x0d, 0x10, 0xa0, 0xe3, 0x00, 0x00, 0x83, 0xe5, + 0x06, 0x20, 0xa0, 0xe1, 0x50, 0x40, 0x4b, 0xe2, + 0x00, 0x00, 0x97, 0xe5, 0x52, 0xff, 0xff, 0xeb, + 0x01, 0x20, 0xa0, 0xe3, 0x04, 0x00, 0xa0, 0xe1, + 0x20, 0x10, 0xa0, 0xe3, 0x00, 0x30, 0x97, 0xe5, + 0x37, 0xff, 0xff, 0xeb, 0x64, 0x25, 0x9f, 0xe5, + 0x01, 0x30, 0xd4, 0xe4, 0x7f, 0x30, 0x03, 0xe2, + 0x06, 0x30, 0xc2, 0xe7, 0x01, 0x60, 0x86, 0xe2, + 0x0f, 0x00, 0x56, 0xe3, 0xf9, 0xff, 0xff, 0xda, + 0x00, 0x10, 0x98, 0xe5, 0x01, 0x20, 0xa0, 0xe3, + 0x00, 0x30, 0x97, 0xe5, 0x40, 0x05, 0x9f, 0xe5, + 0x2b, 0xff, 0xff, 0xeb, 0x20, 0x35, 0x9f, 0xe5, + 0x00, 0x10, 0x93, 0xe5, 0x01, 0x20, 0xa0, 0xe3, + 0x81, 0x10, 0xa0, 0xe1, 0x00, 0x30, 0x97, 0xe5, + 0x25, 0x0e, 0x4b, 0xe2, 0x24, 0xff, 0xff, 0xeb, + 0x08, 0xc5, 0x9f, 0xe5, 0x00, 0x10, 0x9c, 0xe5, + 0x01, 0x20, 0xa0, 0xe3, 0x81, 0x10, 0xa0, 0xe1, + 0x00, 0x30, 0x97, 0xe5, 0x0c, 0x05, 0x9f, 0xe5, + 0x1d, 0xff, 0xff, 0xeb, 0x00, 0x40, 0x97, 0xe5, + 0x04, 0x00, 0xa0, 0xe1, 0x3b, 0xff, 0xff, 0xeb, + 0x0f, 0x00, 0x10, 0xe3, 0x24, 0x01, 0x00, 0x1a, + 0xd4, 0x34, 0x9f, 0xe5, 0x00, 0x20, 0x93, 0xe5, + 0x00, 0x60, 0xa0, 0xe3, 0x02, 0x00, 0x56, 0xe1, + 0x69, 0x00, 0x00, 0xaa, 0xe0, 0xa4, 0x9f, 0xe5, + 0x08, 0x10, 0x4a, 0xe2, 0x08, 0x20, 0x8a, 0xe2, + 0x04, 0x30, 0x8a, 0xe2, 0x6c, 0x12, 0x0b, 0xe5, + 0x98, 0x44, 0x9f, 0xe5, 0x14, 0x90, 0x8a, 0xe2, + 0x70, 0x22, 0x0b, 0xe5, 0x74, 0x32, 0x0b, 0xe5, + 0x28, 0xc0, 0x4b, 0xe2, 0x86, 0x30, 0x8c, 0xe0, + 0x27, 0x22, 0x53, 0xe5, 0x28, 0x12, 0x53, 0xe5, + 0x02, 0x14, 0x81, 0xe1, 0x01, 0x18, 0xa0, 0xe1, + 0x41, 0x16, 0xa0, 0xe1, 0x01, 0x20, 0xa0, 0xe3, + 0x00, 0x00, 0x97, 0xe5, 0x16, 0xff, 0xff, 0xeb, + 0x98, 0x24, 0x9f, 0xe5, 0x03, 0x00, 0x92, 0xe8, + 0x58, 0x02, 0x0b, 0xe5, 0x00, 0x00, 0x97, 0xe5, + 0x06, 0x53, 0xa0, 0xe1, 0x54, 0x12, 0x4b, 0xe5, + 0x26, 0xff, 0xff, 0xeb, 0xff, 0x00, 0x00, 0xe2, + 0x01, 0x00, 0x50, 0xe3, 0x0d, 0x10, 0xa0, 0xe3, + 0x00, 0x20, 0xa0, 0xe3, 0x0a, 0x01, 0x00, 0x8a, + 0x00, 0x00, 0x94, 0xe5, 0x08, 0xff, 0xff, 0xeb, + 0x00, 0x00, 0x94, 0xe5, 0x1d, 0xff, 0xff, 0xeb, + 0x00, 0x00, 0x94, 0xe5, 0x1b, 0xff, 0xff, 0xeb, + 0x00, 0x30, 0x94, 0xe5, 0x04, 0x10, 0xa0, 0xe3, + 0x01, 0x20, 0xa0, 0xe3, 0x0a, 0x00, 0x85, 0xe0, + 0xe9, 0xfe, 0xff, 0xeb, 0x00, 0x30, 0x94, 0xe5, + 0x04, 0x10, 0xa0, 0xe3, 0x01, 0x20, 0xa0, 0xe3, + 0x74, 0x02, 0x1b, 0xe5, 0xe4, 0xfe, 0xff, 0xeb, + 0x00, 0x30, 0x94, 0xe5, 0x04, 0x10, 0xa0, 0xe3, + 0x01, 0x20, 0xa0, 0xe3, 0x70, 0x02, 0x1b, 0xe5, + 0xdf, 0xfe, 0xff, 0xeb, 0x00, 0x00, 0x94, 0xe5, + 0x0a, 0xff, 0xff, 0xeb, 0x3f, 0x00, 0x50, 0xe3, + 0x6c, 0xc2, 0x1b, 0xc5, 0x6c, 0x12, 0x1b, 0xd5, + 0x3f, 0x30, 0xa0, 0xc3, 0x14, 0x30, 0x8c, 0xc5, + 0x01, 0x60, 0x86, 0xe2, 0x14, 0x00, 0x81, 0xd5, + 0x00, 0x00, 0x94, 0xe5, 0x01, 0xff, 0xff, 0xeb, + 0x00, 0x00, 0x94, 0xe5, 0xff, 0xfe, 0xff, 0xeb, + 0x9d, 0x2f, 0x4b, 0xe2, 0x0c, 0x00, 0x92, 0xe8, + 0x40, 0x20, 0x82, 0xe2, 0x40, 0x30, 0x83, 0xe2, + 0x00, 0x80, 0x50, 0xe2, 0x74, 0x22, 0x0b, 0xe5, + 0x70, 0x32, 0x0b, 0xe5, 0xde, 0x00, 0x00, 0x1a, + 0x00, 0x00, 0x94, 0xe5, 0xf5, 0xfe, 0xff, 0xeb, + 0x6c, 0xc2, 0x1b, 0xe5, 0x00, 0x30, 0x94, 0xe5, + 0x18, 0x00, 0x8c, 0xe5, 0x04, 0x10, 0xa0, 0xe3, + 0x01, 0x20, 0xa0, 0xe3, 0x09, 0x00, 0x85, 0xe0, + 0xc1, 0xfe, 0xff, 0xeb, 0x0c, 0x10, 0xa0, 0xe3, + 0x08, 0x20, 0xa0, 0xe1, 0x00, 0x00, 0x94, 0xe5, + 0xd3, 0xfe, 0xff, 0xeb, 0x90, 0x13, 0x9f, 0xe5, + 0x01, 0x20, 0xa0, 0xe3, 0x01, 0x00, 0x85, 0xe0, + 0x00, 0x30, 0x94, 0xe5, 0x1c, 0x10, 0xa0, 0xe3, + 0xb7, 0xfe, 0xff, 0xeb, 0x6c, 0xc2, 0x1b, 0xe5, + 0x00, 0x30, 0x94, 0xe5, 0x04, 0x10, 0xa0, 0xe3, + 0x01, 0x20, 0xa0, 0xe3, 0x96, 0x0f, 0x4b, 0xe2, + 0x3b, 0x80, 0xcc, 0xe5, 0xb0, 0xfe, 0xff, 0xeb, + 0x34, 0x13, 0x9f, 0xe5, 0x6c, 0x22, 0x1b, 0xe5, + 0x00, 0x30, 0x91, 0xe5, 0x40, 0x20, 0x82, 0xe2, + 0x03, 0x00, 0x56, 0xe1, 0x6c, 0x22, 0x0b, 0xe5, + 0x9e, 0xff, 0xff, 0xba, 0x1c, 0xc3, 0x9f, 0xe5, + 0x00, 0x30, 0x9c, 0xe5, 0x00, 0x60, 0xa0, 0xe3, + 0x03, 0x00, 0x56, 0xe1, 0x79, 0x00, 0x00, 0xaa, + 0x30, 0x13, 0x9f, 0xe5, 0x68, 0x12, 0x0b, 0xe5, + 0x18, 0x33, 0x9f, 0xe5, 0x86, 0x20, 0xa0, 0xe1, + 0x03, 0x00, 0x82, 0xe0, 0x03, 0x10, 0xd2, 0xe7, + 0x01, 0x30, 0xd0, 0xe5, 0x03, 0x14, 0x81, 0xe1, + 0x01, 0x18, 0xa0, 0xe1, 0x41, 0x16, 0xa0, 0xe1, + 0x01, 0x20, 0xa0, 0xe3, 0x00, 0x00, 0x97, 0xe5, + 0xad, 0xfe, 0xff, 0xeb, 0x00, 0x30, 0x97, 0xe5, + 0x00, 0xc0, 0xa0, 0xe3, 0x02, 0x10, 0xa0, 0xe3, + 0x01, 0x20, 0xa0, 0xe3, 0x97, 0x0f, 0x4b, 0xe2, + 0x5c, 0xc2, 0x0b, 0xe5, 0x0c, 0x80, 0xa0, 0xe1, + 0x8f, 0xfe, 0xff, 0xeb, 0x5c, 0xc2, 0x1b, 0xe5, + 0x0f, 0x00, 0x1c, 0xe3, 0x0f, 0x30, 0xcc, 0x13, + 0x03, 0x38, 0xa0, 0x11, 0x23, 0x38, 0xa0, 0x11, + 0x10, 0xc0, 0x83, 0x12, 0x02, 0xc0, 0x4c, 0xe2, + 0x0c, 0x00, 0xa0, 0xe1, 0x5c, 0xc2, 0x0b, 0xe5, + 0xbc, 0xfe, 0xff, 0xeb, 0x00, 0x90, 0x50, 0xe2, + 0x8d, 0x00, 0x00, 0x0a, 0x6c, 0xc2, 0x9f, 0xe5, + 0x5c, 0x12, 0x1b, 0xe5, 0x00, 0x30, 0x9c, 0xe5, + 0x01, 0x20, 0xa0, 0xe3, 0x9c, 0x52, 0x9f, 0xe5, + 0x7d, 0xfe, 0xff, 0xeb, 0x0a, 0x3b, 0xa0, 0xe3, + 0x03, 0x00, 0xa0, 0xe1, 0x86, 0x31, 0x85, 0xe7, + 0xb0, 0xfe, 0xff, 0xeb, 0x68, 0x12, 0x1b, 0xe5, + 0x00, 0x00, 0x50, 0xe3, 0x04, 0x00, 0x81, 0xe5, + 0x86, 0xa1, 0xa0, 0xe1, 0x7e, 0x00, 0x00, 0x0a, + 0x9f, 0x4d, 0xa0, 0xe3, 0x3f, 0x40, 0x84, 0xe2, + 0x08, 0x10, 0xa0, 0xe1, 0x05, 0x00, 0x8a, 0xe0, + 0x00, 0xc0, 0xe0, 0xe3, 0x08, 0xe0, 0xa0, 0xe1, + 0x04, 0x20, 0x90, 0xe5, 0x01, 0xc0, 0xc2, 0xe7, + 0x04, 0x30, 0x90, 0xe5, 0x01, 0x30, 0x83, 0xe0, + 0x01, 0xe0, 0xc3, 0xe5, 0x04, 0x20, 0x90, 0xe5, + 0x01, 0x20, 0x82, 0xe0, 0x02, 0xc0, 0xc2, 0xe5, + 0x04, 0x30, 0x90, 0xe5, 0x01, 0x30, 0x83, 0xe0, + 0x03, 0xc0, 0xc3, 0xe5, 0x04, 0x20, 0x90, 0xe5, + 0x01, 0x20, 0x82, 0xe0, 0x05, 0x10, 0x81, 0xe2, + 0x04, 0x00, 0x51, 0xe1, 0x04, 0xe0, 0xc2, 0xe5, + 0xee, 0xff, 0xff, 0xda, 0x5c, 0xc2, 0x1b, 0xe5, + 0x3f, 0x00, 0x58, 0xe3, 0x0c, 0x00, 0x5e, 0xd1, + 0x00, 0x40, 0xa0, 0xe3, 0x25, 0x00, 0x00, 0xaa, + 0x05, 0x50, 0x8a, 0xe0, 0x09, 0x00, 0xa0, 0xe1, + 0x01, 0xe0, 0xd0, 0xe4, 0xff, 0xa0, 0x0e, 0xe2, + 0x00, 0x00, 0x5a, 0xe3, 0x01, 0x40, 0x84, 0xe2, + 0x01, 0x80, 0x88, 0x02, 0x1a, 0x00, 0x00, 0x0a, + 0x1f, 0x30, 0x0e, 0xe2, 0x88, 0x22, 0x83, 0xe0, + 0x88, 0x12, 0x83, 0xe0, 0x02, 0x21, 0x82, 0xe0, + 0x88, 0x32, 0x83, 0xe0, 0x20, 0x00, 0x1e, 0xe3, + 0x64, 0x22, 0x0b, 0xe5, 0x01, 0xc1, 0x81, 0xe0, + 0x03, 0x91, 0x83, 0xe0, 0x07, 0x00, 0x00, 0x0a, + 0x01, 0x10, 0xd0, 0xe4, 0x04, 0x20, 0x95, 0xe5, + 0x02, 0x10, 0xcc, 0xe7, 0x02, 0x40, 0x84, 0xe2, + 0x04, 0x30, 0x95, 0xe5, 0x01, 0x20, 0xd0, 0xe4, + 0x03, 0x30, 0x8c, 0xe0, 0x01, 0x20, 0xc3, 0xe5, + 0x40, 0x00, 0x1e, 0xe3, 0x04, 0x30, 0x95, 0x15, + 0x01, 0x20, 0xd0, 0x14, 0x03, 0x30, 0x89, 0x10, + 0x01, 0x40, 0x84, 0x12, 0x02, 0x20, 0xc3, 0x15, + 0x80, 0x00, 0x1a, 0xe3, 0x34, 0x00, 0x00, 0x1a, + 0x5c, 0xc2, 0x1b, 0xe5, 0x3f, 0x00, 0x58, 0xe3, + 0x0c, 0x00, 0x54, 0xd1, 0xdb, 0xff, 0xff, 0xba, + 0x40, 0x11, 0x9f, 0xe5, 0x68, 0x22, 0x1b, 0xe5, + 0x00, 0x30, 0x91, 0xe5, 0x01, 0x60, 0x86, 0xe2, + 0x08, 0x20, 0x82, 0xe2, 0x03, 0x00, 0x56, 0xe1, + 0x68, 0x22, 0x0b, 0xe5, 0x87, 0xff, 0xff, 0xba, + 0x1c, 0xc1, 0x9f, 0xe5, 0x00, 0x30, 0x9c, 0xe5, + 0x00, 0x60, 0xa0, 0xe3, 0x03, 0x00, 0x56, 0xe1, + 0x21, 0x00, 0x00, 0xaa, 0x38, 0x41, 0x9f, 0xe5, + 0x00, 0x00, 0xa0, 0xe3, 0x47, 0xfe, 0xff, 0xeb, + 0x04, 0x00, 0x84, 0xe5, 0x00, 0x00, 0xa0, 0xe3, + 0x08, 0x10, 0x94, 0xe5, 0x00, 0x20, 0xa0, 0xe1, + 0x33, 0xfe, 0xff, 0xeb, 0x08, 0x20, 0x94, 0xe5, + 0x60, 0x12, 0x1b, 0xe5, 0x00, 0x30, 0x52, 0xe2, + 0x01, 0x30, 0xa0, 0x13, 0x00, 0x00, 0x51, 0xe3, + 0x00, 0x30, 0xa0, 0x13, 0x00, 0x00, 0x53, 0xe3, + 0x0b, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x52, 0xe3, + 0x00, 0x10, 0xa0, 0xe3, 0x08, 0x00, 0x00, 0xda, + 0x7f, 0x00, 0xe0, 0xe3, 0x04, 0x30, 0x94, 0xe5, + 0x01, 0x20, 0xd3, 0xe7, 0x00, 0x20, 0x22, 0xe0, + 0x01, 0x20, 0xc3, 0xe7, 0x01, 0x10, 0x81, 0xe2, + 0x08, 0x30, 0x94, 0xe5, 0x01, 0x00, 0x53, 0xe1, + 0xf7, 0xff, 0xff, 0xca, 0x98, 0x20, 0x9f, 0xe5, + 0x00, 0x30, 0x92, 0xe5, 0x01, 0x60, 0x86, 0xe2, + 0x03, 0x00, 0x56, 0xe1, 0x40, 0x40, 0x84, 0xe2, + 0xde, 0xff, 0xff, 0xba, 0x01, 0x00, 0xa0, 0xe3, + 0x74, 0xfe, 0xff, 0xea, 0x64, 0x32, 0x1b, 0xe5, + 0x04, 0x20, 0x95, 0xe5, 0x01, 0x10, 0xd0, 0xe4, + 0x02, 0x20, 0x83, 0xe0, 0x03, 0x10, 0xc2, 0xe5, + 0x64, 0xc2, 0x1b, 0xe5, 0x02, 0x40, 0x84, 0xe2, + 0x04, 0x30, 0x95, 0xe5, 0x01, 0x20, 0xd0, 0xe4, + 0x03, 0x30, 0x8c, 0xe0, 0x04, 0x20, 0xc3, 0xe5, + 0xbe, 0xff, 0xff, 0xea, 0x08, 0x00, 0xa0, 0xe1, + 0x66, 0xfe, 0xff, 0xea, 0x0f, 0x10, 0xc0, 0xe3, + 0x01, 0x18, 0xa0, 0xe1, 0x21, 0x18, 0xa0, 0xe1, + 0x04, 0x00, 0xa0, 0xe1, 0x10, 0x10, 0x81, 0xe2, + 0x01, 0x20, 0xa0, 0xe3, 0x02, 0xfe, 0xff, 0xeb, + 0xd2, 0xfe, 0xff, 0xea, 0x00, 0x00, 0xa0, 0xe3, + 0x5c, 0xfe, 0xff, 0xea, 0x02, 0x00, 0xa0, 0xe1, + 0x5a, 0xfe, 0xff, 0xea, 0x7c, 0x1c, 0x00, 0x00, + 0x38, 0x2b, 0x00, 0x00, 0x80, 0x1c, 0x00, 0x00, + 0x70, 0x1c, 0x00, 0x00, 0xdc, 0x4e, 0x00, 0x00, + 0x20, 0x23, 0x00, 0x00, 0x24, 0x23, 0x00, 0x00, + 0x1c, 0x23, 0x00, 0x00, 0x28, 0x2b, 0x00, 0x00, + 0x08, 0x23, 0x00, 0x00, 0x04, 0x23, 0x00, 0x00, + 0x40, 0x2b, 0x00, 0x00, 0xd0, 0x4b, 0x00, 0x00, + 0xdc, 0x4c, 0x00, 0x00, 0x58, 0x2b, 0x00, 0x00, + 0x74, 0x1c, 0x00, 0x00, 0x70, 0x2b, 0x00, 0x00, + 0x28, 0x23, 0x00, 0x00, 0x50, 0x2b, 0x00, 0x00, + 0x00, 0x01, 0x80, 0xe0, 0x0d, 0xc0, 0xa0, 0xe1, + 0x00, 0x01, 0x80, 0xe0, 0x00, 0xd8, 0x2d, 0xe9, + 0x7d, 0x10, 0xa0, 0xe3, 0x04, 0xb0, 0x4c, 0xe2, + 0x80, 0x01, 0xa0, 0xe1, 0x4f, 0x03, 0x00, 0xeb, + 0x00, 0xa8, 0x9d, 0xe8, 0x50, 0x20, 0x9f, 0xe5, + 0x00, 0x30, 0xd2, 0xe7, 0xfe, 0x00, 0x53, 0xe3, + 0x01, 0x00, 0x80, 0x02, 0x00, 0x30, 0xd2, 0xe7, + 0x40, 0x10, 0x9f, 0xe5, 0xff, 0x00, 0x53, 0xe3, + 0x00, 0x00, 0x81, 0xe5, 0x00, 0x00, 0xa0, 0x03, + 0x00, 0xc0, 0xd2, 0xe7, 0x30, 0x30, 0x9f, 0xe5, + 0x00, 0x00, 0x81, 0x05, 0x2c, 0x10, 0x9f, 0xe5, + 0x00, 0x00, 0xa0, 0xe3, 0x8c, 0x11, 0x81, 0xe0, + 0x00, 0x00, 0x83, 0xe5, 0x20, 0x20, 0x9f, 0xe5, + 0x04, 0x00, 0x91, 0xe5, 0x1c, 0x30, 0x9f, 0xe5, + 0x00, 0xc0, 0x82, 0xe5, 0x00, 0x00, 0x83, 0xe5, + 0x0e, 0xf0, 0xa0, 0xe1, 0xd0, 0x4b, 0x00, 0x00, + 0xd0, 0x4c, 0x00, 0x00, 0x30, 0x2b, 0x00, 0x00, + 0x28, 0x23, 0x00, 0x00, 0x34, 0x2b, 0x00, 0x00, + 0xd8, 0x4c, 0x00, 0x00, 0x04, 0xe0, 0x2d, 0xe5, + 0x30, 0xe0, 0x90, 0xe5, 0x30, 0x20, 0x9f, 0xe5, + 0x4e, 0x31, 0xa0, 0xe1, 0x3f, 0x30, 0x03, 0xe2, + 0x38, 0xc0, 0x90, 0xe5, 0x03, 0x11, 0x92, 0xe7, + 0x9c, 0x01, 0x01, 0xe0, 0x2c, 0x30, 0x90, 0xe5, + 0x34, 0x20, 0x90, 0xe5, 0xc1, 0x13, 0xa0, 0xe1, + 0x81, 0x30, 0x83, 0xe0, 0x02, 0xe0, 0x8e, 0xe0, + 0x30, 0xe0, 0x80, 0xe5, 0x04, 0x30, 0x80, 0xe5, + 0x04, 0xf0, 0x9d, 0xe4, 0x88, 0x21, 0x00, 0x00, + 0x1c, 0x20, 0x90, 0xe5, 0x0f, 0x30, 0x02, 0xe2, + 0x0f, 0x00, 0x53, 0xe3, 0x19, 0x00, 0x00, 0x0a, + 0xf0, 0x10, 0x02, 0xe2, 0xf0, 0x00, 0x51, 0xe3, + 0x22, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x51, 0xe3, + 0x08, 0x00, 0x00, 0x1a, 0x0f, 0x30, 0x12, 0xe2, + 0x03, 0x20, 0xa0, 0x11, 0x28, 0x20, 0x90, 0x05, + 0x08, 0x30, 0x90, 0xe5, 0x28, 0x20, 0x80, 0x15, + 0x02, 0x30, 0x53, 0xe0, 0x08, 0x10, 0x80, 0x45, + 0x08, 0x30, 0x80, 0x55, 0x0e, 0xf0, 0xa0, 0xe1, + 0x0f, 0x00, 0x12, 0xe3, 0x0e, 0xf0, 0xa0, 0x11, + 0x42, 0x32, 0xb0, 0xe1, 0x03, 0x20, 0xa0, 0x11, + 0x28, 0x20, 0x90, 0x05, 0x08, 0x30, 0x90, 0xe5, + 0x02, 0x30, 0x83, 0xe0, 0x28, 0x20, 0x80, 0x15, + 0x3f, 0x00, 0x53, 0xe3, 0x3f, 0x30, 0xa0, 0xc3, + 0x08, 0x30, 0x80, 0xe5, 0x0e, 0xf0, 0xa0, 0xe1, + 0xf0, 0x00, 0x12, 0xe3, 0xe3, 0xff, 0xff, 0x0a, + 0x08, 0x30, 0x90, 0xe5, 0x42, 0x22, 0xa0, 0xe1, + 0x02, 0x30, 0x83, 0xe0, 0x3f, 0x00, 0x53, 0xe3, + 0x3f, 0x30, 0xa0, 0xc3, 0x08, 0x30, 0x80, 0xe5, + 0xff, 0x30, 0xa0, 0xe3, 0x28, 0x20, 0x80, 0xe5, + 0x18, 0x30, 0x80, 0xe5, 0x0e, 0xf0, 0xa0, 0xe1, + 0x0f, 0x30, 0x12, 0xe2, 0x03, 0x20, 0xa0, 0x11, + 0x28, 0x20, 0x90, 0x05, 0x08, 0x30, 0x90, 0xe5, + 0x28, 0x20, 0x80, 0x15, 0x02, 0x30, 0x53, 0xe0, + 0x00, 0x30, 0xa0, 0x43, 0x08, 0x30, 0x80, 0xe5, + 0xff, 0x30, 0xa0, 0xe3, 0x18, 0x30, 0x80, 0xe5, + 0x0e, 0xf0, 0xa0, 0xe1, 0x04, 0x20, 0x90, 0xe5, + 0x2c, 0x10, 0x90, 0xe5, 0x01, 0x00, 0x52, 0xe1, + 0x07, 0x00, 0x00, 0xaa, 0x24, 0x30, 0x90, 0xe5, + 0x03, 0x30, 0x82, 0xe0, 0x01, 0x00, 0x53, 0xe1, + 0x01, 0x20, 0xa0, 0xe3, 0x09, 0x00, 0x00, 0xba, + 0x04, 0x10, 0x80, 0xe5, 0x02, 0x00, 0xa0, 0xe1, + 0x0e, 0xf0, 0xa0, 0xe1, 0x01, 0x20, 0xa0, 0xd3, + 0xfb, 0xff, 0xff, 0xda, 0x24, 0x30, 0x90, 0xe5, + 0x02, 0x30, 0x63, 0xe0, 0x01, 0x00, 0x53, 0xe1, + 0x01, 0x20, 0xa0, 0xe3, 0xf5, 0xff, 0xff, 0xda, + 0x00, 0x20, 0xa0, 0xe3, 0x04, 0x30, 0x80, 0xe5, + 0x02, 0x00, 0xa0, 0xe1, 0x0e, 0xf0, 0xa0, 0xe1, + 0x0d, 0xc0, 0xa0, 0xe1, 0xf0, 0xdf, 0x2d, 0xe9, + 0x00, 0x60, 0xa0, 0xe3, 0x70, 0x41, 0x9f, 0xe5, + 0x04, 0xb0, 0x4c, 0xe2, 0x06, 0xa0, 0xa0, 0xe1, + 0x14, 0xd0, 0x4d, 0xe2, 0x35, 0x00, 0x00, 0xea, + 0x5c, 0x21, 0x9f, 0xe5, 0x02, 0x10, 0x9a, 0xe7, + 0x58, 0x21, 0x9f, 0xe5, 0x01, 0x23, 0x82, 0xe0, + 0x18, 0x30, 0x92, 0xe5, 0x01, 0x30, 0x13, 0xe2, + 0x10, 0xc0, 0x92, 0x15, 0x08, 0xc0, 0x92, 0x05, + 0x04, 0x70, 0x92, 0x15, 0x0c, 0x50, 0x92, 0x15, + 0x04, 0x70, 0x92, 0x05, 0x38, 0x21, 0x9f, 0xe5, + 0x03, 0x50, 0xa0, 0x01, 0x00, 0x30, 0x92, 0xe5, + 0x04, 0x20, 0x93, 0xe5, 0x01, 0x90, 0xa0, 0x13, + 0x05, 0x90, 0xa0, 0x01, 0xda, 0x08, 0xa0, 0xe3, + 0x00, 0x00, 0x52, 0xe3, 0x14, 0x30, 0x94, 0x05, + 0x77, 0x0c, 0x80, 0xe2, 0x04, 0x10, 0x94, 0xe5, + 0x90, 0x00, 0x80, 0xe2, 0x03, 0x82, 0xa0, 0x01, + 0x80, 0x80, 0xa0, 0x13, 0x00, 0xc0, 0x8d, 0xe5, + 0xb2, 0x02, 0x00, 0xeb, 0x08, 0xc0, 0x94, 0xe5, + 0x8c, 0xc1, 0x6c, 0xe0, 0x8c, 0xc0, 0xa0, 0xe1, + 0xcc, 0x3f, 0xa0, 0xe1, 0x23, 0xcf, 0x8c, 0xe0, + 0x04, 0x00, 0x8d, 0xe5, 0x4c, 0xc1, 0xa0, 0xe1, + 0x05, 0x30, 0xa0, 0xe1, 0x07, 0x10, 0xa0, 0xe1, + 0x06, 0x00, 0xa0, 0xe1, 0x01, 0x20, 0xa0, 0xe3, + 0x08, 0xc0, 0x8d, 0xe5, 0x0c, 0x80, 0x8d, 0xe5, + 0x10, 0x90, 0x8d, 0xe5, 0x7e, 0xfc, 0xff, 0xeb, + 0x00, 0x30, 0xa0, 0xe3, 0x0c, 0x30, 0x84, 0xe5, + 0xb8, 0x30, 0x9f, 0xe5, 0x00, 0x00, 0x93, 0xe5, + 0x46, 0xff, 0xff, 0xeb, 0x01, 0x60, 0x86, 0xe2, + 0xac, 0x20, 0x9f, 0xe5, 0x0f, 0x00, 0x56, 0xe3, + 0x00, 0x00, 0x82, 0xe5, 0x3c, 0xa0, 0x8a, 0xe2, + 0x3c, 0x40, 0x84, 0xe2, 0x20, 0x00, 0x00, 0xca, + 0x04, 0x30, 0x94, 0xe5, 0x00, 0x00, 0x53, 0xe3, + 0x01, 0x30, 0x83, 0x02, 0x04, 0x30, 0x84, 0x05, + 0x0c, 0x30, 0x94, 0xe5, 0x00, 0x00, 0x53, 0xe3, + 0xc2, 0xff, 0xff, 0x1a, 0x08, 0x10, 0x94, 0xe5, + 0x81, 0x11, 0x61, 0xe0, 0x81, 0x10, 0xa0, 0xe1, + 0xc1, 0x3f, 0xa0, 0xe1, 0x23, 0x1f, 0x81, 0xe0, + 0x41, 0x11, 0xa0, 0xe1, 0x06, 0x00, 0xa0, 0xe1, + 0xce, 0xfc, 0xff, 0xeb, 0xda, 0x08, 0xa0, 0xe3, + 0x77, 0x0c, 0x80, 0xe2, 0x04, 0x10, 0x94, 0xe5, + 0x90, 0x00, 0x80, 0xe2, 0x83, 0x02, 0x00, 0xeb, + 0x00, 0x10, 0xa0, 0xe1, 0x06, 0x00, 0xa0, 0xe1, + 0xda, 0xfc, 0xff, 0xeb, 0x30, 0x20, 0x9f, 0xe5, + 0x00, 0x30, 0x92, 0xe5, 0x04, 0x20, 0x93, 0xe5, + 0x00, 0x00, 0x52, 0xe3, 0xd9, 0xff, 0xff, 0x1a, + 0x14, 0x10, 0x94, 0xe5, 0x06, 0x00, 0xa0, 0xe1, + 0x01, 0x12, 0xa0, 0xe1, 0xc7, 0xfc, 0xff, 0xeb, + 0xd4, 0xff, 0xff, 0xea, 0x28, 0xd0, 0x4b, 0xe2, + 0xf0, 0xaf, 0x9d, 0xe8, 0x50, 0x44, 0x00, 0x00, + 0x50, 0x2b, 0x00, 0x00, 0x84, 0x1d, 0x00, 0x00, + 0x04, 0x23, 0x00, 0x00, 0x3c, 0x2b, 0x00, 0x00, + 0x0d, 0xc0, 0xa0, 0xe1, 0xf0, 0xdd, 0x2d, 0xe9, + 0x04, 0xb0, 0x4c, 0xe2, 0x84, 0x80, 0x9f, 0xe5, + 0x14, 0xd0, 0x4d, 0xe2, 0x00, 0x20, 0x98, 0xe5, + 0x08, 0x30, 0x92, 0xe5, 0x00, 0x00, 0x53, 0xe3, + 0x05, 0x00, 0x00, 0x0a, 0x01, 0x00, 0x53, 0xe3, + 0x6c, 0xa0, 0x9f, 0xe5, 0x04, 0x00, 0x00, 0x0a, + 0x00, 0x20, 0x98, 0xe5, 0x00, 0x30, 0xa0, 0xe3, + 0x08, 0x30, 0x82, 0xe5, 0x24, 0xd0, 0x4b, 0xe2, + 0xf0, 0xad, 0x9d, 0xe8, 0x0c, 0x50, 0x92, 0xe5, + 0x00, 0x40, 0xa0, 0xe3, 0x10, 0x60, 0x92, 0xe5, + 0x00, 0x00, 0x9a, 0xe5, 0x14, 0x70, 0x92, 0xe5, + 0x2d, 0xfc, 0xff, 0xeb, 0x04, 0x30, 0xa0, 0xe1, + 0xe0, 0xc0, 0xa0, 0xe3, 0x80, 0xe0, 0xa0, 0xe3, + 0x00, 0x00, 0x9a, 0xe5, 0x04, 0x20, 0xa0, 0xe1, + 0x05, 0x10, 0xa0, 0xe1, 0xc0, 0x50, 0x8d, 0xe8, + 0x10, 0x40, 0x8d, 0xe5, 0x2a, 0xfc, 0xff, 0xeb, + 0x00, 0x30, 0x9a, 0xe5, 0x01, 0x30, 0x83, 0xe2, + 0x3f, 0x00, 0x53, 0xe3, 0x10, 0x30, 0xa0, 0xc3, + 0x00, 0x30, 0x8a, 0xe5, 0xe5, 0xff, 0xff, 0xea, + 0x84, 0x1d, 0x00, 0x00, 0x14, 0x23, 0x00, 0x00, + 0x0d, 0xc0, 0xa0, 0xe1, 0xf0, 0xdf, 0x2d, 0xe9, + 0x04, 0xb0, 0x4c, 0xe2, 0xd3, 0xff, 0xff, 0xeb, + 0x1c, 0x26, 0x9f, 0xe5, 0x00, 0x30, 0x92, 0xe5, + 0x01, 0x10, 0x53, 0xe2, 0x00, 0x10, 0x82, 0x15, + 0xf0, 0xaf, 0x9d, 0x18, 0x03, 0x30, 0xa0, 0xe3, + 0x00, 0x30, 0x82, 0xe5, 0x04, 0xa6, 0x9f, 0xe5, + 0x04, 0x86, 0x9f, 0xe5, 0x04, 0x46, 0x9f, 0xe5, + 0x01, 0x70, 0xa0, 0xe1, 0x18, 0x50, 0x94, 0xe5, + 0xff, 0x00, 0x55, 0xe3, 0x1c, 0x60, 0x94, 0xe5, + 0x30, 0x00, 0x00, 0x0a, 0x01, 0x30, 0x45, 0xe2, + 0x17, 0x00, 0x53, 0xe3, 0x03, 0xf1, 0x9f, 0x97, + 0x2a, 0x00, 0x00, 0xea, 0x24, 0x14, 0x00, 0x00, + 0x0c, 0x14, 0x00, 0x00, 0xb0, 0x14, 0x00, 0x00, + 0x94, 0x14, 0x00, 0x00, 0x60, 0x14, 0x00, 0x00, + 0x2c, 0x14, 0x00, 0x00, 0x7c, 0x15, 0x00, 0x00, + 0x58, 0x15, 0x00, 0x00, 0x48, 0x12, 0x00, 0x00, + 0x48, 0x12, 0x00, 0x00, 0x40, 0x15, 0x00, 0x00, + 0x28, 0x15, 0x00, 0x00, 0x48, 0x12, 0x00, 0x00, + 0x48, 0x12, 0x00, 0x00, 0x18, 0x15, 0x00, 0x00, + 0x48, 0x12, 0x00, 0x00, 0xc8, 0x14, 0x00, 0x00, + 0x48, 0x12, 0x00, 0x00, 0xfc, 0x11, 0x00, 0x00, + 0xbc, 0x14, 0x00, 0x00, 0x48, 0x12, 0x00, 0x00, + 0x00, 0x14, 0x00, 0x00, 0x48, 0x12, 0x00, 0x00, + 0xf8, 0x13, 0x00, 0x00, 0xf0, 0x30, 0x06, 0xe2, + 0x80, 0x00, 0x53, 0xe3, 0x0f, 0x30, 0x06, 0x02, + 0x14, 0x30, 0x84, 0x05, 0x0d, 0x00, 0x00, 0x0a, + 0xe2, 0x00, 0x00, 0xda, 0xc0, 0x00, 0x53, 0xe3, + 0x4e, 0x01, 0x00, 0x0a, 0xd0, 0x00, 0x53, 0xe3, + 0x08, 0x00, 0x00, 0x1a, 0x00, 0x20, 0x98, 0xe5, + 0x0f, 0x30, 0x06, 0xe2, 0x02, 0x00, 0x53, 0xe1, + 0x04, 0x00, 0x00, 0x1a, 0x01, 0x30, 0xa0, 0xe3, + 0x00, 0x20, 0xa0, 0xe3, 0x0c, 0x30, 0x84, 0xe5, + 0xff, 0x50, 0xa0, 0xe3, 0x10, 0x20, 0x84, 0xe5, + 0x18, 0x50, 0x84, 0xe5, 0x1c, 0x60, 0x84, 0xe5, + 0x01, 0x70, 0x87, 0xe2, 0x0f, 0x00, 0x57, 0xe3, + 0x3c, 0x40, 0x84, 0xe2, 0xc6, 0xff, 0xff, 0xda, + 0x28, 0xff, 0xff, 0xeb, 0x00, 0x30, 0x98, 0xe5, + 0x00, 0x20, 0x9a, 0xe5, 0x01, 0x30, 0x83, 0xe2, + 0x02, 0x00, 0x53, 0xe1, 0x00, 0x30, 0x88, 0xb5, + 0xf0, 0xaf, 0x9d, 0xb8, 0x00, 0x45, 0x9f, 0xe5, + 0x00, 0x30, 0x94, 0xe5, 0x00, 0x20, 0xa0, 0xe3, + 0x01, 0x00, 0x73, 0xe3, 0x00, 0x20, 0x88, 0xe5, + 0xe8, 0x00, 0x00, 0x0a, 0xec, 0x34, 0x9f, 0xe5, + 0x00, 0x00, 0x93, 0xe5, 0x01, 0x00, 0x80, 0xe2, + 0x9f, 0xfe, 0xff, 0xeb, 0xe0, 0x94, 0x9f, 0xe5, + 0x00, 0x20, 0x94, 0xe5, 0x00, 0x30, 0xe0, 0xe3, + 0x00, 0x30, 0x84, 0xe5, 0x00, 0x20, 0x89, 0xe5, + 0xd0, 0x34, 0x9f, 0xe5, 0x00, 0x70, 0xa0, 0xe3, + 0x00, 0x80, 0x93, 0xe5, 0xc8, 0xa4, 0x9f, 0xe5, + 0x07, 0x50, 0xa0, 0xe1, 0x00, 0x30, 0x99, 0xe5, + 0x83, 0x32, 0x87, 0xe0, 0x03, 0x31, 0x83, 0xe0, + 0x08, 0xc0, 0x83, 0xe0, 0x9c, 0x24, 0x9f, 0xe5, + 0x03, 0x60, 0xdc, 0xe5, 0x02, 0x40, 0x85, 0xe0, + 0x08, 0x10, 0xd3, 0xe7, 0x01, 0x20, 0xdc, 0xe5, + 0x18, 0x60, 0x84, 0xe5, 0x00, 0x00, 0x52, 0xe3, + 0x80, 0x24, 0x9f, 0x05, 0xff, 0xe0, 0x01, 0xe2, + 0x04, 0x30, 0xdc, 0xe5, 0x1c, 0x30, 0x84, 0xe5, + 0x01, 0x30, 0x42, 0x12, 0xff, 0x20, 0x03, 0x12, + 0x02, 0x00, 0xa0, 0x11, 0x00, 0x33, 0x8a, 0x10, + 0x14, 0x20, 0x93, 0x15, 0x5c, 0x34, 0x9f, 0x15, + 0x08, 0x20, 0x84, 0x15, 0x02, 0x00, 0x95, 0x07, + 0xff, 0x20, 0x00, 0xe2, 0x03, 0x00, 0x85, 0x17, + 0x02, 0x30, 0xdc, 0xe5, 0xff, 0x00, 0x53, 0xe3, + 0x08, 0x30, 0x84, 0x15, 0xff, 0x00, 0x5e, 0xe3, + 0x1d, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x5e, 0xe3, + 0x20, 0xe0, 0x84, 0xe5, 0x12, 0x00, 0x00, 0x0a, + 0x02, 0x33, 0x8a, 0xe0, 0x3c, 0x24, 0x9f, 0xe5, + 0x0f, 0x10, 0x01, 0xe2, 0x01, 0x01, 0x92, 0xe7, + 0x1c, 0xc0, 0x93, 0xe5, 0x80, 0x32, 0x60, 0xe0, + 0x03, 0x31, 0x60, 0xe0, 0x03, 0x32, 0x83, 0xe0, + 0x00, 0x00, 0x5c, 0xe3, 0x03, 0x01, 0x60, 0xe0, + 0x01, 0xc0, 0x8c, 0x12, 0x4e, 0x32, 0xa0, 0xe1, + 0x00, 0x02, 0xa0, 0xe1, 0x50, 0x03, 0xa0, 0xe1, + 0x0c, 0x10, 0xa0, 0xe1, 0xb3, 0x01, 0x00, 0xeb, + 0x00, 0x00, 0x50, 0xe3, 0x01, 0x00, 0x80, 0x02, + 0x2c, 0x00, 0x84, 0xe5, 0x07, 0x00, 0x56, 0xe3, + 0x05, 0x00, 0x00, 0x0a, 0x00, 0x20, 0xa0, 0xe3, + 0x2c, 0x30, 0x94, 0xe5, 0x10, 0x20, 0x84, 0xe5, + 0x01, 0x20, 0x82, 0xe2, 0x04, 0x30, 0x84, 0xe5, + 0x0c, 0x20, 0x84, 0xe5, 0x01, 0x70, 0x87, 0xe2, + 0x0f, 0x00, 0x57, 0xe3, 0x3c, 0x50, 0x85, 0xe2, + 0xbf, 0xff, 0xff, 0xda, 0x00, 0x30, 0x99, 0xe5, + 0x01, 0x30, 0x83, 0xe2, 0x00, 0x30, 0x89, 0xe5, + 0xf0, 0x6f, 0x9d, 0xe8, 0xc9, 0xfe, 0xff, 0xea, + 0x0f, 0x20, 0x16, 0xe2, 0x03, 0x00, 0x00, 0x0a, + 0x04, 0x30, 0x94, 0xe5, 0x03, 0x30, 0x62, 0xe0, + 0x04, 0x30, 0x84, 0xe5, 0x24, 0x20, 0x84, 0xe5, + 0xff, 0x50, 0xa0, 0xe3, 0x91, 0xff, 0xff, 0xea, + 0x94, 0x33, 0x9f, 0xe5, 0x00, 0x60, 0x83, 0xe5, + 0x8e, 0xff, 0xff, 0xea, 0x70, 0x23, 0x9f, 0xe5, + 0x88, 0x13, 0x9f, 0xe5, 0x00, 0x30, 0xa0, 0xe3, + 0x00, 0x30, 0x82, 0xe5, 0x00, 0x60, 0x81, 0xe5, + 0x88, 0xff, 0xff, 0xea, 0x00, 0x60, 0x8a, 0xe5, + 0x86, 0xff, 0xff, 0xea, 0xf0, 0x30, 0x06, 0xe2, + 0xe0, 0x00, 0x53, 0xe3, 0xe9, 0xff, 0xff, 0x0a, + 0xf0, 0x00, 0x53, 0xe3, 0x6b, 0x00, 0x00, 0x0a, + 0x00, 0x00, 0x56, 0xe3, 0x04, 0x30, 0x94, 0xe5, + 0x24, 0x20, 0x94, 0x05, 0x06, 0x21, 0xa0, 0x11, + 0x03, 0x30, 0x62, 0xe0, 0x24, 0x20, 0x84, 0x15, + 0x04, 0x30, 0x84, 0xe5, 0x79, 0xff, 0xff, 0xea, + 0xf0, 0x30, 0x06, 0xe2, 0xe0, 0x00, 0x53, 0xe3, + 0x80, 0x00, 0x00, 0x0a, 0xf0, 0x00, 0x53, 0xe3, + 0x58, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x56, 0xe3, + 0x04, 0x30, 0x94, 0xe5, 0x24, 0x20, 0x94, 0x05, + 0x06, 0x21, 0xa0, 0x11, 0x02, 0x30, 0x83, 0xe0, + 0x24, 0x20, 0x84, 0x15, 0x04, 0x30, 0x84, 0xe5, + 0x6c, 0xff, 0xff, 0xea, 0x18, 0x50, 0x84, 0xe5, + 0x04, 0x00, 0xa0, 0xe1, 0x1c, 0x60, 0x84, 0xe5, + 0x4c, 0xfe, 0xff, 0xeb, 0x18, 0x50, 0x84, 0xe2, + 0x60, 0x00, 0x95, 0xe8, 0x65, 0xff, 0xff, 0xea, + 0xcc, 0x32, 0x9f, 0xe5, 0x00, 0x60, 0x83, 0xe5, + 0x62, 0xff, 0xff, 0xea, 0xe0, 0x32, 0x9f, 0xe5, + 0x00, 0x60, 0x83, 0xe5, 0x5f, 0xff, 0xff, 0xea, + 0x45, 0x32, 0xa0, 0xe1, 0x01, 0x30, 0x43, 0xe2, + 0x0e, 0x00, 0x53, 0xe3, 0x03, 0xf1, 0x9f, 0x97, + 0x4e, 0x00, 0x00, 0xea, 0x18, 0x17, 0x00, 0x00, + 0x28, 0x17, 0x00, 0x00, 0x38, 0x17, 0x00, 0x00, + 0x48, 0x17, 0x00, 0x00, 0x94, 0x16, 0x00, 0x00, + 0xa4, 0x16, 0x00, 0x00, 0x08, 0x16, 0x00, 0x00, + 0x18, 0x16, 0x00, 0x00, 0x84, 0x16, 0x00, 0x00, + 0xbc, 0x16, 0x00, 0x00, 0xcc, 0x16, 0x00, 0x00, + 0xdc, 0x16, 0x00, 0x00, 0xec, 0x16, 0x00, 0x00, + 0xfc, 0x16, 0x00, 0x00, 0x08, 0x17, 0x00, 0x00, + 0x06, 0x34, 0xa0, 0xe1, 0xff, 0x50, 0xa0, 0xe3, + 0x10, 0x30, 0x84, 0xe5, 0x47, 0xff, 0xff, 0xea, + 0x04, 0x00, 0xa0, 0xe1, 0x18, 0x50, 0x84, 0xe5, + 0x1c, 0x60, 0x84, 0xe5, 0x5c, 0xfe, 0xff, 0xeb, + 0x04, 0x00, 0xa0, 0xe1, 0xd7, 0xff, 0xff, 0xea, + 0x04, 0x00, 0xa0, 0xe1, 0x18, 0x50, 0x84, 0xe5, + 0x1c, 0x60, 0x84, 0xe5, 0x10, 0xfe, 0xff, 0xeb, + 0x04, 0x00, 0xa0, 0xe1, 0xd1, 0xff, 0xff, 0xea, + 0x0f, 0x30, 0x16, 0xe2, 0x38, 0x30, 0x84, 0x15, + 0xf0, 0x30, 0x16, 0xe2, 0x43, 0x31, 0xa0, 0x11, + 0x04, 0x00, 0xa0, 0xe1, 0x00, 0x60, 0xa0, 0xe3, + 0x34, 0x30, 0x84, 0x15, 0x06, 0xfe, 0xff, 0xeb, + 0x32, 0xff, 0xff, 0xea, 0x00, 0x00, 0x56, 0xe3, + 0x06, 0x31, 0xa0, 0x11, 0x24, 0x30, 0x84, 0x15, + 0x04, 0x00, 0xa0, 0xe1, 0x46, 0xfe, 0xff, 0xeb, + 0x00, 0x00, 0x50, 0xe3, 0x1c, 0x60, 0x94, 0x15, + 0xff, 0x50, 0xa0, 0x13, 0x29, 0xff, 0xff, 0xea, + 0x20, 0x00, 0x53, 0xe3, 0x27, 0xff, 0xff, 0x1a, + 0x00, 0x20, 0x94, 0xe5, 0xe0, 0x31, 0x9f, 0xe5, + 0x02, 0x33, 0x83, 0xe0, 0x1c, 0x10, 0x93, 0xe5, + 0x04, 0x20, 0x94, 0xe5, 0xe4, 0x31, 0x9f, 0xe5, + 0x0f, 0xc0, 0x06, 0xe2, 0x91, 0x02, 0x00, 0xe0, + 0x0c, 0x11, 0x93, 0xe7, 0x23, 0x01, 0x00, 0xeb, + 0x04, 0x00, 0x84, 0xe5, 0x1b, 0xff, 0xff, 0xea, + 0x0f, 0x20, 0x16, 0xe2, 0x04, 0x30, 0x94, 0x15, + 0x02, 0x21, 0xa0, 0x11, 0x83, 0xff, 0xff, 0x0a, + 0x02, 0x30, 0x83, 0xe0, 0x7f, 0xff, 0xff, 0xea, + 0x0f, 0x20, 0x16, 0xe2, 0x04, 0x30, 0x94, 0x15, + 0x02, 0x21, 0xa0, 0x11, 0x7a, 0xff, 0xff, 0x1a, + 0xff, 0x50, 0xa0, 0xe3, 0x0f, 0xff, 0xff, 0xea, + 0x08, 0x30, 0x94, 0xe5, 0xa3, 0x3f, 0x83, 0xe0, + 0xc3, 0x30, 0xa0, 0xe1, 0x08, 0x30, 0x84, 0xe5, + 0x00, 0x00, 0x98, 0xe5, 0x05, 0x10, 0xa0, 0xe1, + 0x58, 0x01, 0x00, 0xeb, 0x00, 0x00, 0x50, 0xe3, + 0x01, 0x30, 0xa0, 0x03, 0x0c, 0x30, 0x84, 0x05, + 0x10, 0x00, 0x84, 0x05, 0x03, 0xff, 0xff, 0xea, + 0x4c, 0x91, 0x9f, 0xe5, 0x00, 0x30, 0x99, 0xe5, + 0x40, 0x00, 0x53, 0xe3, 0x1b, 0xff, 0xff, 0x1a, + 0x50, 0x41, 0x9f, 0xe5, 0x00, 0x00, 0x94, 0xe5, + 0x01, 0x00, 0x70, 0xe3, 0x2c, 0x31, 0x9f, 0x05, + 0x00, 0x00, 0x93, 0x05, 0x01, 0x00, 0x80, 0x02, + 0xaf, 0xfd, 0xff, 0xeb, 0x00, 0x30, 0xe0, 0xe3, + 0x00, 0x30, 0x84, 0xe5, 0x11, 0xff, 0xff, 0xea, + 0x0f, 0x20, 0x16, 0xe2, 0x5f, 0xff, 0xff, 0x0a, + 0x04, 0x30, 0x94, 0xe5, 0x02, 0x30, 0x83, 0xe0, + 0x5a, 0xff, 0xff, 0xea, 0x08, 0x30, 0x94, 0xe5, + 0x01, 0x30, 0x83, 0xe2, 0x08, 0x30, 0x84, 0xe5, + 0xe0, 0xff, 0xff, 0xea, 0x08, 0x30, 0x94, 0xe5, + 0x10, 0x30, 0x43, 0xe2, 0x08, 0x30, 0x84, 0xe5, + 0xdc, 0xff, 0xff, 0xea, 0x08, 0x00, 0x94, 0xe5, + 0x03, 0x10, 0xa0, 0xe3, 0x80, 0x00, 0xa0, 0xe1, + 0xea, 0x00, 0x00, 0xeb, 0x08, 0x00, 0x84, 0xe5, + 0xd6, 0xff, 0xff, 0xea, 0x08, 0x30, 0x94, 0xe5, + 0x02, 0x30, 0x83, 0xe2, 0x08, 0x30, 0x84, 0xe5, + 0xd2, 0xff, 0xff, 0xea, 0x08, 0x30, 0x94, 0xe5, + 0x04, 0x30, 0x83, 0xe2, 0x08, 0x30, 0x84, 0xe5, + 0xce, 0xff, 0xff, 0xea, 0x08, 0x30, 0x94, 0xe5, + 0x08, 0x30, 0x83, 0xe2, 0x08, 0x30, 0x84, 0xe5, + 0xca, 0xff, 0xff, 0xea, 0x08, 0x30, 0x94, 0xe5, + 0x10, 0x30, 0x83, 0xe2, 0x08, 0x30, 0x84, 0xe5, + 0xc6, 0xff, 0xff, 0xea, 0x08, 0x30, 0x94, 0xe5, + 0x83, 0x30, 0x83, 0xe0, 0xc0, 0xff, 0xff, 0xea, + 0x08, 0x30, 0x94, 0xe5, 0x83, 0x30, 0xa0, 0xe1, + 0x08, 0x30, 0x84, 0xe5, 0xbf, 0xff, 0xff, 0xea, + 0x08, 0x30, 0x94, 0xe5, 0x01, 0x30, 0x43, 0xe2, + 0x08, 0x30, 0x84, 0xe5, 0xbb, 0xff, 0xff, 0xea, + 0x08, 0x30, 0x94, 0xe5, 0x02, 0x30, 0x43, 0xe2, + 0x08, 0x30, 0x84, 0xe5, 0xb7, 0xff, 0xff, 0xea, + 0x08, 0x30, 0x94, 0xe5, 0x04, 0x30, 0x43, 0xe2, + 0x08, 0x30, 0x84, 0xe5, 0xb3, 0xff, 0xff, 0xea, + 0x08, 0x30, 0x94, 0xe5, 0x08, 0x30, 0x43, 0xe2, + 0x08, 0x30, 0x84, 0xe5, 0xaf, 0xff, 0xff, 0xea, + 0x00, 0x20, 0x98, 0xe5, 0x0f, 0x30, 0x06, 0xe2, + 0x02, 0x00, 0x53, 0xe1, 0x00, 0x30, 0xa0, 0x03, + 0xff, 0x50, 0xa0, 0x03, 0x08, 0x30, 0x84, 0x05, + 0xb4, 0xfe, 0xff, 0xea, 0x00, 0x23, 0x00, 0x00, + 0x08, 0x23, 0x00, 0x00, 0x18, 0x23, 0x00, 0x00, + 0x50, 0x44, 0x00, 0x00, 0xfc, 0x22, 0x00, 0x00, + 0xd0, 0x4c, 0x00, 0x00, 0x30, 0x2b, 0x00, 0x00, + 0xd8, 0x4c, 0x00, 0x00, 0x50, 0x2b, 0x00, 0x00, + 0xc8, 0x22, 0x00, 0x00, 0x28, 0x2b, 0x00, 0x00, + 0xf8, 0x22, 0x00, 0x00, 0x04, 0x23, 0x00, 0x00, + 0x88, 0x22, 0x00, 0x00, 0x0d, 0xc0, 0xa0, 0xe1, + 0xf0, 0xd8, 0x2d, 0xe9, 0x78, 0x61, 0x9f, 0xe5, + 0x78, 0x01, 0x9f, 0xe5, 0x04, 0xb0, 0x4c, 0xe2, + 0x00, 0x10, 0xa0, 0xe3, 0x1e, 0x2d, 0xa0, 0xe3, + 0x6c, 0xfb, 0xff, 0xeb, 0x00, 0x30, 0x96, 0xe5, + 0x04, 0x00, 0x93, 0xe5, 0x00, 0x00, 0x50, 0xe3, + 0x5c, 0x71, 0x9f, 0x05, 0x00, 0x40, 0xa0, 0x01, + 0x02, 0x30, 0xa0, 0x03, 0x47, 0x00, 0x00, 0x0a, + 0x4c, 0x71, 0x9f, 0xe5, 0x00, 0x40, 0xa0, 0xe3, + 0x08, 0x30, 0xa0, 0xe3, 0x04, 0x30, 0xc7, 0xe7, + 0x01, 0x40, 0x84, 0xe2, 0x0f, 0x00, 0x54, 0xe3, + 0xfb, 0xff, 0xff, 0xda, 0x2c, 0x51, 0x9f, 0xe5, + 0x00, 0x40, 0xa0, 0xe3, 0x04, 0x00, 0xa0, 0xe1, + 0x67, 0xfa, 0xff, 0xeb, 0x04, 0x10, 0xd7, 0xe7, + 0x04, 0x00, 0xa0, 0xe1, 0x01, 0x12, 0xa0, 0xe1, + 0xde, 0xfa, 0xff, 0xeb, 0x04, 0x30, 0xd7, 0xe7, + 0x04, 0x00, 0xa0, 0xe1, 0x14, 0x30, 0x85, 0xe5, + 0x01, 0x40, 0x84, 0xe2, 0xff, 0x10, 0xa0, 0xe3, + 0xce, 0xfa, 0xff, 0xeb, 0x3f, 0x30, 0xa0, 0xe3, + 0x0f, 0x00, 0x54, 0xe3, 0x08, 0x30, 0x85, 0xe5, + 0x3c, 0x50, 0x85, 0xe2, 0xee, 0xff, 0xff, 0xda, + 0xe8, 0x20, 0x9f, 0xe5, 0xe8, 0x30, 0x9f, 0xe5, + 0x00, 0xe0, 0xd2, 0xe5, 0x8e, 0x31, 0x83, 0xe0, + 0x04, 0x10, 0x93, 0xe5, 0xdc, 0x30, 0x9f, 0xe5, + 0x00, 0xc0, 0xa0, 0xe3, 0xd8, 0x20, 0x9f, 0xe5, + 0x00, 0xc0, 0x83, 0xe5, 0xd4, 0x30, 0x9f, 0xe5, + 0x00, 0x00, 0x92, 0xe5, 0x00, 0x10, 0x83, 0xe5, + 0xcc, 0x20, 0x9f, 0xe5, 0xcc, 0x30, 0x9f, 0xe5, + 0x00, 0x40, 0xe0, 0xe3, 0x00, 0x40, 0x82, 0xe5, + 0xc4, 0x20, 0x9f, 0xe5, 0xc4, 0x50, 0x9f, 0xe5, + 0x00, 0xc0, 0x83, 0xe5, 0xc0, 0x30, 0x9f, 0xe5, + 0x05, 0x70, 0xa0, 0xe1, 0x00, 0xe0, 0x82, 0xe5, + 0x00, 0x40, 0x83, 0xe5, 0x13, 0xfd, 0xff, 0xeb, + 0x00, 0x00, 0x85, 0xe5, 0x21, 0xfe, 0xff, 0xeb, + 0x00, 0x10, 0x95, 0xe5, 0x00, 0x00, 0x51, 0xe3, + 0x01, 0x10, 0x81, 0x02, 0x01, 0x38, 0xa0, 0xe1, + 0x00, 0x20, 0x96, 0xe5, 0x01, 0x3a, 0x83, 0xe3, + 0x01, 0x30, 0x83, 0xe3, 0x11, 0x0c, 0xa0, 0xe3, + 0x00, 0x30, 0x82, 0xe5, 0x3a, 0x00, 0x80, 0xe2, + 0x00, 0x10, 0x85, 0x05, 0x5d, 0x00, 0x00, 0xeb, + 0xef, 0xf9, 0xff, 0xeb, 0x00, 0x30, 0x97, 0xe5, + 0x03, 0x38, 0xa0, 0xe1, 0x01, 0x3a, 0x83, 0xe3, + 0x00, 0x20, 0x96, 0xe5, 0x02, 0x30, 0x83, 0xe3, + 0x00, 0x30, 0x82, 0xe5, 0xea, 0xff, 0xff, 0xea, + 0x04, 0x30, 0xc7, 0xe7, 0x02, 0x40, 0x84, 0xe2, + 0x0f, 0x00, 0x54, 0xe3, 0xfb, 0xff, 0xff, 0xda, + 0x01, 0x40, 0xa0, 0xe3, 0x0d, 0x30, 0xa0, 0xe3, + 0x04, 0x30, 0xc7, 0xe7, 0x02, 0x40, 0x84, 0xe2, + 0x0f, 0x00, 0x54, 0xe3, 0xfb, 0xff, 0xff, 0xda, + 0xb3, 0xff, 0xff, 0xea, 0x84, 0x1d, 0x00, 0x00, + 0x50, 0x44, 0x00, 0x00, 0x40, 0x2b, 0x00, 0x00, + 0xd0, 0x4b, 0x00, 0x00, 0x28, 0x23, 0x00, 0x00, + 0xd0, 0x4c, 0x00, 0x00, 0x04, 0x23, 0x00, 0x00, + 0xd8, 0x4c, 0x00, 0x00, 0xf8, 0x22, 0x00, 0x00, + 0x30, 0x2b, 0x00, 0x00, 0x34, 0x2b, 0x00, 0x00, + 0x3c, 0x2b, 0x00, 0x00, 0xfc, 0x22, 0x00, 0x00, + 0x01, 0x20, 0x51, 0xe2, 0x0e, 0xf0, 0xa0, 0x01, + 0x36, 0x00, 0x00, 0x3a, 0x01, 0x00, 0x50, 0xe1, + 0x22, 0x00, 0x00, 0x9a, 0x02, 0x00, 0x11, 0xe1, + 0x23, 0x00, 0x00, 0x0a, 0x0e, 0x02, 0x11, 0xe3, + 0x81, 0x11, 0xa0, 0x01, 0x08, 0x30, 0xa0, 0x03, + 0x01, 0x30, 0xa0, 0x13, 0x01, 0x02, 0x51, 0xe3, + 0x00, 0x00, 0x51, 0x31, 0x01, 0x12, 0xa0, 0x31, + 0x03, 0x32, 0xa0, 0x31, 0xfa, 0xff, 0xff, 0x3a, + 0x02, 0x01, 0x51, 0xe3, 0x00, 0x00, 0x51, 0x31, + 0x81, 0x10, 0xa0, 0x31, 0x83, 0x30, 0xa0, 0x31, + 0xfa, 0xff, 0xff, 0x3a, 0x00, 0x20, 0xa0, 0xe3, + 0x01, 0x00, 0x50, 0xe1, 0x01, 0x00, 0x40, 0x20, + 0x03, 0x20, 0x82, 0x21, 0xa1, 0x00, 0x50, 0xe1, + 0xa1, 0x00, 0x40, 0x20, 0xa3, 0x20, 0x82, 0x21, + 0x21, 0x01, 0x50, 0xe1, 0x21, 0x01, 0x40, 0x20, + 0x23, 0x21, 0x82, 0x21, 0xa1, 0x01, 0x50, 0xe1, + 0xa1, 0x01, 0x40, 0x20, 0xa3, 0x21, 0x82, 0x21, + 0x00, 0x00, 0x50, 0xe3, 0x23, 0x32, 0xb0, 0x11, + 0x21, 0x12, 0xa0, 0x11, 0xef, 0xff, 0xff, 0x1a, + 0x02, 0x00, 0xa0, 0xe1, 0x0e, 0xf0, 0xa0, 0xe1, + 0x01, 0x00, 0xa0, 0x03, 0x00, 0x00, 0xa0, 0x13, + 0x0e, 0xf0, 0xa0, 0xe1, 0x01, 0x08, 0x51, 0xe3, + 0x21, 0x18, 0xa0, 0x21, 0x10, 0x20, 0xa0, 0x23, + 0x00, 0x20, 0xa0, 0x33, 0x01, 0x0c, 0x51, 0xe3, + 0x21, 0x14, 0xa0, 0x21, 0x08, 0x20, 0x82, 0x22, + 0x10, 0x00, 0x51, 0xe3, 0x21, 0x12, 0xa0, 0x21, + 0x04, 0x20, 0x82, 0x22, 0x04, 0x00, 0x51, 0xe3, + 0x03, 0x20, 0x82, 0x82, 0xa1, 0x20, 0x82, 0x90, + 0x30, 0x02, 0xa0, 0xe1, 0x0e, 0xf0, 0xa0, 0xe1, + 0x04, 0xe0, 0x2d, 0xe5, 0x84, 0x00, 0x00, 0xeb, + 0x00, 0x00, 0xa0, 0xe3, 0x04, 0xf0, 0x9d, 0xe4, + 0x00, 0x00, 0x51, 0xe3, 0x01, 0xc0, 0x20, 0xe0, + 0x42, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x61, 0x42, + 0x01, 0x20, 0x51, 0xe2, 0x27, 0x00, 0x00, 0x0a, + 0x00, 0x30, 0xb0, 0xe1, 0x00, 0x30, 0x60, 0x42, + 0x01, 0x00, 0x53, 0xe1, 0x26, 0x00, 0x00, 0x9a, + 0x02, 0x00, 0x11, 0xe1, 0x28, 0x00, 0x00, 0x0a, + 0x0e, 0x02, 0x11, 0xe3, 0x81, 0x11, 0xa0, 0x01, + 0x08, 0x20, 0xa0, 0x03, 0x01, 0x20, 0xa0, 0x13, + 0x01, 0x02, 0x51, 0xe3, 0x03, 0x00, 0x51, 0x31, + 0x01, 0x12, 0xa0, 0x31, 0x02, 0x22, 0xa0, 0x31, + 0xfa, 0xff, 0xff, 0x3a, 0x02, 0x01, 0x51, 0xe3, + 0x03, 0x00, 0x51, 0x31, 0x81, 0x10, 0xa0, 0x31, + 0x82, 0x20, 0xa0, 0x31, 0xfa, 0xff, 0xff, 0x3a, + 0x00, 0x00, 0xa0, 0xe3, 0x01, 0x00, 0x53, 0xe1, + 0x01, 0x30, 0x43, 0x20, 0x02, 0x00, 0x80, 0x21, + 0xa1, 0x00, 0x53, 0xe1, 0xa1, 0x30, 0x43, 0x20, + 0xa2, 0x00, 0x80, 0x21, 0x21, 0x01, 0x53, 0xe1, + 0x21, 0x31, 0x43, 0x20, 0x22, 0x01, 0x80, 0x21, + 0xa1, 0x01, 0x53, 0xe1, 0xa1, 0x31, 0x43, 0x20, + 0xa2, 0x01, 0x80, 0x21, 0x00, 0x00, 0x53, 0xe3, + 0x22, 0x22, 0xb0, 0x11, 0x21, 0x12, 0xa0, 0x11, + 0xef, 0xff, 0xff, 0x1a, 0x00, 0x00, 0x5c, 0xe3, + 0x00, 0x00, 0x60, 0x42, 0x0e, 0xf0, 0xa0, 0xe1, + 0x00, 0x00, 0x3c, 0xe1, 0x00, 0x00, 0x60, 0x42, + 0x0e, 0xf0, 0xa0, 0xe1, 0x00, 0x00, 0xa0, 0x33, + 0xcc, 0x0f, 0xa0, 0x01, 0x01, 0x00, 0x80, 0x03, + 0x0e, 0xf0, 0xa0, 0xe1, 0x01, 0x08, 0x51, 0xe3, + 0x21, 0x18, 0xa0, 0x21, 0x10, 0x20, 0xa0, 0x23, + 0x00, 0x20, 0xa0, 0x33, 0x01, 0x0c, 0x51, 0xe3, + 0x21, 0x14, 0xa0, 0x21, 0x08, 0x20, 0x82, 0x22, + 0x10, 0x00, 0x51, 0xe3, 0x21, 0x12, 0xa0, 0x21, + 0x04, 0x20, 0x82, 0x22, 0x04, 0x00, 0x51, 0xe3, + 0x03, 0x20, 0x82, 0x82, 0xa1, 0x20, 0x82, 0x90, + 0x00, 0x00, 0x5c, 0xe3, 0x33, 0x02, 0xa0, 0xe1, + 0x00, 0x00, 0x60, 0x42, 0x0e, 0xf0, 0xa0, 0xe1, + 0x04, 0xe0, 0x2d, 0xe5, 0x3a, 0x00, 0x00, 0xeb, + 0x00, 0x00, 0xa0, 0xe3, 0x04, 0xf0, 0x9d, 0xe4, + 0x00, 0x00, 0x51, 0xe3, 0x32, 0x00, 0x00, 0x0a, + 0x00, 0x10, 0x61, 0x42, 0x00, 0xc0, 0xb0, 0xe1, + 0x00, 0x00, 0x60, 0x42, 0x01, 0x20, 0x51, 0xe2, + 0x01, 0x00, 0x50, 0x11, 0x00, 0x00, 0xa0, 0x03, + 0x02, 0x00, 0x11, 0x81, 0x02, 0x00, 0x00, 0x00, + 0x26, 0x00, 0x00, 0x9a, 0x00, 0x20, 0xa0, 0xe3, + 0x01, 0x02, 0x51, 0xe3, 0x00, 0x00, 0x51, 0x31, + 0x01, 0x12, 0xa0, 0x31, 0x04, 0x20, 0x82, 0x32, + 0xfa, 0xff, 0xff, 0x3a, 0x02, 0x01, 0x51, 0xe3, + 0x00, 0x00, 0x51, 0x31, 0x81, 0x10, 0xa0, 0x31, + 0x01, 0x20, 0x82, 0x32, 0xfa, 0xff, 0xff, 0x3a, + 0x03, 0x20, 0x52, 0xe2, 0x0e, 0x00, 0x00, 0xba, + 0x01, 0x00, 0x50, 0xe1, 0x01, 0x00, 0x40, 0x20, + 0xa1, 0x00, 0x50, 0xe1, 0xa1, 0x00, 0x40, 0x20, + 0x21, 0x01, 0x50, 0xe1, 0x21, 0x01, 0x40, 0x20, + 0xa1, 0x01, 0x50, 0xe1, 0xa1, 0x01, 0x40, 0x20, + 0x01, 0x00, 0x50, 0xe3, 0x21, 0x12, 0xa0, 0xe1, + 0x04, 0x20, 0x52, 0xa2, 0xf3, 0xff, 0xff, 0xaa, + 0x03, 0x00, 0x12, 0xe3, 0x00, 0x00, 0x30, 0x13, + 0x0a, 0x00, 0x00, 0x0a, 0x02, 0x00, 0x72, 0xe3, + 0x06, 0x00, 0x00, 0xba, 0x02, 0x00, 0x00, 0x0a, + 0x01, 0x00, 0x50, 0xe1, 0x01, 0x00, 0x40, 0x20, + 0xa1, 0x10, 0xa0, 0xe1, 0x01, 0x00, 0x50, 0xe1, + 0x01, 0x00, 0x40, 0x20, 0xa1, 0x10, 0xa0, 0xe1, + 0x01, 0x00, 0x50, 0xe1, 0x01, 0x00, 0x40, 0x20, + 0x00, 0x00, 0x5c, 0xe3, 0x00, 0x00, 0x60, 0x42, + 0x0e, 0xf0, 0xa0, 0xe1, 0x04, 0xe0, 0x2d, 0xe5, + 0x01, 0x00, 0x00, 0xeb, 0x00, 0x00, 0xa0, 0xe3, + 0x04, 0xf0, 0x9d, 0xe4, 0x0e, 0xf0, 0xa0, 0xe1, + 0x72, 0x62, 0x00, 0x00, 0x53, 0x43, 0x52, 0x53, + 0x00, 0x00, 0x00, 0x00, 0x53, 0x43, 0x52, 0x4d, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x00, 0x00, + 0x2c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0f, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, + 0x1b, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, + 0x23, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, + 0x2a, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, + 0x2f, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, + 0x34, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, + 0x39, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, + 0x3d, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, + 0x41, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, + 0x45, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, + 0x49, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, + 0x4c, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, + 0x4f, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, + 0x52, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, + 0x55, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, + 0x58, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, + 0x5b, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x5e, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, + 0x60, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, + 0x63, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, + 0x66, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, + 0x68, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x00, + 0x6a, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, + 0x6d, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, + 0x6f, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, + 0x71, 0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, + 0x74, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, + 0x76, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, + 0x78, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, + 0x7a, 0x00, 0x00, 0x00, 0x7b, 0x00, 0x00, 0x00, + 0x7c, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, + 0x7e, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, + 0x82, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, + 0x84, 0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, + 0x86, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, + 0x88, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, + 0x8a, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, + 0x8b, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, + 0x8d, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, + 0x8f, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, + 0x91, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, + 0x92, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, + 0x94, 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, + 0x96, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, + 0x98, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, + 0x99, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, + 0x9b, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, + 0x9c, 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, + 0x9e, 0x00, 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, + 0xa0, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, + 0xa1, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, + 0xa3, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, + 0xa4, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, + 0xa6, 0x00, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x00, + 0xa7, 0x00, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, + 0xa9, 0x00, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, + 0xaa, 0x00, 0x00, 0x00, 0xab, 0x00, 0x00, 0x00, + 0xac, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, + 0xad, 0x00, 0x00, 0x00, 0xae, 0x00, 0x00, 0x00, + 0xaf, 0x00, 0x00, 0x00, 0xb0, 0x00, 0x00, 0x00, + 0xb0, 0x00, 0x00, 0x00, 0xb1, 0x00, 0x00, 0x00, + 0xb2, 0x00, 0x00, 0x00, 0xb2, 0x00, 0x00, 0x00, + 0xb3, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, + 0xb5, 0x00, 0x00, 0x00, 0xb5, 0x00, 0x00, 0x00, + 0xb6, 0x00, 0x00, 0x00, 0xb7, 0x00, 0x00, 0x00, + 0xb7, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, + 0xb9, 0x00, 0x00, 0x00, 0xb9, 0x00, 0x00, 0x00, + 0xba, 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, + 0xbb, 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, + 0xbd, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, + 0xbe, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, + 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, + 0xc1, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, + 0xc2, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, + 0xc3, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, + 0xc5, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, + 0xc6, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, + 0xc7, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, + 0xc8, 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, + 0xca, 0x00, 0x00, 0x00, 0xca, 0x00, 0x00, 0x00, + 0xcb, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, + 0xcc, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, + 0xcd, 0x00, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, + 0xcf, 0x00, 0x00, 0x00, 0xcf, 0x00, 0x00, 0x00, + 0xd0, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00, + 0xd1, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, + 0xd2, 0x00, 0x00, 0x00, 0xd3, 0x00, 0x00, 0x00, + 0xd4, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, + 0xd5, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, + 0xd6, 0x00, 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, + 0xd7, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, + 0xd8, 0x00, 0x00, 0x00, 0xd9, 0x00, 0x00, 0x00, + 0xd9, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, + 0xdb, 0x00, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x00, + 0xdc, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, + 0xdd, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, + 0xde, 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, + 0xdf, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, + 0xe0, 0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, + 0xe1, 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, + 0xe3, 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00, + 0xe4, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, + 0xe5, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, + 0xe6, 0x00, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, + 0xe7, 0x00, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, + 0xe8, 0x00, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, + 0xe9, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, + 0xea, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, + 0xeb, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, + 0xec, 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, + 0xed, 0x00, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, + 0xef, 0x00, 0x00, 0x00, 0xef, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0xf1, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, + 0xf2, 0x00, 0x00, 0x00, 0xf2, 0x00, 0x00, 0x00, + 0xf3, 0x00, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, + 0xf4, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, + 0xf5, 0x00, 0x00, 0x00, 0xf5, 0x00, 0x00, 0x00, + 0xf6, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, + 0xf7, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, + 0xf8, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, + 0xf9, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x00, 0x00, + 0xfa, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x00, 0x00, + 0xfb, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x00, 0x00, + 0xfc, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, + 0xfd, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x31, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, + 0x61, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, + 0x8d, 0x00, 0x00, 0x00, 0xa1, 0x00, 0x00, 0x00, + 0xb4, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, + 0xd4, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, + 0xeb, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, + 0xfa, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, + 0xff, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, + 0xfa, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, + 0xeb, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, + 0xd4, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, + 0xb4, 0x00, 0x00, 0x00, 0xa1, 0x00, 0x00, 0x00, + 0x8d, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, + 0x61, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, + 0x31, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe8, 0xff, 0xff, 0xff, + 0xcf, 0xff, 0xff, 0xff, 0xb6, 0xff, 0xff, 0xff, + 0x9f, 0xff, 0xff, 0xff, 0x88, 0xff, 0xff, 0xff, + 0x73, 0xff, 0xff, 0xff, 0x5f, 0xff, 0xff, 0xff, + 0x4c, 0xff, 0xff, 0xff, 0x3b, 0xff, 0xff, 0xff, + 0x2c, 0xff, 0xff, 0xff, 0x20, 0xff, 0xff, 0xff, + 0x15, 0xff, 0xff, 0xff, 0x0c, 0xff, 0xff, 0xff, + 0x06, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, + 0x01, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, + 0x06, 0xff, 0xff, 0xff, 0x0c, 0xff, 0xff, 0xff, + 0x15, 0xff, 0xff, 0xff, 0x20, 0xff, 0xff, 0xff, + 0x2c, 0xff, 0xff, 0xff, 0x3b, 0xff, 0xff, 0xff, + 0x4c, 0xff, 0xff, 0xff, 0x5f, 0xff, 0xff, 0xff, + 0x73, 0xff, 0xff, 0xff, 0x88, 0xff, 0xff, 0xff, + 0x9f, 0xff, 0xff, 0xff, 0xb6, 0xff, 0xff, 0xff, + 0xcf, 0xff, 0xff, 0xff, 0xe8, 0xff, 0xff, 0xff, + 0xd7, 0x1e, 0x00, 0x00, 0x05, 0x1f, 0x00, 0x00, + 0x31, 0x1f, 0x00, 0x00, 0x6e, 0x1f, 0x00, 0x00, + 0xab, 0x1f, 0x00, 0x00, 0xe9, 0x1f, 0x00, 0x00, + 0x28, 0x20, 0x00, 0x00, 0x58, 0x20, 0x00, 0x00, + 0xab, 0x20, 0x00, 0x00, 0xdd, 0x20, 0x00, 0x00, + 0x0f, 0x21, 0x00, 0x00, 0x51, 0x21, 0x00, 0x00, + 0x85, 0x21, 0x00, 0x00, 0xcb, 0x21, 0x00, 0x00, + 0x13, 0x22, 0x00, 0x00, 0x35, 0x22, 0x00, 0x00, + 0xb0, 0x06, 0x00, 0x00, 0x50, 0x06, 0x00, 0x00, + 0xf4, 0x05, 0x00, 0x00, 0xa0, 0x05, 0x00, 0x00, + 0x4c, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, + 0xb8, 0x04, 0x00, 0x00, 0x74, 0x04, 0x00, 0x00, + 0x34, 0x04, 0x00, 0x00, 0xf8, 0x03, 0x00, 0x00, + 0xc0, 0x03, 0x00, 0x00, 0x8a, 0x03, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x04, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, + +}; diff --git a/AICA/SRCS/libs3mplay/libs3mplay/s3mplay/Makefile b/AICA/SRCS/libs3mplay/libs3mplay/s3mplay/Makefile new file mode 100644 index 00000000..68dec9a3 --- /dev/null +++ b/AICA/SRCS/libs3mplay/libs3mplay/s3mplay/Makefile @@ -0,0 +1,18 @@ +#S3MPLAY Makefile (C) PH3NOM 2011 + +all: stream.drv + +stream.drv: prog.elf + $(DC_ARM_OBJCOPY) -O binary prog.elf stream.drv + +prog.elf: crt0.o main.o aica.o s3mplay.o + $(DC_ARM_CC) -Wl,-Ttext,0x00000000 -nostartfiles -nostdlib -e reset -o prog.elf crt0.o main.o aica.o s3mplay.o -lgcc + +%.o: %.c + $(DC_ARM_CC) $(DC_ARM_CFLAGS) $(DC_ARM_INCS) -c $< -o $@ + +%.o: %.s + $(DC_ARM_AS) -mcpu=arm7di -march=armv4 $< -o $@ + +clean: + -rm -f *.o *.srec *.elf prog.bin *.bck \ No newline at end of file diff --git a/AICA/SRCS/libs3mplay/libs3mplay/s3mplay/README b/AICA/SRCS/libs3mplay/libs3mplay/s3mplay/README new file mode 100644 index 00000000..a2c67d2a --- /dev/null +++ b/AICA/SRCS/libs3mplay/libs3mplay/s3mplay/README @@ -0,0 +1,21 @@ +This is the same example included in kos: +kos\examples\dreamcast\2ndmix + +However, the source code for the ARM program was not included, +instead only the compiled header. + +There exists a non-compiling LibS3M: +kos-ports\libs3m + +I have made a new makefile for the ARM code from LibS3M. +2ndmix\s3mplay\Makefile + +This will build the ARM program, stream.drv + +Use the custom version of 'bin2c' I have included +2ndmix\s3mplay\bin2c + +to convert the stream.drv into s3mplay.h with this command: +bin2c stream.drv s3mplay.h s3mplay + +-PH3NOM 2011 \ No newline at end of file diff --git a/AICA/SRCS/libs3mplay/libs3mplay/s3mplay/aica.c b/AICA/SRCS/libs3mplay/libs3mplay/s3mplay/aica.c new file mode 100644 index 00000000..dc82a954 --- /dev/null +++ b/AICA/SRCS/libs3mplay/libs3mplay/s3mplay/aica.c @@ -0,0 +1,235 @@ +/* This file is part of the Dreamcast function library. + * Please see libdream.c for further details. + * + * (c)2000 Dan Potter + */ + +/* volatile unsigned char *dc_snd_base = (unsigned char *)0x00800000; */ +#define dc_snd_base ((volatile unsigned char *)0x00800000) + +/* Some convienence macros */ +#define SNDREG32A(x) ((volatile unsigned long *)(dc_snd_base + (x))) +#define SNDREG32(x) (*SNDREG32A(x)) +#define SNDREG8A(x) (dc_snd_base + (x)) +#define SNDREG8(x) (*SNDREG8A(x)) +#define CHNREG32A(chn, x) SNDREG32A(0x80*(chn) + (x)) +#define CHNREG32(chn, x) (*CHNREG32A(chn, x)) +#define CHNREG8A(chn, x) SNDREG8A(0x80*(chn) + (x)) +#define CHNREG8(chn, x) (*CHNREG8A(chn, x)) + +void aica_init() { + int i, j; + + /* Initialize AICA channels */ + SNDREG32(0x2800) = 0x0000; + + for (i=0; i<64; i++) { + for (j=0; j<0x80; j+=4) + CHNREG32(i, j) = 0; + CHNREG32(i,0) = 0x8000; + CHNREG32(i,20) = 0x1f; + } + + SNDREG32(0x2800) = 0x000f; +} + +/* Translates a volume from linear form to logarithmic form (required by + the AICA chip */ +/* int logs[] = { + +0, 40, 50, 58, 63, 68, 73, 77, 80, 83, 86, 89, 92, 94, 97, 99, 101, 103, +105, 107, 109, 111, 112, 114, 116, 117, 119, 120, 122, 123, 125, 126, 127, +129, 130, 131, 133, 134, 135, 136, 137, 139, 140, 141, 142, 143, 144, 145, +146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 156, 157, 158, 159, +160, 161, 162, 162, 163, 164, 165, 166, 166, 167, 168, 169, 170, 170, 171, +172, 172, 173, 174, 175, 175, 176, 177, 177, 178, 179, 180, 180, 181, 182, +182, 183, 183, 184, 185, 185, 186, 187, 187, 188, 188, 189, 190, 190, 191, +191, 192, 193, 193, 194, 194, 195, 196, 196, 197, 197, 198, 198, 199, 199, +200, 201, 201, 202, 202, 203, 203, 204, 204, 205, 205, 206, 206, 207, 207, +208, 208, 209, 209, 210, 210, 211, 211, 212, 212, 213, 213, 214, 214, 215, +215, 216, 216, 217, 217, 217, 218, 218, 219, 219, 220, 220, 221, 221, 222, +222, 222, 223, 223, 224, 224, 225, 225, 225, 226, 226, 227, 227, 228, 228, +228, 229, 229, 230, 230, 230, 231, 231, 232, 232, 232, 233, 233, 234, 234, +234, 235, 235, 236, 236, 236, 237, 237, 238, 238, 238, 239, 239, 240, 240, +240, 241, 241, 241, 242, 242, 243, 243, 243, 244, 244, 244, 245, 245, 245, +246, 246, 247, 247, 247, 248, 248, 248, 249, 249, 249, 250, 250, 250, 251, +251, 251, 252, 252, 252, 253, 253, 253, 254, 254, 254, 255 + +}; */ + +int logs[] = { + 0, 15, 22, 27, 31, 35, 39, 42, 45, 47, 50, 52, 55, 57, 59, 61, + 63, 65, 67, 69, 71, 73, 74, 76, 78, 79, 81, 82, 84, 85, 87, 88, + 90, 91, 92, 94, 95, 96, 98, 99, 100, 102, 103, 104, 105, 106, + 108, 109, 110, 111, 112, 113, 114, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 146, 147, 148, 149, 150, 151, 152, 152, 153, 154, 155, 156, 156, + 157, 158, 159, 160, 160, 161, 162, 163, 164, 164, 165, 166, 167, + 167, 168, 169, 170, 170, 171, 172, 173, 173, 174, 175, 176, 176, + 177, 178, 178, 179, 180, 181, 181, 182, 183, 183, 184, 185, 185, + 186, 187, 187, 188, 189, 189, 190, 191, 191, 192, 193, 193, 194, + 195, 195, 196, 197, 197, 198, 199, 199, 200, 200, 201, 202, 202, + 203, 204, 204, 205, 205, 206, 207, 207, 208, 209, 209, 210, 210, + 211, 212, 212, 213, 213, 214, 215, 215, 216, 216, 217, 217, 218, + 219, 219, 220, 220, 221, 221, 222, 223, 223, 224, 224, 225, 225, + 226, 227, 227, 228, 228, 229, 229, 230, 230, 231, 232, 232, 233, + 233, 234, 234, 235, 235, 236, 236, 237, 237, 238, 239, 239, 240, + 240, 241, 241, 242, 242, 243, 243, 244, 244, 245, 245, 246, 246, + 247, 247, 248, 248, 249, 249, 250, 250, 251, 251, 252, 252, 253, 254 +}; +int vol_to_log(int vol) { +/* vol = 0xff - (vol & 0xff); */ +/* vol = 0xff - logs[vol & 0xff]; */ +/* vol = 128 - ((vol & 0xff) / 2); */ + vol = 0xff - logs[128 + ((vol & 0xff) / 2)]; + return vol; +} + +/* Stop the sound on a given channel */ +void aica_stop(int ch) { + CHNREG32(ch, 0) = (CHNREG32(ch, 0) & ~0x4000) | 0x8000; +} + + +/* Sets up a sound channel completely. This is generally good if you want + a quick and dirty way to play notes. If you want a more comprehensive + set of routines (more like PC wavetable cards) see below. + + ch is the channel to play on (0 - 63) + smpptr is the pointer to the sound data; if you're running off the + SH4, then this ought to be (ptr - 0xa0800000); otherwise it's just + ptr. Basically, it's an offset into sound ram. + mode is one of the mode constants (16 bit, 8 bit, ADPCM) + nsamp is the number of samples to play (not number of bytes!) + freq is the sampling rate of the sound + vol is the volume, 0 to 0xff (0xff is louder) + pan is a panning constant -- 0 is left, 128 is center, 255 is right. + + This routine (and the similar ones) owe a lot to Marcus' sound example -- + I hadn't gotten quite this far into dissecting the individual regs yet. */ +void aica_play(int ch, unsigned long smpptr, int mode, int loopst, int loopend, + int freq, int vol, int pan, int loopflag) { + unsigned long freq_lo, freq_base = 5644800; + int freq_hi = 7; + int i, j; + + /* Stop the channel (if it's already playing) */ + /*for (i=CHNREG8(ch, 41); i<=0xff; i++) { + CHNREG8(ch, 41) = i; + } */ + aica_stop(ch); + for (i=0; i<256; i++) { + asm("nop"); + asm("nop"); + asm("nop"); + asm("nop"); + } + + /* Convert the incoming volume and pan into hardware values */ + vol = vol_to_log(vol); + + /* For the moment this is going to have to suffice, until we really + figure out what these mean. */ + if (pan == 0x80) + pan = 0; + else if (pan < 0x80) + pan = 0x1f; + else + pan = 0xf; + + /* Envelope setup. The first of these is the loop point, + e.g., where the sample starts over when it loops. The second + is the loop end. This is the full length of the sample when + you are not looping, or the loop end point when you are (though + storing more than that is a waste of memory if you're not doing + volume enveloping). */ + CHNREG32(ch, 8) = loopst & 0xffff; + CHNREG32(ch, 12) = loopend & 0xffff; + + /* Need to convert frequency to floating point format + (freq_hi is exponent, freq_lo is mantissa) + Formula is ferq = 44100*2^freq_hi*(1+freq_lo/1024) */ + while (freq < freq_base && freq_hi > -8) { + freq_base >>= 1; + --freq_hi; + } + freq_lo = (freq<<10) / freq_base; + + /* Write resulting values */ + CHNREG32(ch, 24) = (freq_hi << 11) | (freq_lo & 1023); + + /* Set volume, pan, and some other things that we don't know what + they do =) */ + CHNREG8(ch, 36) = pan; + CHNREG8(ch, 37) = 0xf; + CHNREG8(ch, 40) = 0x24; + CHNREG8(ch, 41) = vol; /* Vol starts at zero so we can ramp */ + + /* If we supported volume envelopes (which we don't yet) then + this value would set that up. The top 4 bits determine the + envelope speed. f is the fastest, 1 is the slowest, and 0 + seems to be an invalid value and does weird things). The + default (below) sets it into normal mode (play and terminate/loop). + CHNREG32(ch, 16) = 0xf010; + */ + CHNREG32(ch, 16) = 0x1f; /* No volume envelope */ + + + /* Set sample format, buffer address, and looping control. If + 0x0200 mask is set on reg 0, the sample loops infinitely. If + it's not set, the sample plays once and terminates. We'll + also set the bits to start playback here. */ + CHNREG32(ch, 4) = smpptr & 0xffff; + if (loopflag) + CHNREG32(ch, 0) = 0xc000 | 0x0200 | (mode<<7) | (smpptr >> 16); /* Loops */ + else + CHNREG32(ch, 0) = 0xc000 | 0x0000 | (mode<<7) | (smpptr >> 16); /* No loop */ + + + /* Enable playback */ + /* CHNREG32(ch, 0) |= 0xc000; */ + + /*for (i=0xff; i>=vol; i--) + CHNREG8(ch, 41) = i; */ +} + +/* Stop the sound on a given channel +void aica_stop(int ch) { + CHNREG32(ch, 0) = (CHNREG32(ch, 0) & ~0x4000) | 0x8000; +}*/ + + +/* The rest of these routines can change the channel in mid-stride so you + can do things like vibrato and panning effects. */ + +/* Set channel volume */ +void aica_vol(int ch, int vol) { + vol = vol_to_log(vol); + CHNREG8(ch, 41) = vol; +} + +/* Set channel pan */ +void aica_pan(int ch, int pan) { + if (pan == 0x80) + pan = 0; + else if (pan < 0x80) + pan = 0x1f; + else + pan = 0xf; + CHNREG8(ch, 36) = pan; +} + +/* Set channel frequency */ +void aica_freq(int ch, int freq) { + unsigned long freq_lo, freq_base = 5644800; + int freq_hi = 7; + + while (freq < freq_base && freq_hi > -8) { + freq_base >>= 1; + freq_hi--; + } + freq_lo = (freq<<10) / freq_base; + CHNREG32(ch, 24) = (freq_hi << 11) | (freq_lo & 1023); +} + diff --git a/AICA/SRCS/libs3mplay/libs3mplay/s3mplay/bin2c/bin2c.bat b/AICA/SRCS/libs3mplay/libs3mplay/s3mplay/bin2c/bin2c.bat new file mode 100644 index 00000000..fd439b50 --- /dev/null +++ b/AICA/SRCS/libs3mplay/libs3mplay/s3mplay/bin2c/bin2c.bat @@ -0,0 +1,4 @@ +bin2c stream.drv s3mplay.h s3mplay +pause + + diff --git a/AICA/SRCS/libs3mplay/libs3mplay/s3mplay/bin2c/bin2c.c b/AICA/SRCS/libs3mplay/libs3mplay/s3mplay/bin2c/bin2c.c new file mode 100644 index 00000000..98e1ce59 --- /dev/null +++ b/AICA/SRCS/libs3mplay/libs3mplay/s3mplay/bin2c/bin2c.c @@ -0,0 +1,62 @@ +/* Converts a binary file into a C integer array (for inclusion in + a source file) + + (c)2000 Dan Potter + + $Id: bin2c.c,v 1.2 2002/12/17 15:55:00 gilm Exp $ +*/ + +#include + +void convert(char *ifn, char *ofn, char *prefix) { + FILE *i, *o; + unsigned char buffer[2048]; + int red, left, lc, q; + char buf[BUFSIZ]; + + i = fopen(ifn, "rb"); + o = fopen(ofn, "w"); + if (!i || !o) { + printf("error: can't open input or output file\n"); + return; + } + + fseek(i, 0, SEEK_END); left = ftell(i); fseek(i, 0, SEEK_SET); + setbuf(o, buf); + + //fprintf(o, "const int %s_size = %d\n", prefix, left); + fprintf(o, "const unsigned char %s[] =", prefix); + fprintf(o, "{\n\t"); + + lc = 0; + while(left > 0) { + red = fread(buffer, 1, 2048, i); + left -= red; + for (q=0; q= 8) { + lc = 0; + fprintf(o, "\n\t"); + } + } + } + + fprintf(o, "\n};\n"); + fclose(i); fclose(o); +} + +int main(int argc, char **argv) { + + char *prefix; + + argc--; + if (argc != 2 && argc != 3) { + printf("usage: bin2c [prefix]\n"); + return 0; + } + + prefix = (argc == 3) ? argv[3] : "file"; + convert(argv[1], argv[2], prefix); + return 0; +} + diff --git a/AICA/SRCS/libs3mplay/libs3mplay/s3mplay/bin2c/bin2c.exe b/AICA/SRCS/libs3mplay/libs3mplay/s3mplay/bin2c/bin2c.exe new file mode 100644 index 00000000..c4f1a939 Binary files /dev/null and b/AICA/SRCS/libs3mplay/libs3mplay/s3mplay/bin2c/bin2c.exe differ diff --git a/AICA/SRCS/libs3mplay/libs3mplay/s3mplay/crt0.s b/AICA/SRCS/libs3mplay/libs3mplay/s3mplay/crt0.s new file mode 100644 index 00000000..2a8b45ff --- /dev/null +++ b/AICA/SRCS/libs3mplay/libs3mplay/s3mplay/crt0.s @@ -0,0 +1,102 @@ +# Adapted from Marcus' AICA example among a few other sources =) + +.text +.globl arm_main +.globl timer +.globl jps + +# Exception vectors + b start + b undef + b softint + b pref_abort + b data_abort + b rsrvd + b irq + + +# FIQ code adapted from the Marcus AICA example +fiq: + # Save regs + #stmdb sp!, {r0-r14} + + # Grab interrupt type (store as parameter) + ldr r8,intreq + ldr r9,[r8] + and r9,r9,#7 + cmp r9,#2 + bne fiq_done + + # Type 2 is timer interrupt. Increment timer variable. + adr r8,timer + ldr r9,[r8] + add r9,r9,#1 + str r9,[r8] + + # Request a new timer interrupt. We'll calculate the number + # put in here based on the "jps" (jiffies per second). + ldr r8, timer_control + mov r9,#256-(44100/4410) +# ldr r9,jps + str r9,[r8,#0x10] + mov r9,#0x40 + str r9,[r8,#0x24] + b fiq_done + + # Return from interrupt +fiq_done: + + # Clear interrupt + ldr r8,intclr + mov r9,#1 + str r9,[r8] + str r9,[r8] + str r9,[r8] + str r9,[r8] + + # Restore regs and return + #ldmdb sp!, {r0-r14} + subs pc,r14,#4 + +intreq: + .long 0x00802d00 +intclr: + .long 0x00802d04 +timer_control: + .long 0x00802880 +timer: + .long 0 +jps: + .long 256-(44100/1000) + + +start: + # Setup a basic stack, disable IRQ, enable FIQ + mov sp,#0xb000 + mrs r10,CPSR + orr r10,r10,#0x80 + bic r10,r10,#0x40 + msr CPSR_all,r10 + + # Call the main for the SPU + bl arm_main + + # Loop infinitely if we get here +here: b here + + +# Handlers we don't bother to catch +undef: +softint: + mov pc,r14 +pref_abort: +data_abort: +irq: +rsrvd: + sub pc,r14,#4 + + + + + + diff --git a/AICA/SRCS/libs3mplay/libs3mplay/s3mplay/main.c b/AICA/SRCS/libs3mplay/libs3mplay/s3mplay/main.c new file mode 100644 index 00000000..b40bc9de --- /dev/null +++ b/AICA/SRCS/libs3mplay/libs3mplay/s3mplay/main.c @@ -0,0 +1,64 @@ +/* Small S3M player written as AICA firmware + * + * (c)2000 Dan Potter + * + * Notes on using: + * + * To use this player, you just need to load your S3M into sound RAM + * at 0x10000, and then load this program into the ARM CPU. This program + * will then parse the S3M into samples and tracks, etc, and start + * playing it. To stop the playback, use dc_snd_stop_arm() in libdream. + */ + +/****************** Timer *******************************************/ + +extern volatile int timer; + +void timer_wait(int jiffies) { + int fin = timer + jiffies; + while (timer <= fin) + ; +} + +/****************** Main Program ************************************/ + +volatile unsigned long *s3mwait = (unsigned long*)0x1002c; +volatile unsigned long *debug = (unsigned long*)0xffc0; + +int arm_main() { + /* Mono flag */ + debug[1] = 0; + + /* External interface hack */ + debug[2] = 0; + + *debug = 1; + + /* Check to see that there's an S3M waiting */ + /*while (*s3mwait != 0x77826783) { + int i; + volatile unsigned long *tmp = (unsigned long *)0; + for (i=0; i<5000; i++) { *tmp; } + } */ + + *debug = 2; + + /* Initialize the AICA part of the SPU */ + aica_init(); + + *debug = 3; + + /* Load the S3M */ + s3m_load(); + + *debug = 4; + + /* Start playback */ + s3m_start_playback(); +} + + + + + + diff --git a/AICA/SRCS/libs3mplay/libs3mplay/s3mplay/s3mplay.c b/AICA/SRCS/libs3mplay/libs3mplay/s3mplay/s3mplay.c new file mode 100644 index 00000000..972a4e47 --- /dev/null +++ b/AICA/SRCS/libs3mplay/libs3mplay/s3mplay/s3mplay.c @@ -0,0 +1,852 @@ +/* #include */ + +extern volatile unsigned long *debug; + +/* Cheapo filesystem / malloc replacements */ + +#define NULL 0 +typedef int FILE; +unsigned char *file_data = (unsigned char *)0x10000; +int where_in_file; + +FILE *fs_open(char *fn, char *mode) { + where_in_file = 0; + return (FILE*)1; +} + +void fs_close(FILE *f) { } + +int fs_read(void *buffer, int size, int cnt, FILE *f) { + unsigned char *outbuf = (unsigned char*)buffer; + int i; + for (i=0; i 0) { + *dest++ = *src++; + len--; + } +} + +void memset(char *dest, int what, int len) { + while (len > 0) { + *dest++ = what; + len--; + } +} + +int strcmp(char *one, char *two) { + while (*one != 0 && *two != 0) { + if (*one != *two) + return -1; + one++; two++; + } + return 0; +} + +/*********************************************************/ +/* From here on down is my old S3M player with as few mods as possible + to get it to run. If it looks like weird crusty code, well, that's + because it is -- it's about 6-7 years old! =) I wrote this thing + back when I was into PC demos. */ + + +#define USECHANS 16 +#define VOLDIV 4 + +// ================================================================ LOADER PART +typedef struct { + char *data; + char *patch; + int length; + int loopbeg; + int loopend; + int vol; + int flags; + int c4spd; + char smpname[32]; +} InsStr; +#define FLAG_LOOP (1 << 0) + +typedef struct { + int size; + char *data; +} PatStr; + +PatStr Pattern[256] = { {0,0} }; +char order[256]; +char loopto; +char SongName[40]; +char Balance[16]; +InsStr Instr[100]; +int NumSamps = 0; +int NumOrd = 0; +int NumPats = 0; +int Speed = 6, Tempo = 0x7d; +short paraptn[256]; +FILE *f; + +static int ReadS3MPat(int p) { + int q, sz = 0, row = 0, ch, bp; + char ci, *buf; + +// fs_seek(f,paraptn[p]*16L,SEEK_SET); + fs_read(&sz, 2, 1, f); + if (sz % 16) + sz = ((sz & 0xFFF0) + 0x10); + sz -= 2; + buf = (char*)malloc(sz); + if (!buf) + return 0; + fs_read(buf, sz, 1, f); + + Pattern[p].size = 5 * 32 * 64; + Pattern[p].data = (char*)malloc(Pattern[p].size); + if (!Pattern[p].data) + return 0; + + for (q = 0; q < 32 * 64 * 5; q += 5) { + Pattern[p].data[q] = 0xff; + Pattern[p].data[q + 1] = 0; + Pattern[p].data[q + 2] = 0xff; + Pattern[p].data[q + 3] = 0xff; + Pattern[p].data[q + 4] = 0; + } + + for (bp = 0; bp < sz && row < 64;) { + ci = buf[bp++]; + if (!ci) + row++; + else { + ch = ci & 31; + if (ci & 32) { + Pattern[p].data[(row * 32 + ch) * 5] = + buf[bp++]; // note+ins + Pattern[p].data[(row * 32 + ch) * 5 + 1] = + buf[bp++]; + } + if (ci & 64) { + Pattern[p].data[(row * 32 + ch) * 5 + 2] = + buf[bp++]; // vol + } + if (ci & 128) { + Pattern[p].data[(row * 32 + ch) * 5 + 3] = + buf[bp++]; // command + Pattern[p].data[(row * 32 + ch) * 5 + 4] = + buf[bp++]; // info + } + } + q = q; + } + free(buf); + + return 1; +} + +// Flags: +1=loop, +2=stereo ni, +4=16 bit (intel) +static int ReadS3MSmp(int q, char Signed) { + int i; + + Instr[q].patch = fs_tell_ram(NULL); + fs_seek(NULL, Instr[q].length, SEEK_CUR); + if (Instr[q].length && !Signed) { + for (i=0; i 63) + Instr[q].vol = 63; + fs_getc(f); + if (fs_getc(f)) + return 0; // ADPCM packed + Instr[q].flags = fs_getc(f); + fs_read(&Instr[q].c4spd, 4, 1, f); + fs_seek(f, 4 * 3, SEEK_CUR); + fs_read(Instr[q].smpname, 28, 1, f); + Instr[q].smpname[27] = 0; + fs_read(magic, 4, 1, f); +// if (strcmp(magic,"SCRS")) return 0; + return 1; +} + +int s3m_load() { + char Magic1[] = "SCRM"; + int q = 0; + char Signed; + char Chnset[32]; + short parains[256]; + + f = fs_open("", "rb"); + if (!f) + return 0; + +// ******************************************** Read header + fs_read(SongName, 28, 1, f); + fs_getc(f); // \x1a + if (fs_getc(f) != 0x10) { + fs_close(f); + return 0; + } + fs_getc(f); + fs_getc(f); // dummies + fs_read(&NumOrd, 2, 1, f); + fs_read(&NumSamps, 2, 1, f); + fs_read(&NumPats, 2, 1, f); + fs_getc(f); + fs_getc(f); // song flags + fs_getc(f); + fs_getc(f); // tracker version + Signed = fs_getc(f); + if (Signed == 2) + Signed = 0; + fs_getc(f); // dummy + fs_read(Magic1, 4, 1, f); + if (strcmp(Magic1, "SCRM")) { + fs_close(f); + return 0; + } + S_SysVol = fs_getc(f) * 4 / VOLDIV; + Speed = fs_getc(f); + Tempo = fs_getc(f); + fs_seek(f, 13, SEEK_CUR); + fs_read(Chnset, 32, 1, f); + for (q = 0; q < 16; q++) + Balance[q] = Chnset[q] & 0x7f; + fs_read(order, NumOrd, 1, f); + fs_read(parains, 2 * NumSamps, 1, f); + fs_read(paraptn, 2 * NumPats, 1, f); + + q = fs_tell(f); + if (q % 16) { + q = ((q & 0xFFF0) + 0x10); + fs_seek(f, q, SEEK_SET); + } +// ******************************************** Read instruments + for (q = 0; q < NumSamps; q++) { + fs_seek(f, parains[q] * 16L, SEEK_SET); + if (!ReadS3MIns(q)) { + fs_close(f); + return 0; + } + } + +// ******************************************** Read patterns + for (q = 0; q < NumPats; q++) { + fs_seek(f, paraptn[q] * 16L, SEEK_SET); + if (!ReadS3MPat(q)) { + fs_close(f); + return 0; + } + } + +// ******************************************** Read samples + for (q = 0; q < NumSamps; q++) + if (!ReadS3MSmp(q, Signed)) { + fs_close(f); + return 0; + } + + return 1; +} + +// ================================================================ PLAYER PART + +int CurPattern, EditRow, CurOrder; +char *ptn; +int TPS, Frame = 0, CCnt = 4, patbrk = -1, ordbrk = -1; +#define cs ((EditRow*32+q)*5) +int period[12] = { 1712, 1616, 1524, 1440, 1356, 1280, 1208, 1140, 1076, 1016, 960, 906 }; +int finec4[16] = { 7895, 7941, 7985, 8046, 8107, 8169, 8232, 8280, 8363, 8413, 8463, + 8529, 8581, 8651, 8723, 8757 }; + +#define HZ(q) (14317456/(q)) +int VibTable[64] = { + 0, 24, 49, 74, 97, 120, 141, 161, + 180, 197, 212, 224, 235, 244, 250, 253, + 255, 253, 250, 244, 235, 224, 212, 197, + 180, 161, 141, 120, 97, 74, 49, 24, + + 0, -24, -49, -74, -97, -120, -141, -161, + -180, -197, -212, -224, -235, -244, -250, -253, + -255, -253, -250, -244, -235, -224, -212, -197, + -180, -161, -141, -120, -97, -74, -49, -24 +}; + +static int fTPS(int x) { + return x * 50 * 4 / 125; +} + +static void Neushorter(int nc) { + CurOrder = nc; + if ((unsigned char)order[CurOrder] == 0xFE) + CurOrder++; + if ((unsigned char)order[CurOrder] == 0xFF) + CurOrder = 0; + CurPattern = order[CurOrder]; + ptn = Pattern[CurPattern].data; + EditRow = 0; +} + +static int s3mfreq(int note, int c4) { + int f; + + if (c4) + c4++; + f = ((8363 * 16 * period[note & 0xF]) >> (note >> 4)) / c4; + if (!f) + f++; + return f; +} + +#define effc(q) ((q)-'A'+1) + +typedef struct { + int patch; // 'current' status + int freq; + int vol; + int kick, start; + int pan; + + int eff, dat, note; // status 'to be' and update counters + int portspeed; + int vpspeed; + int tfreq; + int vibpos; + int vibspd; + int vibdepth; +} chnststr; + +chnststr chnstat[32]; + +static void DoNote(char *p, chnststr * stat) { + char d = p[0], b = p[1]; + + stat->eff = p[3]; + stat->dat = p[4]; + + if (b) { + b--; + stat->patch = (int)b; + stat->vol = Instr[(int)b].vol; + } + b = stat->patch; + + if ((unsigned char)p[2] != 0xFF) + stat->vol = p[2]; + + if ((unsigned char)d != 0xFF) { + stat->note = d; + if (d) + stat->tfreq = s3mfreq(d, Instr[(int)b].c4spd); + + if (stat->eff == effc('G')) + return; + stat->freq = stat->tfreq; + stat->kick = 1; + stat->start = 0; + } +} + +static void DoVib(chnststr * stat) { + int temp; + + temp = VibTable[(stat->vibpos >> 2) & 0x3f]; + temp *= stat->vibdepth; + temp >>= 7; + stat->freq = stat->tfreq + temp * 2; + stat->vibpos += stat->vibspd; +} + +static void DoVSld(chnststr * stat) { + if ((stat->dat & 0x0F) == 0x0F && (stat->dat & 0xF0)) { // FineVol up + stat->vpspeed = stat->dat >> 4; + stat->vol += stat->vpspeed; + if (stat->vol > 63) + stat->vol = 63; + stat->eff = 0xFF; + return; + } + if ((stat->dat & 0xF0) == 0xF0) { // FineVol dn + if (stat->dat & 0xF) + stat->vpspeed = stat->dat & 0xF; + stat->vol -= stat->vpspeed; + if (stat->vol < 0) + stat->vol = 0; + stat->eff = 0xFF; + return; + } + if (!(stat->dat & 0xF0)) { // Volport dn + if (stat->dat & 0xF) + stat->vpspeed = stat->dat & 0xF; + stat->vol -= stat->vpspeed; + if (stat->vol < 0) + stat->vol = 0; + return; + } + if (!(stat->dat & 0x0F)) { // Volport up + if (stat->dat >> 4) + stat->vpspeed = stat->dat >> 4; + stat->vol += stat->vpspeed; + if (stat->vol > 63) + stat->vol = 63; + return; + } +} + +static int DoPort(chnststr * stat) { + if (stat->freq < stat->tfreq) { + stat->freq += stat->portspeed; + if (stat->freq >= stat->tfreq) { + stat->freq = stat->tfreq; + return 1; + } + return 0; + } + if (stat->freq > stat->tfreq) { + stat->freq -= stat->portspeed; + if (stat->freq <= stat->tfreq) { + stat->freq = stat->tfreq; + return 1; + } + return 0; + } + return 1; +} + +static void DoEffects(chnststr * stat) { + int eff, dat, p, f; + + eff = stat->eff; + dat = stat->dat; + if (eff == 0xFF) + return; + switch (eff) { + case effc('A'): // Set Speed + Speed = dat; + break; + case effc('B'): // Jump to new order + ordbrk = dat; + patbrk = 0; + break; + case effc('C'): // Jump to next pattern + patbrk = dat; + break; + case effc('D'): // Volslds + stat->eff = eff; + stat->dat = dat; + DoVSld(stat); + eff = stat->eff; + dat = stat->dat; + break; + case effc('E'): // Pitchsld down + switch (dat & 0xF0) { + case 0xF0: // FineSld down + if (dat & 0xF) { + stat->portspeed = (dat & 0xF) * 4; + stat->freq += stat->portspeed; + } + eff = 0xFF; + break; + case 0xE0: // ExFineSld down + if (dat & 0xF) { + stat->portspeed = (dat & 0xF); + stat->freq += stat->portspeed; + } + eff = 0xFF; + break; + default: // port dn + if (dat) + stat->portspeed = dat * 4; + stat->freq += stat->portspeed; + break; + } + break; + case effc('F'): // Pitchsld up + switch (dat & 0xF0) { + case 0xF0: // FineSld up + if (dat & 0xF) { + stat->portspeed = (dat & 0xF) * 4; + stat->freq -= stat->portspeed; + } + eff = 0xFF; + break; + case 0xE0: // ExFineSld up + if (dat & 0xF) { + stat->portspeed = (dat & 0xF); + stat->freq -= stat->portspeed; + } + eff = 0xFF; + break; + default: // port up + if (dat) + stat->portspeed = dat * 4; + stat->freq -= stat->portspeed; + break; + } + break; + case effc('G'): // noteport + if (dat) + stat->portspeed = dat * 4; + if (DoPort(stat)) { + eff = 0xFF; + dat = stat->dat; + } + break; + case effc('H'): // vibrato + if (dat & 0x0F) + stat->vibdepth = (dat & 0x0F); + if (dat & 0xF0) + stat->vibspd = (dat & 0xF0) >> 2; + dat = 0; + DoVib(stat); + break; + case effc('I'): + break; + case effc('J'): + break; + case effc('K'): + stat->eff = eff; + stat->dat = dat; + DoVib(stat); + DoVSld(stat); + eff = stat->eff; + dat = stat->dat; + break; + case effc('L'): + stat->eff = eff; + stat->dat = dat; + DoPort(stat); + DoVSld(stat); + eff = stat->eff; + dat = stat->dat; + break; + case effc('O'): + stat->start = dat * 256; + eff = 0xFF; + break; + case effc('Q'): + switch (eff >> 4) { // process the volume part of the cmd + case 1: + stat->vol--; + break; + case 2: + stat->vol -= 2; + break; + case 3: + stat->vol -= 4; + break; + case 4: + stat->vol -= 8; + break; + case 5: + stat->vol -= 16; + break; + case 6: + stat->vol = stat->vol * 2 / 3; + break; + case 7: + stat->vol /= 2; + break; + case 9: + stat->vol++; + break; + case 0xA: + stat->vol += 2; + break; + case 0xB: + stat->vol += 4; + break; + case 0xC: + stat->vol += 8; + break; + case 0xD: + stat->vol += 16; + break; + case 0xE: + stat->vol = stat->vol * 3 / 2; + break; + case 0xF: + stat->vol = stat->vol * 2; + break; + } + if (!(Frame % eff)) { + stat->kick = 1; + stat->start = 0; + } + break; + case effc('R'): + break; + case effc('S'): + switch (dat & 0xF0) { + case 0x20: + p = stat->patch; + f = stat->freq * Instr[p].c4spd; + stat->freq = f / finec4[dat & 0xF]; + break; + case 0x80: + stat->pan = dat & 0xF; + break; + case 0xC0: + if (Frame == (dat & 0xF)) { + stat->vol = 0; + eff = 0xFF; + } + break; + case 0xD0: + if (Frame == (dat & 0xF)) { + stat->kick = 1; + stat->start = 0; + eff = 0xFF; + } + break; + } + break; + case effc('T'): + Tempo = dat; + break; + case effc('V'): + S_SysVol = dat * 4 / VOLDIV; + break; + case effc('X'): + /* XHandler(dat); */ + eff = 0xFF; + break; + } + stat->eff = eff; + stat->dat = dat; +} + +static void UpdatePlay() { + int q; + int loopst, loopend, loopflag, pan; + unsigned long start; + + for (q = 0; q < USECHANS; q++) { + if (!chnstat[q].freq) + chnstat[q].freq++; + if (chnstat[q].kick) { + if (Instr[chnstat[q].patch].flags & FLAG_LOOP) { + //loopst = chnstat[q].start; + loopst = Instr[chnstat[q].patch].loopbeg; + loopend = Instr[chnstat[q].patch].loopend; + start = (unsigned long)Instr[chnstat[q].patch].patch; + loopflag = 1; + } else { + loopst = 0; + loopend = Instr[chnstat[q].patch].length; + start = (unsigned long)Instr[chnstat[q].patch].patch; + /*loopend = Instr[chnstat[q].patch].loopend + - chnstat[q].start; + start = (unsigned long)Instr[chnstat[q].patch].patch + + chnstat[q].start; */ + loopflag = 0; + } + + if (debug[1]) + pan = 0x80; + else + pan = chnstat[q].pan * 16; + aica_play(q, start, 1 /*SM_8BIT*/, loopst, loopend, + HZ(chnstat[q].freq), chnstat[q].vol * 14 / 4, + pan, loopflag); + //debug[q] = 0xff; + chnstat[q].kick = 0; + } else { + aica_vol(q, chnstat[q].vol * 14 / 4); + aica_freq(q, HZ(chnstat[q].freq)); + if (!debug[1]) + aica_pan(q, chnstat[q].pan * 16); + } + + TPS = fTPS(Tempo); + } +} + +/* cruftus hackus maximus */ +void check_smp_iface() { + static int channel = USECHANS; + int where, size, hz; + switch(debug[2]) { + case 0: return; + case 1: /* Play sound effect */ + where = debug[3]; + size = debug[4]; + hz = debug[5]; + aica_stop(channel); + aica_play(channel, where, 0 /* SM_16BIT */, 0, size, + hz, 0xe0, 0x80, 0); + channel++; + if (channel >= 64) channel = USECHANS; + break; + } + debug[2] = 0; +} + +void PlayInt() { + int q; + + check_smp_iface(); + + CCnt--; + if (CCnt) return; + //CCnt=4; + CCnt=3; + +// Stuff that needs to be executed once per frame goes here + for (q = 0; q < USECHANS; q++) + DoEffects(&chnstat[q]); + +// Actually do all the output to the soundcard + UpdatePlay(); + +// Next count off frames + Frame++; + if (Frame < Speed) + return; + Frame = 0; + +// Stuff that needs to be executed once per row goes here + if (patbrk != -1) { + Neushorter(CurOrder + 1); + EditRow = patbrk; + patbrk = -1; + } else { + if (EditRow == 64) { + if (ordbrk != -1) + Neushorter(ordbrk); + else + Neushorter(CurOrder + 1); + ordbrk = -1; + } + } + + for (q = 0; q < USECHANS; q++) + DoNote(ptn + cs, &chnstat[q]); + EditRow++; + UpdatePlay(); +} + + +extern unsigned int jps; + +void s3m_start_playback() { + int q; + int lasttps = -1; + + memset(chnstat, 0, sizeof(chnstat)); + + if (debug[1]) { + for (q=0; q<16; q++) + Balance[q] = 8; + } else { + for (q = 0; q < 16; q += 2) + Balance[q] = 2; + for (q = 1; q < 16; q += 2) + Balance[q] = 13; + } + for (q = 0; q < 16; q++) { + aica_stop(q); + aica_pan(q, Balance[q] * 16); + chnstat[q].pan = Balance[q]; + aica_vol(q, 255); + chnstat[q].vol = 63; + //debug[q] = 0; + } + EditRow = 0; + CurOrder = 0; + CurPattern = order[0]; + ptn = Pattern[CurPattern].data; + patbrk = -1; + ordbrk = -1; + TPS = fTPS(Tempo); + + /* *debug = 0x1000; */ + + /* We'll play infinitely! =) */ + /*jps = 256 - (44100 / 4000);*/ + while (1) { + PlayInt(); + + if (TPS == 0) TPS++; + /*if (lasttps != TPS) { + jps = 256 - (44100 / (TPS * 6)); + lasttps = TPS; + } */ + + *debug = 0x1001 | (TPS << 16); + + //timer_wait(6); + + timer_wait(4410/TPS); + + /*for (q=0; q<16; q++) + if (debug[q]>0) debug[q]--; */ + *debug = 0x1002 | (TPS << 16); + } +} + + + diff --git a/AICA/SRCS/libs3mplay/main.c b/AICA/SRCS/libs3mplay/main.c new file mode 100644 index 00000000..0031c6e2 --- /dev/null +++ b/AICA/SRCS/libs3mplay/main.c @@ -0,0 +1,82 @@ +/* +** LibS3MPlay Example Player (C) Josh PH3NOM Pearson 2011 +*/ + +#include +#include "libs3mplay/libs3mplay.h" + +int check_cont() { + + int ret=0; + + maple_device_t *cont; + cont_state_t *state; + cont = maple_enum_type(0, MAPLE_FUNC_CONTROLLER); + + if(cont) + { + state = (cont_state_t *)maple_dev_status(cont); + if (!state) + ret = 0; + if (state->buttons & CONT_Y) { + ret = 1; + } + if (state->buttons & CONT_START) { + ret = 2; + } + } + + return ret; + +} + +int main() +{ + printf("LibS3MPlay Example (C) PH3NOM 2011\n"); + int stat; + + stat = s3m_play("/cd/sample.s3m"); + + if( stat != S3M_SUCCESS ) + { + switch (stat) + { + case S3M_ERROR_IO: + printf("Unabled to open s3m file\n"); + return -1; + case S3M_ERROR_MEM: + printf("s3m file exceeds available SRAM\n"); + return -1; + } + } + + while(1) { + int input = check_cont(); + int exit=0; + switch (input) { + case 0: + break; + case 1: + printf("LibS3M: restarting\r\n"); + s3m_stop(); + s3m_play("/cd/sample.s3m"); + break; + case 2: + exit++; + break; + default: + break; + } + if(exit) + break; + thd_sleep(50); + } + + s3m_stop(); + + printf("LibS3MPlay Example Exiting\n"); + + return 0; + +} + diff --git a/CPU/SRCS/main2.c b/CPU/SRCS/main2.c new file mode 100644 index 00000000..d40ffa03 --- /dev/null +++ b/CPU/SRCS/main2.c @@ -0,0 +1,118 @@ +#include "terminal.h" +#include "sio.h" + + +// SPU DMA +// by bITmASTER (bITmASTER@bigfoot.com) + +void printf (char *fmt, ...); + +char buffer[1024] __attribute__ ((aligned(32))); + + +typedef unsigned int UINT; + + +typedef struct { + UINT ext_addr; // external address (SPU-RAM or parallel port) + UINT cpu_addr; // CPU address + UINT size; // size in bytes, all addr & size must be mod 32 !!! + UINT dir; // 0: cpu->ext, 1: ext->cpu + UINT mode; // 5 for SPU transfer + UINT ctrl1; // b0 + UINT ctrl2; // b0 + UINT u1; // ?? +} DMA; + +typedef struct { + UINT ext_addr; + UINT cpu_addr; + UINT size; + UINT status; +} EXTDMASTAT; + +typedef struct { + DMA dma[4]; + UINT u1[4]; // function unknown + UINT wait_state; + UINT u2[10]; // function unknown + UINT magic; + EXTDMASTAT extdmastat[4]; +} EXTDMAREGISTER; + + + + +void main2( void ) +{ + volatile int *spu_ram = (int *)0xa0800000; + volatile int *xxy = (int *) 0xa05f6884; + volatile int *qacr = (int *) 0xff000038; + volatile int *shdma = (int *) 0xFFA00000; + volatile EXTDMAREGISTER *extdmareg = (EXTDMAREGISTER *) 0xa05f7800; + + int i; + int chn = 0; // 0: SPU; 1,2,3 for ext (parallel port) + int dest; + + + dest = 0xa0800000; // SPU memory + + extdmareg->wait_state = 0x0; // wait states (for non-dma access) + extdmareg->magic = 0x4659404f; // magic number for release the ext DMA + + for ( i = 0; i < 64; i++ ) // fill SPU RAM + spu_ram[i] = 0x12345678; + + for ( i = 0; i < 1024; i++ ) // test pattern + buffer[i] = i; + printf( "buffer: %p\n", buffer ); + +// yeah, the extern dma is a very complex thing +// it uses the sh dma with On-demand data transfer mode (DDT mode) + + + shdma[0x20/4] = 0; // SAR2 = 0 + shdma[0x24/4] = 0; // DAR2 = 0 + shdma[0x28/4] = 0; // DMATCR2 = 0 + shdma[0x2c/4] = 0x12c0; // CHCR2 = 0x12c0, 32-byte block transfer, burst mode, External request, single address mode, Source address incremented + shdma[0x40/4] = 0x8201; // DMAOR = 0x8201, 0—DMAC Master Enable, CH2 > CH0 > CH1 > CH3, On-Demand Data Transfer + *xxy = 0; + + qacr[0] = 0x10; + qacr[1] = 0x10; + + +// reset all dma channels + + for ( i = 0; i < 4; i++ ) { + extdmareg->dma[i].ctrl1 = 0; + extdmareg->dma[i].ext_addr = 0; + extdmareg->dma[i].cpu_addr = 0; + extdmareg->dma[i].size = 0; + extdmareg->dma[i].dir = 0; + extdmareg->dma[i].mode = 0; + extdmareg->dma[i].ctrl1 = 0; + extdmareg->dma[i].ctrl2 = 0; + } + + + + +// start dma +// dont forget flush cache before start dma + + extdmareg->dma[chn].ctrl1 = 0; + extdmareg->dma[chn].ctrl2 = 0; + extdmareg->dma[chn].ext_addr = dest & 0x1fffffe0; + extdmareg->dma[chn].cpu_addr = (int) buffer & 0x1fffffe0; + extdmareg->dma[chn].size = 64 | 0x80000000; + extdmareg->dma[chn].dir = 0; + extdmareg->dma[chn].mode = 5; // SPU: 5, ext: 0 + extdmareg->dma[chn].ctrl1 = 1; + extdmareg->dma[chn].ctrl2 = 1; + + + terminal(); // yep, this is my terminal hexdump + +} diff --git a/CPU/SRCS/naomi.c b/CPU/SRCS/naomi.c new file mode 100644 index 00000000..662ece08 --- /dev/null +++ b/CPU/SRCS/naomi.c @@ -0,0 +1,5123 @@ +/* + + Sega Naomi / Naomi 2 / Atomiswave + + Driver by Samuele Zannoli, R. Belmont, ElSemi, + David Haywood and Angelo Salese + + Notes: + NAMCO Naomi games require a Namco specific BIOS + + Several early Naomi games are running on an earlier revision mainboard (HOTD2 etc.) which appears to have an earlier + revision of the graphic chip. Attempting to run these games on the later board results in graphical glitches and/or + other problems. + + Naomi 2 is backwards compatible with Naomi 1 + + The later revision games (released after GD-ROM had been discontinued) require the 'h' revision bios, which appears to + have additional hardware checks. + +Sega Naomi is Dreamcast based Arcade hardware. + +Current Compatibility notes (GD-rom games only) +|----------|-------|-----|------|------|------|--------------------------------|-----------------------------------------------------| +|romname | Pl(s) | Rot | Test | Boot | Game | Control Type | Notes | +|----------|-------|-----|------|------|------|--------------------------------|-----------------------------------------------------| +|gundmgd | 1 | H | Yes | Yes | Yes | joystick with 4 buttons | | +|sfz3ugd | 2 | H | Yes | Yes | No | joystick with 6 buttons | Hangs after pressing start | +|cvsgd | 2 | H | Yes | Yes | Yes | joystick with 4 buttons | 2 + 2 extra buttons | +|gundmxgd | 1 | H | Yes | Yes | Yes | joystick with 4 buttons | | +|cvs2gd | 2 | H | Yes | Yes | Yes | joystick with 6 buttons | | +|ikaruga | 2 | V | Yes | Yes | Yes | joystick with 2 buttons | | +|ggxx | 2 | H | Yes | Yes | Yes | joystick with 5 buttons | | +|moeru | 2 | H | No | No | No | joystick with 3 buttons | Broken i/o, stuck at the "now loading" msg | +|chocomk | 2 | H | Yes | Yes | Yes | joystick with 2 buttons | | +|quizqgd | 2 | V | Yes | Yes | Yes | joystick with 4 buttons | Can play without joystick | +|ggxxrl | 2 | H | Yes | Yes | Yes | joystick with 5 buttons | | +|tetkiwam | 2 | H | No | No | No | joystick with 3 buttons | Black screen, tests the SCIF (UART) regs? | +|shikgam2 | 2 | V | Yes | Yes | No | joystick with 3 buttons | Broken i/o, crashes on the proper gameplay | +|usagui | 1 | H | Yes | Yes | No | mahjong panel | | +|bdrdown | 2 | H | Yes | Yes | Yes | joystick with 3 buttons | | +|psyvar2 | 1 | V | Yes | Yes | No | joystick with 2 buttons | Broken i/o? Hangs after pressing start | +|cfield | 1 | H | Yes | Yes | Yes | joystick with 3 buttons | | +|trizeal | 2 | V | No | No | No | joystick with 3 buttons | | +|meltybld | 2 | H | Yes | Yes | Yes | joystick with 4 buttons | Crashes in attract mode | +|senko | 2 | H | Yes | Yes | No | joystick with 3 buttons | Senko no Londe SP (undumped) uses 5 buttons | +|senkoo | 2 | H | Yes | Yes | No | joystick with 3 buttons | | +|ss2005 | 1 | H | Yes | Yes | No | joystick with 3 buttons | Calls a YUV FMV, crashes due of that | +|radirgy | 1 | V | Yes | Yes | Yes | joystick with 3 buttons | | +|ggxxsla | 2 | H | Yes | Yes | Yes | joystick with 5 buttons | | +|kurucham | 2 | H | Yes | Yes | No | joystick with 3 buttons | Broken i/o, crashes in attract with wrong mask | +|undefeat | 2 | V | No | No | No | joystick with 2 buttons | Stuck at the "now loading" msg | +|trgheart | 1 | V | Yes | Yes | No | joystick with 3 buttons | Broken i/o | +|jingystm | 2 | H | Yes | Yes | No | joystick with 3 buttons | Broken i/o | +|meltyb | 2 | H | Yes | Yes | Yes | joystick with 5 buttons | Crashes in attract mode | +|meltyba | 2 | H | Yes | Yes | Yes | joystick with 5 buttons | Crashes in attract mode | +|karous | 1 | V | Yes | Yes | No | joystick with 3 buttons | Broken i/o | +|takoron | 2 | H | Yes | Yes | Yes | joystick with 3 buttons | | +-------------------------------------------------------------------------------------------------------------------------------------- +|confmiss | 2 | H | Yes | Yes | No | lightgun | | +|sprtjam | 2 | H | Yes | Yes | Yes | joystick with 2 buttons | | +|slashout | 1 | H | Yes | Yes | Yes | joystick with 4 buttons | | +|spkrbtl | 2 | H | Yes | Yes | No | joystick with 4 buttons | Crashes when loading the gameplay | +|monkeyba | 1 | H | Yes | Yes | No | ad stick | Crashes when loading the gameplay | +|dygolf | 2 | H | No | No | No | trackball + 4 buttons | Moans about the jvs settings | +|wsbbgd | 2 | H | No | No | No | ad stick + 2 buttons | Moans about the jvs settings | +|vtennisg | 2 | H | Yes | Yes | No | joystick with 2 buttons | Broken gfxs, crashes after a while | +|vathlete | 2 | H | Yes | Yes | No | joystick with 3 buttons | Broken i/o | +|vtennis2 | 2 | H | No | No | No | joystick with 3 buttons | | +|keyboard | 2 | H | Yes | Yes | No | keyboard | Broken i/o, crashes after a while | +|lupinsho | 2 | H | Yes | Yes | No | lightgun | Broken i/o, crashes after a while | +|luptype | 2 | H | Yes | Yes | No | keyboard | Broken i/o, ARM cpu crashes when inserting a coin | +|mok | 2 | H | Yes | Yes | No | lightgun | Broken i/o | +|ngdup23a | 2 | H | Yes | Yes | Yes | n/a | Missing DIMM emulation | +|ngdup23c | 2 | H | Yes | Yes | Yes | n/a | Missing DIMM emulation | +|puyofev | 2 | H | Yes | Yes | No | joystick with 2 buttons | Broken i/o? Hangs after pressing start | +-------------------------------------------------------------------------------------------------------------------------------------- + +Test: If it enters into test mode (not actually working test mode, i.e. if inputs doesn't work) +Boot: If game boots and draws some gfxs +Game: If game can be coined up and can actually be played without problems. +If the three aforementioned are all yes and there aren't any notes, game is fully working. + + +--------------------------------------------------------------------------------------------------------------------------------------------------- + +Guru's Readme +------------- + +Sega NAOMI Mainboard +Sega, 1998-2005 + +PCB Layout +---------- +837-13544-01 +171-7772F +837-13707 (sticker) +(C) SEGA 1999 +|---------------------------------------------------| +| CN1 CN3 | +|PC910 62256 EPF8452AQC160-3 | +| BATTERY EPC1064 JP4 3771 93C46 | +|A179B 315-6188.IC31 3771 3773| +|ADM485 BIOS.IC27 5264165 5264165 | +| 5264165 |-----| 5264165 | +| CN3 |POWER| | +| |VR2 | 33.3333MHZ | +|CN26 |-----| 27MHZ| +| CY2308SC-3| +| KM416S4030 |------| HY57V161610 | +| | SH4 | HY57V161610 | +| C844G 315-6232 | | 32MHZ | +| 33.8688MHZ |------| HY57V161610 | +| xMHz HY57V161610 | +| PCM1725 JP1 62256 | +| HY57V161610 | +| HY57V161610 | +| 315-6145 | +|CN25 CY2308SC-1 315-6146 | +| LED1 93C46 | +| LED2 14.7456MHZ | +|---------------------------------------------------| +Notes: + CN1/2/3 - Connectors for ROM cart + CN25/26 - Connectors for filter board + EPF8452AQC160-3 - Altera FLEX EPF8452AQC160-3 FPGA (QFP160) + 315-6188.IC31 - Altera EPC1064 (DIP8) + According to the datasheet, it's an FPGA Configuration + Device which loads the Altera Flex EPF8452 with some info + on power-up. + JP1 - set to 2-3. Alt setting is 1-2 + JP4 - set to 2-3. Alt setting is 1-2 + 93C46 - 128 bytes serial EEPROM + A179B 96K - TI SN75179B Differential driver and receiver pair (like RS485) + ADM485 - Analog Devices ADM485 + BIOS.IC27 - 27C160 EPROM + 5264165 - Hitachi 5264165FTTA60 (video RAM) + HY57V161610 - Hyundai 57V161610DTC-8 (main program RAM) + CY2308SC-3 - Clock generator IC + KM416S4030 - Samsung KM416S4030 16MBit SDRAM (sound related RAM?) + 315-6232 - Sega Custom IC (QFP100) + 315-6145 - Sega Custom IC (QFP56) + 315-6146 - Sega Custom IC (QFP176) + C844G - ? (SOIC14) + 62256 - 32kx8 SRAM + PCM1725 - Burr-Brown PCM1725 + xMHz - Small round XTAL (possibly 32.768kHz for a clock?) + SH4 - Hitachi SH4 CPU (BGAxxx, with heatsink and fan) + POWERVR2 - POWERVR2 video generator (BGAxxx, with heatsink) + + +Filter Board +------------ +839-1069 +|----------------------------------------------------| +|SW2 SW1 DIPSW CN5 CN12 CN10| +| | +| | +| DIN1 DIN2 | +| | +| CNTX CNRX | +| CN9 CN8 | +| CN7 CN6 CN4 CN3 CN2 CN1| +|----------------------------------------------------| +Notes: + CN1/CN2 - Power input + CN3 - HD15 (i.e. VGA connector) RGB Video Output @ 15kHz or 31.5kHz + CN4 - RCA Audio Output connectors + CN5 - USB connector (connection to I/O board) + CN6 - 10 pin connector labelled 'MAPLE 0-1' + CN7 - 11 pin connector labelled 'MAPLE 2-3' + CN8 - RS422 connector + CN9 - Midi connector + CNTX/CNRX - Network connectors + DIN1/DIN2 - Connectors joining to mainboard CN25/26 + SW1 - Test Switch + SW2 - Service Switch + DIPSW - 4-position DIP switch block + CN10 - 12 volt output for internal case exhaust fan + CN11 - RGB connector (not populated) + CN12 - 5 volt output connector + + + +--------------------------------------------------------- +Bios Version Information | +--------------------------------------------------------- + Bios | Support | Support | + Label | GD-ROM | Cabinet Link | +--------------------------------------------------------- +Naomi / GD-ROM | | | + EPR-21576D (and earlier) | No | No | + EPR-21576E | Yes | No | + EPR-21576F | Yes | Yes | + EPR-21576G (and newer) | Yes | Yes | +--------------------------------------------------------- +Naomi 2 / GD-ROM | | | + EPR-23605 | Yes | No | + EPR-23605A | Yes | Yes | + EPR-23605B (and newer) | Yes | Yes | +--------------------------------------------------------- + + + +Sega NAOMI ROM cart usage +------------------------- + +837-13668 171-7919A (C) Sega 1998 +|----------------------------------------------------------| +|IC1 IC2 IC3 IC4 IC5 IC6 CN2 | +|ROM1 ROM2 ROM3 ROM4 ROM5 ROM6 JP1| +| IC42 | +| 71256 | +| 71256 IC22 | +| IC7 IC8 IC9 IC10 IC11 | +| ROM7 ROM8 ROM9 ROM10 ROM11 IC41 | +| | +| 28MHz | +| | +| CN3 X76F100 CN1 | +|----------------------------------------------------------| +Notes: + Not all MASKROM positions are populated. + All MASKROMs (IC1 to IC21) are SOP44, either 32M or 64M + The other side of the cart PCB just has more locations for + SOP44 MASKROMs... IC12 to IC21 (ROM12 to ROM21) + + IC22 - DIP42 EPROM, either 27C160 or 27C322 + JP1 - Sets the size of the EPROM. 1-2 = 32M, 2-3 = 16M + IC41 - Xilinx XC9536 (PLCC44) + IC42 - SEGA 315-5881 (QFP100). Probably some kind of FPGA or CPLD. Usually different per game. + On the end of the number, -JPN means it requires Japanese BIOS, -COM will run with any BIOS + X76F100 - Xicor X76F100 secured EEPROM (SOIC8) + 71256 - IDT 71256 32kx8 SRAM (SOJ28) + CN1/2/3 - connectors joining to main board + + Note! Generally, games that require a special I/O board or controller will not boot at all with a + standard NAOMI I/O board. Usually they display a message saying the I/O board is not acceptable + or not connected properly. + + +Games known to use this PCB include.... + + Sticker EPROM # of SOP44 +Game on cart IC22# MASKROMs IC41# IC42# Notes +-------------------------------------------------------------------------------------------------------------- +Cosmic Smash 840-0044C 23428A 8 315-6213 317-0289-COM joystick + 2 buttons +Dead Or Alive 2 841-0003C 22121 21 315-6213 317-5048-COM joystick + 3 buttons +Dead Or Alive 2 Millenium 841-0003C DOA2 Ver.M 21 315-6213 317-5048-COM joystick + 3 buttons +Derby Owners Club 840-0016C 22099B 14 315-6213 317-0262-JPN touch panel + 2 buttons + card reader +Dynamite Baseball '99 840-0019C 22141B 19 315-6213 317-0269-JPN requires special panel (joystick + 2 buttons + bat controller for each player) +Dynamite Baseball Naomi 840-0001C 21575 21 315-6213 317-0246-JPN requires special panel (joystick + 2 buttons + bat controller for each player) +Giant Gram Pro Wrestle 2 840-0007C 21820 9 315-6213 317-0253-JPN joystick + 3 buttons +Heavy Metal Geo Matrix HMG016007 23716A 11 315-6213 317-5071-COM joystick + 2 buttons +Idol Janshi Suchie-Pai 3 841-0002C 21979 14 315-6213 317-5047-JPN requires special I/O board and mahjong panel +Out Trigger 840-0017C 22163 19 315-6213 317-0266-COM requires analog controllers/special panel +Power Stone 841-0001C 21597 8 315-6213 317-5046-COM joystick + 3 buttons +Power Stone 2 841-0008C 23127 9 315-6213 317-5054-COM joystick + 3 buttons +Samba de Amigo 840-0020C 22966B 16 315-6213 317-0270-COM will boot but requires special controller to play it +Sega Marine Fishing 840-0027C 22221 10 315-6213 not populated ROM 3&4 not populated. Requires special I/O board and fishing controller +Slash Out 840-0041C 23341 17 315-6213 317-0286-COM joystick + 4 buttons +Spawn 841-0005C 22977B 10 315-6213 317-5051-COM joystick + 4 buttons +Toy Fighter 840-0011C 22035 10 315-6212 317-0257-COM joystick + 3 buttons +Virtua Striker 2 2000 840-0010C 21929C 15 315-6213 317-0258-COM joystick + 3 buttons +Zombie Revenge 840-0003C 21707 19 315-6213 317-0249-COM joystick + 3 buttons + + +Sega I/O boards +--------------- + +These are used on NAOMI and all other Sega games from 1999 onwards. +Not all I/O boards are listed here. If you know of others, please let us know. + + +838-13683 +838-13683-91 (sticker) +838-13683-92 (sticker) +838-13683-93 (sticker) +|-----------------------------| +| CN6 CN7 CN2 CN1 RELAY| +| IC4 IC7 IC5 CN5 | +| IC3 IC6 | +|CN3 IC1 IC2 IC9| +| OSC1 JP1 | +|CN4 | +| IC8 IC10 | +|--| JAMMA |----| + |---------------------| +Notes: + JVS to JAMMA I/O board. Has both digital and analog inputs + + JVS test mode strings + --------------------- + NAME SEGA ENTERPRISES,LTD. + I/O 838-13683B + Ver1.07 + 99/06 + CMD VER 1.1 + JVS VER 2.0 + COM VER 1.0 + SWITCH 2 PLAYER(S) 11 BITS + COIN 2 SLOT + ANALOG 8 CH + ROTARY 0 CH + KEYCODE 0 + SCREEN X:0 Y:0 CH:0 + CARD 0 SLOT + HOPPER OUT 0 CH + DRIVER OUT 8 SLOT + ANALOG OUT 0 CH + CHARACTER CHARA:0 LINE:0 + BACKUP 0 + + CN1 - USB connector type A + CN2 - USB connector type B + CN3 - 14 pin connector used for switch input or lamp output via jumper setting + 1-2 +5V + 3 NC + 4-6 1P SW6-SW8 + 7 NC + 8-10 2P SW6-SW8 + 11-12 NC + 13-14 GND + CN4 - 2 pin connector + CN5 - 15 pin VGA connector + CN6 - 6 pin connector used for 5 volt and 12 volt power input/output + 1-2 +5V + 3-4 +12V + 5-6 GND + CN7 - 26 pin analog controls connector + 1-2 +5V 15 Reserved + 3 1P Analog Y 16 Reserved + 4 2P Analog Y 21 Reserved + 9 1P Analog X 22 Reserved + 10 2P Analog X 23-24 GND + IC1 - Toshiba TMP90PH44 microcontroller with sticker 'SP5001-B' (SDIP64) + IC2 - location for TMP90PH44 QFP64 (not used) + IC3 - 74HC541 (SOIC20) + IC4 - BA6212 (DIP20) + IC5 - Analog Devices ADM485 (SOIC8) + IC6 - 5W393 (SOIC8) + IC7 - 74HC4052 (SOIC16) + IC8 - Toshiba TD62384 (SOIC16) + IC9 - A7666FS (SOIC16) + IC10 - 74F86 (SOIC14) + JP1 - Set in position A to use CN3 as input for switches. Set in position B to use as output (for lamps etc) + When in position A, in the JVS test mode, 'SWITCH' becomes '2 PLAYER(S) 15 BITS' and 'DRIVER OUT' becomes '0 SLOT' + RELAY - Omron G6S-2 relay + OSC1 - 14.74MHz + + +837-13551 +837-13551-92 (sticker) +837-13551-93 (sticker) +|-----------------------------| +|CN4 CN5 CN6 CN7 CN8| +|LED ADM485 | +| RELAY IC1A * | +| | +| 14.745MHz| +| PS2801-4(x8) | +| LED| +|CN1 CN2 CN3 | +|-----------------------------| +Notes: + JVS I/O board. Has both digital and analogue inputs. + This is the most common type. Used on Sega driving games, NAOMI, Hikaru, Triforce, Chihiro etc + + JVS test mode strings + --------------------- + NAME SEGA ENTERPRISES,LTD. + I/O BD JVS + 837-13551 + Ver1.00 + CMD VER 1.1 + JVS VER 2.0 + COM VER 1.0 + SWITCH 2 PLAYER(S) 13 BITS + COIN 2 SLOT(S) + ANALOG 8 CH + ROTARY 0 CH + KEYCODE 0 + SCREEN X:0 Y:0 CH:0 + CARD 0 SLOT(S) + HOPPER OUT 0 CH + DRIVER OUT 6 CH + ANALOG OUT 0 CH + CHARACTER CHARA:0 LINE:0 + BACKUP 0 + + IC1A - Toshiba TMP90PH44 microcontroller marked '315-6215' (SDIP64) + * - location under the PCB for TMP90PH44 QFP64 (not used) + RELAY - NEC EB2-4.5NU relay + ADM485 - Analog Devices ADM485 + CN1 - 5 pin connector 12 volt power input + 1-2 +12V + 3 NC + 4-5 GND + CN2 - 5 pin connector 12 volt power output + 1-2 +12V + 3 NC + 4-5 GND + CN3 - 60 pin digital input connector + 1-8 +5V 33 1P SW4 + 9-15 GND 34 2P SW4 + 16 NC 35 1P SW5 + 17 1P Start 36 2P SW5 + 18 2P Start 37 1P SW6 + 19 1P Right 38 2P SW6 + 20 2P Right 39 1P SW7 + 21 1P Left 40 2P SW7 + 22 2P Left 41 1P Service Credit + 23 1P Up 42 2P Service Credit + 24 2P Up 43 Test SW + 25 1P Down 44 Tilt SW + 26 2P Down 45 Coin SW1 + 27 1P SW1 46 Coin SW2 + 28 2P SW1 47-48 NC + 29 1P SW2 49-50 Coin Meter 1 & 2 + 30 2P SW2 51-56 Output 1-6 + 31 1P SW3 57-60 +12V + 32 2P SW3 + Note: For coin input to work, the coin meters need to be connected to + pins 49 and 50, or tie +5 volts to pin 49 and 50 via a resistor. + CN4 - USB connector type B + CN5 - USB connector type A + CN6 - Analog I/O connector + 1-2 VCC 15 AD 2 + 3 AD 0 16 AD 6 + 4 AD 4 17-18 NC + 5 GND 19-20 VCC + 6 GND 21 AD 3 + 7-8 NC 22 AD 7 + 9 AD 1 23 GND + 10 AD 5 24 GND + 11-14 NC 25-26 NC + CN7 - 4 pin connector 5V power input + 1-2 +5v 3-4 GND + CN8 - 4 pin connector 5V power out + 1-2 +5v 3-4 GND + + +837-13741 +837-13844-02 (sticker) +|-----------------------------| +| CN8 CN9 | +|DB9 CN1| +|RESET_SW |----| | +| |IC6 | OSC1 CN5| +| |----| | +|CN7 LED DSW1(5) CN2| +| OSC2 RELAY | +|CNx USB USB IC7 LED CN6| +|-----------------------------| +Notes: (most info taken from poor quality pics/scans, better info is needed) + + JVS I/O board 2. Has both digital and analogue inputs. + This board is used with F355, Ghost Squad, and many + others including network/satellite games. + + JVS test mode strings + --------------------- + + NAME SEGA ENTERPRISES,LTD.;837-13741 + I/O CONTROL BD2;Ver0.15;99/06 + CMD VER 1.1 + JVS VER 2.0 + COM VER 1.0 + SWITCH 2 PLAYERS 12BITS + COIN 2 SLOTS + ANALOG 8CH + DRIVER OUT 22CH + + IC6 - Sega 315-6146 custom IC (QFP176) + IC7 - 27C512 EPROM with label 'EPR-22082' (DIP28) + IC8 - Sharp LH52256 32k x8 SRAM (SOP28) + IC10 - Something by NEC? (QFP44) + OSC1 - 14.7456MHz + OSC2 - 32MHz + CNx - 6 pin connector + CN1 - 5 pin connector 12 volt power input + 1-2 +12V + 3 NC + 4-5 GND + CN2 - 4 pin connector 5V power input + 1-2 +5v + 3-4 GND + CN5 - 5 pin connector 12 volt power output + 1-2 +12V + 3 NC + 4-5 GND + CN6 - 4 pin connector 5V power output + 1-2 +5v + 3-4 GND + CN7 - 26 pin connector (many pins unknown) + 1 +5V 14 + 2 15 Analog Output + 3 Analog Output 16 + 4 17 GND + 5 GND 18 + 6 19 +5V + 7 +5V 20 + 8 21 Analog Output + 9 Analog Output 22 + 10 23 GND + 11 GND 24 + 12 25 + 13 +5V 26 + CN8 - 40 pin connector (many pins unknown) + 3-5 +5V 21 Switch + 7-9 GND 22 Switch + 13-14 Coin SW1/2 23 Switch + 15 Test SW 24 Switch + 17 1P Start SW 25 2P Start SW + 18 Service SW 31 Switch + 19 Switch 32 Switch + 20 Switch 33-40 RX1-RX8 (for communications) + CN9 - 34 pin connector (some pins unknown) + 1-4 +5V + 5-8 GND + 9-10 Coin Meter 1 & 2 + 11 Lamp + 12 Lamp + 13 Lamp + 14 Lamp + 15 Lamp + 16 Lamp + 17 Lamp + 18 Lamp + 19 Lamp + 20 Lamp + 21 Coin LED + 22-24 ? + 25-32 TX1-TX8 (for communications) + 33-34 12V + + +837-13938 +171-7807A +|--------------------| +|CN2 CN1 IC9S| +| OSC1 | +| |-----| | +| | IC2 |OSC2 | +| CN3 | | | +| IC7S|-----| IC3| +|LED CN4 IC4 | +|--------------------| +Notes: + This is the I/O board used for Dynamic Golf which is + located under the panel. It's also used for spinner + controls such as those used on Outtrigger. + It must be daisy-chained to the normal I/O board with a USB cable. + + CN1 - 24 pin connector (not used on Dynamic Golf, other use unknown) + CN2 - 4 pin connector used for 5 volt power input + CN3 - USB connector type B + CN4 - 16 pin connector used for buttons and trackball + IC1 - HC240 logic IC (SOIC20) + IC2 - Sega 315-6146 custom IC (QFP176) + IC3 - 27C512 EPROM with label 'EPR-22084' (DIP28) + IC4 - HC4020 logic IC (SOIC16) + These parts on the other side of the PCB.... + IC7S - Analog Devices ADM485 (SOIC8) + IC9S - Sharp LH52256 32k x8 SRAM (SOP28) + OSC1 - 14.7456MHz + OSC2 - 32MHz + Not shown above.... Sharp PC410 (x8, at PC9S to PC16S) + HC74 at IC8S + 34164 (?) at IC10S (SOIC8) + +Sega's I/O board has: +- spare output of 5V, 12V, and GND (from JAMMA power input via noise filter) +- analog input +- USB input (connect to NAOMI motherboard) +- USB output (not used) +- shrinked D-sub 15pin connector (connect JVS video output, the signal is routed to JAMMA connector, signal is amplified to 3Vp-p and H/V sync signal is mixed (composite)) +- external I/O connector (JST 12pin) +- switch to select function of external I/O connector (extra button input or 7-seg LED(x2) output of total wins for 'Versus City' cabinet) +- spare audio input (the signal goes to JAMMA speaker output) +- JAMMA connector + +external I/O connector + +old version + 1 +5V + 2 +5V + 3 +5V + 4 1P PUSH 4 + 5 1P PUSH 5 + 6 1P PUSH 6 + 7 1P PUSH 7 + 8 2P PUSH 4 + 9 2P PUSH 5 +10 2P PUSH 6 +11 2P PUSH 7 +12 GND +13 GND +14 GND +(PUSH4 and 5 are common to JAMMA) + +new version + 1 +5V + 2 +5V + 3 +5V + 4 1P PUSH 6 + 5 1P PUSH 7 + 6 1P PUSH 8 + 7 1P PUSH 9 + 8 2P PUSH 6 + 9 2P PUSH 7 +10 2P PUSH 8 +11 2P PUSH 9 +12 GND +13 GND +14 GND + +mahjong panel uses ext. I/O 4-8 (regardless of I/O board version) +key matrix is shown in below + + +------------------------------------ ext. I/O 8 + | +------------------------------ ext. I/O 7 + | | +------------------------ ext. I/O 6 + | | | +------------------ ext. I/O 5 + | | | | +------------ ext. I/O 4 +(LST)-( D )-( C )-( B )-( A )---------- JAMMA 17 (1p start) + | | | | | + | ( H )-( G )-( F )-( E )---------- JAMMA 18 (1p up) + | | | | | + | ( L )-( K )-( J )-( I )---------- JAMMA 19 (1p down) + | | | | | +(F/F)-(PON)-(CHI)-( N )-( M )---------- JAMMA 20 (1p left) + | | | | + +---(RON)-(RCH)-(KAN)---------- JAMMA 21 (1p right) + | | | + +---(BET)-(STR)---------- JAMMA 22 (1p push1) + +* LST = Last chance, F/F = Flip flop, STR = Start + + +--------------------------------------------------------------------------------------------------------------------------------------------------- + +Guru's Readme +------------- + +Atomis Wave (system overview) +Sammy/SEGA, 2002 + +This is one of the latest arcade systems so far, basically just a Dreamcast using ROM carts. + +PCB Layout +---------- + +Sammy AM3AGA-04 Main PCB 2002 (top side) +1111-00006701 (bottom side) + |--------------------------------------------| + |- TA8210AH D4721 3V_BATT| + |VGA BS62LV1023TC| + |VOL | + |SER |-----| PCM1725U | + |- |ROMEO| D4516161 | + |CN3 | | BIOS.IC23| +|--|SW1 |-----| | +| |-----| |-----| | +| 33.8688MHz|315- | |ROMEO| | +| |-----| |6232 | | | | +| |315- | |-----| |-----| | +| |6258 | 32.768kHz | +|J |-----| | +|A |-------------| D4564323 | +|M | | | +|M | | |--------| | +|A D4516161 | 315-6267 | | | | +| | | | SH4 | | +| | | | | | +| TD62064 | | | | | +| D4516161 | | |--------| | +| |-------------| | +| D4564323 | +|--| D4516161 D4516161 | + | W129AG 13.5MHz| + |--------------------------------------------| +Notes: +------ +BS62LV1023TC-70 - Brilliance Semiconductor Low Power 128k x8 CMOS SRAM (TSOP32) +TA8210AH - Toshiba 19W x 2 Channel Power Amplifier +D4516161AG5 - NEC uPD4516161AG5-A80 1M x16 (16MBit) SDRAM (SSOP50) +D4564323 - NEC uPD4564323G5-A10 512K x 32 x 4 (64MBit) SDRAM (SSOP86) +D4721 - NEC uPD4721 RS232 Line Driver Receiver IC (SSOP20) +PCM1725U - Burr-Brown PCM1725U 16Bit Digital to Analog Converter (SOIC14) +2100 - New Japan Radio Co. Ltd. NJM2100 Dual Op Amp (SOIC8) +ROMEO - Sammy AX0201A01 'ROMEO' 4111-00000501 0250 K13 custom ASIC (TQFP100) +315-6232 - SEGA 315-6232 custom ASIC (QFP100) +315-6258 - SEGA 315-6258 custom ASIC (QFP56) +315-6267 - SEGA 315-6267 custom ASIC (BGAxxx) +TD62064 - Toshiba TD62064 NPN 50V 1.5A Quad Darlington Driver (SOIC16) +SH4 - Hitachi SH-4 HD6417091RA CPU (BGA256) +BIOS.IC23 - Macronix 29L001MC-10 3.3volt FlashROM (SOP44) + This is a little strange, the ROM appears to be a standard SOP44 with reverse pinout but the + address lines are shifted one pin out of position compared to industry-standard pinouts. + The actual part number doesn't exist on the Macronix web site, even though they have datasheets for + everything else! So it's probably a custom design for Sammy and top-secret! + The size is assumed to be 1MBit and is 8-bit (D0-D7 only). The pinout appears to be this..... + + +--\/--+ +tied to WE of BS62LV1023 VCC | 1 44| VCC - tied to a transistor, probably RESET + NC | 2 43| NC + A9 | 3 42| NC + A10 | 4 41| A8 + A11 | 5 40| A7 + A12 | 6 39| A6 + A13 | 7 38| A5 + A14 | 8 37| A4 + A15 | 9 36| A3 + A16 |10 35| A2 + NC |11 34| A1 + NC |12 33| CE - tied to 315-6267 + GND |13 32| GND + A0 |14 31| OE + D7 |15 30| D0 + NC |16 29| NC + D6 |17 28| D1 + NC |18 27| NC + D5 |19 26| D2 + NC |20 25| NC + D4 |21 24| D3 + VCC |22 23| NC + +------+ + +W129AG - IC Works W129AG Programmable Clock Frequency Generator, clock input of 13.5MHz (SOIC16) +SW1 - 2-position Dip Switch +VGA - 15 pin VGA out connector @ 31.5kHz +SER - 9 pin Serial connector \ +VOL - Volume pot / These are on a small daughterboard that plugs into the main PCB via a multi-wire cable. +CN3 - Unknown 10 pin connector labelled 'CN3' +3V_BATT - Panasonic ML2020 3 Volt Coin Battery + +The bottom of the PCB contains nothing significant except some connectors. One for the game cart, one for special controls +or I/O, one for a communication module, one for a cooling fan and one for the serial connection daughterboard. + +--------------------------------------------------------------------------------------------------------------------------------------------------- + + + + +Atomiswave cart PCB layout and game usage +----------------------------------------- + +Type 1 ROM Board: + + +AM3AGB-04 +MROM PCB +2002 +|----------------------------| +| XC9536 | +| IC18 IC17* IC10 | +| | +| | +| IC16* IC11 | +| | +| | +||-| IC15* IC12 | +|| | | +|| | | +|| |CN1 IC14* IC13 | +|| | | +||-| | +|----------------------------| +Notes: + * - Denotes those devices are on the other side of the PCB + CN1 - This connector plugs into the main board. + XC9536 - Xilinx XC9536 in-system programmable CPLD (PLCC44), stamped with a + game code. This code is different for each different game. + The last 3 digits seems to be for the usage. + F01 = CPLD/protection device and M01 = MASKROM + + Game (sorted by code) Code + ----------------------------------------------- + Sports Shooting USA AX0101F01 + Dolphin Blue AX0401F01 + Demolish Fist AX0601F01 + Guilt Gear Isuka AX1201F01 + Knights Of Valour Seven Spirits AX1301F01 + Salaryman Kintaro AX1401F01 + Ranger Mission AX1601F01 + Rumble Fish AX1801F01 + Fist Of The North Star AX1901F01 + Victory Furlong : Horse Racing AX2001F01 + King Of Fighters NEOWAVE AX2201F01 + + IC18 - Fujitsu 29DL640E 64M TSOP48 FlashROM. This ROM has no additional custom markings + The name in the archive has been devised purely for convenience. + This ROM holds the main program. + +IC10 to IC17 - Custom-badged 128M TSOP48 mask ROMs. I suspect they are Macronix + ROMs because the ROM on the main board is also a custom Macronix + ROM and they have a history of producing custom ROMs for other + companies that hide their ROM types like Nintendo etc. + They could also be Oki MR27V12800. + + IC10 - Not Populated for 7 ROMs or less (ROM 01 if 8 ROMs are populated) + IC11 - ROM 01 (or ROM 02 if 8 ROMs are populated) + IC12 - ROM 02 (or ROM 03 if 8 ROMs are populated) + IC13 - ROM 03 (or ROM 04 if 8 ROMs are populated) + IC14 - ROM 04 (or ROM 05 if 8 ROMs are populated) + IC15 - ROM 05 (or ROM 06 if 8 ROMs are populated) + IC16 - ROM 06 (or ROM 07 if 8 ROMs are populated) + IC17 - ROM 07 (or ROM 08 if 8 ROMs are populated) + + ROM Codes + --------- + Number + Game (sorted by code) Code of ROMs + ----------------------------------------------------------------------- + Sports Shooting USA AX0101M01 to AX0104M01 4 + Dolphin Blue AX0401M01 to AX0405M01 5 + Demolish Fist AX0601M01 to AX0607M01 7 + Guilty Gear Isuka AX1201M01 to AX1208M01 8 + Knights Of Valour Seven Spirits AX1301M01 to AX1307M01 7 + Salaryman Kintaro AX1401M01 to AX1407M01 7 + Ranger Mission AX1601M01 to AX1605M01 5 + Rumble Fish AX1801M01 to AX1807M01 7 + Fist Of The North Star AX1901M01 to AX1907M01 7 + Victory Furlong : Horse Racing AX2001M01 to AX2007M01 7 + King Of Fighters NEOWAVE AX2201M01 to AX2206M01 6 + + +Type 2 ROM Board: + + +AM3ALW-02 +MROM2 PCB +2005 +|----------------------------| +| FMEM1 | +| FMEM2* MROM12 | +| MROM11* | +| MROM9 | +| MROM10 MROM8*| +| XCR3128XL* MROM7* | +| | +||-| MROM6 | +|| | MROM3* MROM4 | +|| | MROM5*| +|| |CN1 MROM2 | +|| | MROM1* | +||-| | +|----------------------------| +Notes: + * - Denotes those devices are on the other side of the PCB + CN1 - This connector plugs into the main board. + XCR3128XL - Xilinx XCR3128XL in-system programmable 128 Macro-cell CPLD (TQFP100) + stamped with a game code. This code is different for each different game. + The last 3 digits seems to be for the usage. + F01 = CPLD/protection device and M01 = MASKROM + + Game (sorted by code) Code + ----------------------------------------------- + Samurai Spirits Tenkaichi Kenkakuden AX2901F01 + Neogeo Battle Coliseum AX3301F01 + Rumble Fish 2 AX3401F01 + + FMEM1/FMEM2 - Fujitsu 29DL640E 64M TSOP48 FlashROM. This ROM has no additional custom markings + The name in the archive has been devised purely for convenience. + This ROM holds the main program. + This location is wired to accept TSOP56 ROMs, however the actual chip populated + is a TSOP48, using the middle pins. The other 2 pins on each side of the ROM + are not connected to anything. + + MROM* - Custom-badged SSOP70 mask ROMs. These may be OKI MR26V25605 or MR26V25655 (256M) + or possibly 26V51253 (512M) or something else similar. + + ROM Codes + --------- + Number + Game (sorted by code) Code of ROMs + ----------------------------------------------------------------------- + Samurai Spirits Tenkaichi Kenkakuden AX2901M01 to AX2907M01 7 + Neogeo Battle Coliseum AX3301M01 to AX3307M01 7 + Rumble Fish 2 AX3401M01 to AX3405M01 5 + + + Other games not dumped (some may have been cancelled) + ---------------------- + Chase 1929 + Dirty Pigskin + Extreme Hunting + Extreme Hunting 2: Tournament Edition + Faster Than Speed + Force Five + Guilty Gear X Version 1.5 + Kenju + Maximum Speed + Metal Slug 6 + Premier Eleven + Sushi Bar + The King Of Fighters XI + + + + + +*/ + +#include "driver.h" +#include "cpu/arm7/arm7.h" +#include "video/generic.h" +#include "machine/eeprom.h" +#include "naomibd.h" +#include "naomi.h" +#include "cpu/sh4/sh4.h" +#include "cpu/arm7/arm7core.h" +#include "sound/aica.h" +#include "dc.h" + +#define CPU_CLOCK (200000000) +static UINT32 *dc_sound_ram; +extern UINT64 *naomi_ram64; + /* MD2 MD1 MD0 MD6 MD4 MD3 MD5 MD7 MD8 */ +static const struct sh4_config sh4cpu_config = { 1, 0, 1, 0, 0, 0, 1, 1, 0, CPU_CLOCK }; + +static INTERRUPT_GEN( naomi_vblank ) +{ + dc_vblank(device->machine); +} + +static READ64_HANDLER( naomi_arm_r ) +{ + return *((UINT64 *)dc_sound_ram+offset); +} + +static WRITE64_HANDLER( naomi_arm_w ) +{ + COMBINE_DATA((UINT64 *)dc_sound_ram + offset); +} + +static READ64_HANDLER( naomi_unknown1_r ) +{ + if ((offset * 8) == 0xc0) // trick so that it does not "wait for multiboard sync" + return -1; + return 0; +} + +static WRITE64_HANDLER( naomi_unknown1_w ) +{ +} + +/* +* Non-volatile memories +*/ + +extern UINT8 maple0x86data1[0x80]; + + +// some default eeprom settings +static const struct +{ + const char *name; + const UINT8 eeprom[128]; +} +jvseeprom_default_game[] = +{ + { "karous", { 0x58, 0xE5, 0x11, 0x42, 0x4D, 0x57, 0x00, 0x09, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0x58, 0xE5, 0x11, 0x42, 0x4D, 0x57, 0x00, 0x09, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, + { "sfz3ugd", { 0xE3, 0xF2, 0x10, 0x42, 0x43, 0x59, 0x30, 0x09, 0x10, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0xE3, 0xF2, 0x10, 0x42, 0x43, 0x59, 0x30, 0x09, 0x10, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0xBE, 0x1F, 0x18, 0x18, 0xBE, 0x1F, 0x18, 0x18, 0x30, 0x59, 0x43, 0x42, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x30, 0x59, 0x43, 0x42, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, + { "shikgam2", { 0xA4, 0xF6, 0x11, 0x42, 0x47, 0x45, 0x30, 0x09, 0x10, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0xA4, 0xF6, 0x11, 0x42, 0x47, 0x45, 0x30, 0x09, 0x10, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11,0x43, 0x84, 0x20, 0x20, 0x43, 0x84, 0x20, 0x20, 0x42, 0x47, 0x45, 0x30, 0x53, 0x48, 0x49, 0x4B, 0x49, 0x32, 0x52, 0x4F, 0x4D, 0x20, 0x30, 0x32, 0x32, 0x38, 0x00, 0x00, 0x4B, 0x4B, 0x00, 0x02, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x47, 0x45, 0x30, 0x53, 0x48, 0x49, 0x4B, 0x49, 0x32, 0x52, 0x4F, 0x4D, 0x20, 0x30, 0x32, 0x32, 0x38, 0x00, 0x00, 0x4B, 0x4B, 0x00, 0x02, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, + { "quizqgd", { 0xAD, 0x1E, 0x11, 0x42, 0x46, 0x50, 0x31, 0x09, 0x10, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0xAD, 0x1E, 0x11, 0x42, 0x46, 0x50, 0x31, 0x09, 0x10, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0xC4, 0x18, 0x1D, 0x20, 0xC4, 0x18, 0x1D, 0x20, 0x42, 0x46, 0x50, 0x31, 0x51, 0x2D, 0x4D, 0x4F, 0x44, 0x45, 0x51, 0x2D, 0x4D, 0x4F, 0x44, 0x45, 0x01, 0x01, 0x05, 0x01, 0x02, 0x00, 0x01, 0x03, 0x01, 0x00, 0x4B, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x42, 0x46, 0x50, 0x31, 0x51, 0x2D, 0x4D, 0x4F, 0x44, 0x45, 0x51, 0x2D, 0x4D, 0x4F, 0x44, 0x45, 0x01, 0x01, 0x05, 0x01, 0x02, 0x00, 0x01, 0x03, 0x01, 0x00, 0x4B, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, + { "senko", { 0xCD, 0xEE, 0x10, 0x42, 0x4B, 0x47, 0x30, 0x09, 0x10, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0xCD, 0xEE, 0x10, 0x42, 0x4B, 0x47, 0x30, 0x09, 0x10, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0xE5, 0x91, 0x10, 0x10, 0xE5, 0x91, 0x10, 0x10, 0x07, 0x51, 0x17, 0x03, 0x00, 0x01, 0x02, 0x02, 0x46, 0x00, 0x96, 0x00, 0x46, 0x00, 0x00, 0x00, 0x07, 0x51, 0x17, 0x03, 0x00, 0x01, 0x02, 0x02, 0x46, 0x00, 0x96, 0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, + { "senkoo", { 0xCD, 0xEE, 0x10, 0x42, 0x4B, 0x47, 0x30, 0x09, 0x10, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0xCD, 0xEE, 0x10, 0x42, 0x4B, 0x47, 0x30, 0x09, 0x10, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0x12, 0xF0, 0x0C, 0x0C, 0x12, 0xF0, 0x0C, 0x0C, 0x07, 0x51, 0x17, 0x03, 0x01, 0x02, 0x46, 0x00, 0x96, 0x00, 0x00, 0x00, 0x07, 0x51, 0x17, 0x03, 0x01, 0x02, 0x46, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, + { "radirgy", { 0x0C, 0x29, 0x11, 0x42, 0x4B, 0x57, 0x00, 0x09, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0x0C, 0x29, 0x11, 0x42, 0x4B, 0x57, 0x00, 0x09, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, + { "trgheart", { 0xF0, 0xC2, 0x11, 0x42, 0x4D, 0x41, 0x31, 0x09, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0xF0, 0xC2, 0x11, 0x42, 0x4D, 0x41, 0x31, 0x09, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0x7E, 0xE1, 0x24, 0x24, 0x7E, 0xE1, 0x24, 0x24, 0x30, 0x41, 0x4D, 0x42, 0x54, 0x52, 0x49, 0x47, 0x47, 0x45, 0x52, 0x48, 0x45, 0x41, 0x52, 0x54, 0x20, 0x45, 0x58, 0x45, 0x4C, 0x49, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x02, 0x00, 0x09, 0x09, 0x09, 0x00, 0x30, 0x41, 0x4D, 0x42, 0x54, 0x52, 0x49, 0x47, 0x47, 0x45, 0x52, 0x48, 0x45, 0x41, 0x52, 0x54, 0x20, 0x45, 0x58, 0x45, 0x4C, 0x49, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x02, 0x00, 0x09, 0x09, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, + { "gundmgd", { 0xCD, 0x77, 0x10, 0x42, 0x43, 0x56, 0x30, 0x09, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0xCD, 0x77, 0x10, 0x42, 0x43, 0x56, 0x30, 0x09, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, + { "gundmxgd", { 0xAA, 0xAD, 0x10, 0x42, 0x44, 0x55, 0x30, 0x09, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0xAA, 0xAD, 0x10, 0x42, 0x44, 0x55, 0x30, 0x09, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, + { "psyvar2", { 0xCB, 0x6E, 0x11, 0x42, 0x48, 0x42, 0x30, 0x09, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0xCB, 0x6E, 0x11, 0x42, 0x48, 0x42, 0x30, 0x09, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, + { "cfield", { 0xFB, 0xD4, 0x10, 0x42, 0x4A, 0x42, 0x00, 0x09, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0xFB, 0xD4, 0x10, 0x42, 0x4A, 0x42, 0x00, 0x09, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, + { "puyofev", { 0x65, 0x7E, 0x10, 0x42, 0x48, 0x44, 0x00, 0x09, 0x10, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0x65, 0x7E, 0x10, 0x42, 0x48, 0x44, 0x00, 0x09, 0x10, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0x0E, 0x0B, 0x20, 0x20, 0x0E, 0x0B, 0x20, 0x20, 0x42, 0x48, 0x44, 0x00, 0x50, 0x55, 0x59, 0x4F, 0x20, 0x50, 0x55, 0x59, 0x4F, 0x20, 0x46, 0x45, 0x56, 0x45, 0x52, 0x2E, 0x20, 0x10, 0x03, 0x20, 0x01, 0x00, 0x02, 0x03, 0x00, 0x80, 0x00, 0x00, 0x42, 0x48, 0x44, 0x00, 0x50, 0x55, 0x59, 0x4F, 0x20, 0x50, 0x55, 0x59, 0x4F, 0x20, 0x46, 0x45, 0x56, 0x45, 0x52, 0x2E, 0x20, 0x10, 0x03, 0x20, 0x01, 0x00, 0x02, 0x03, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, + { "bdrdown", { 0xA0, 0x75, 0x10, 0x42, 0x47, 0x48, 0x30, 0x09, 0x10, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0xA0, 0x75, 0x10, 0x42, 0x47, 0x48, 0x30, 0x09, 0x10, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0xAE, 0x7E, 0x08, 0x08, 0xAE, 0x7E, 0x08, 0x08, 0x01, 0x00, 0x00, 0x00, 0x33, 0xB8, 0x96, 0xE4, 0x01, 0x00, 0x00, 0x00, 0x33, 0xB8, 0x96, 0xE4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, + { "ss2005", { 0xAD, 0x0A, 0x10, 0x42, 0x4B, 0x4C, 0x30, 0x09, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0xAD, 0x0A, 0x10, 0x42, 0x4B, 0x4C, 0x30, 0x09, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, + { "usagui", { 0x02, 0x8C, 0x10, 0x42, 0x47, 0x46, 0x00, 0x09, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0x02, 0x8C, 0x10, 0x42, 0x47, 0x46, 0x00, 0x09, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, + { "undefeat", { 0x06, 0x18, 0x11, 0x42, 0x4C, 0x48, 0x30, 0x09, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0x06, 0x18, 0x11, 0x42, 0x4C, 0x48, 0x30, 0x09, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, + { "trizeal", { 0x8F, 0x05, 0x11, 0x42, 0x4A, 0x46, 0x30, 0x09, 0x10, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0x8F, 0x05, 0x11, 0x42, 0x4A, 0x46, 0x30, 0x09, 0x10, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, + { "moeru", { 0xA1, 0x18, 0x10, 0x42, 0x45, 0x55, 0x20, 0x09, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0xA1, 0x18, 0x10, 0x42, 0x45, 0x55, 0x20, 0x09, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, + { "tetkiwam", { 0x3C, 0x11, 0x10, 0x42, 0x47, 0x43, 0x31, 0x09, 0x10, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0x3C, 0x11, 0x10, 0x42, 0x47, 0x43, 0x31, 0x09, 0x10, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, + { "keyboard", { 0x32, 0x7E, 0x10, 0x42, 0x45, 0x42, 0x30, 0x09, 0x10, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0x32, 0x7E, 0x10, 0x42, 0x45, 0x42, 0x30, 0x09, 0x10, 0x00, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, 0xF0, 0x4A, 0x0C, 0x0C, 0xF0, 0x4A, 0x0C, 0x0C, 0x18, 0x09, 0x01, 0x20, 0x02, 0x00, 0x3C, 0x00, 0x32, 0x00, 0x00, 0x00, 0x18, 0x09, 0x01, 0x20, 0x02, 0x00, 0x3C, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } +}; + +static NVRAM_HANDLER( naomi_eeproms ) +{ + if (read_or_write) + { + /* JVS 'eeprom' */ + mame_fwrite(file,maple0x86data1,0x80); + + + // mainboard eeprom? + eeprom_save(file); + + } + else + { + eeprom_init(machine, &eeprom_interface_93C46); + if (file) + { + UINT8 tmp[0x80]; + + /* JVS 'eeprom' */ + mame_fread(file,maple0x86data1,0x80); + + mame_fread(file,&tmp,0x80); + eeprom_set_data((UINT8 *)tmp, 0x80); + + // mainboard eeprom? + eeprom_load(file); + + } + else + { + // int a; + + UINT32 length, size; + UINT8 *dat; + const UINT8* jvseeprom_default = NULL; + int i; + + dat = (UINT8 *)eeprom_get_data_pointer(&length, &size); + memset(dat, 0, length * size); + + // mainboard eeprom? + eeprom_set_data((UINT8 *)"\011\241 0000000000000000", 48); // 2*checksum 30*unknown 16*serial + + // some games require defaults to boot (vertical, 1 player etc.) + for (i=0; igamedrv->name, jvseeprom_default_game[i].name)) + { + jvseeprom_default = jvseeprom_default_game[i].eeprom; + break; + } + + if (jvseeprom_default) + memcpy(maple0x86data1, jvseeprom_default, 0x80); + + #if 0 + /* JVS 'eeprom' */ + for (a=0;a < 0x80;a++) + maple0x86data1[a]=0x11+a; + + // checksums + maple0x86data1[0]=0xb9; + maple0x86data1[1]=0xb1; + maple0x86data1[18]=0xb8; + maple0x86data1[19]=0x8a; + #endif + } + } +} + +static READ64_HANDLER( eeprom_93c46a_r ) +{ + int res; + + /* bit 3 is EEPROM data */ + res = eeprom_read_bit() << 4; + return res; +} + +static WRITE64_HANDLER( eeprom_93c46a_w ) +{ + /* bit 4 is data */ + /* bit 2 is clock */ + /* bit 5 is cs */ + eeprom_write_bit(data & 0x8); + eeprom_set_cs_line((data & 0x20) ? CLEAR_LINE : ASSERT_LINE); + eeprom_set_clock_line((data & 0x4) ? ASSERT_LINE : CLEAR_LINE); +} + +/* Dreamcast MAP + +0 0x00000000 - 0x001FFFFF MPX System/Boot ROM +0 0x00200000 - 0x0021FFFF Flash Memory +0 0x00400000 - 0x005F67FF Unassigned +0 0x005F6800 - 0x005F69FF System Control Reg. +0 0x005F6C00 - 0x005F6CFF Maple i/f Control Reg. +0 0x005F7000 - 0x005F70FF GD-ROM +0 0x005F7400 - 0x005F74FF G1 i/f Control Reg. +0 0x005F7800 - 0x005F78FF G2 i/f Control Reg. +0 0x005F7C00 - 0x005F7CFF PVR i/f Control Reg. +0 0x005F8000 - 0x005F9FFF TA / PVR Core Reg. +0 0x00600000 - 0x006007FF MODEM +0 0x00600800 - 0x006FFFFF G2 (Reserved) +0 0x00700000 - 0x00707FFF AICA- Sound Cntr. Reg. +0 0x00710000 - 0x0071000B AICA- RTC Cntr. Reg. +0 0x00800000 - 0x00FFFFFF AICA- Wave Memory +0 0x01000000 - 0x01FFFFFF Ext. Device +0 0x02000000 - 0x03FFFFFF Image Area (Mirror Area) + +1 0x04000000 - 0x04FFFFFF MPX Tex.Mem. 64bit Acc. +1 0x05000000 - 0x05FFFFFF Tex.Mem. 32bit Acc. +1 0x06000000 - 0x07FFFFFF Image Area* + +2 0x08000000 - 0x0BFFFFFF Unassigned + +3 0x0C000000 - 0x0CFFFFFF System Memory +3 0x0D000000 - 0x0DFFFFFF (Mirror on DC, Extra RAM on Naomi) + +3 0x0E000000 - 0x0FFFFFFF Image Area (Mirror Area) + +4 0x10000000 - 0x107FFFFF MPX TA FIFO Polygon Cnv. +4 0x10800000 - 0x10FFFFFF TA FIFO YUV Conv. +4 0x11000000 - 0x11FFFFFF Tex.Mem. 32/64bit Acc. +4 0x12000000 - 0x13FFFFFF Image Area (Mirror Area) + +5 0x14000000 - 0x17FFFFFF MPX Ext. + +6 0x18000000 - 0x1BFFFFFF Unassigned + +7 0x1C000000 - 0x1FFFFFFF(SH4 Internal area) + +*/ + +/* + * Common address map for Naomi 1, Naomi GD-Rom, Naomi 2, Atomiswave ... + */ + + // SB_LMMODE0 + static WRITE64_HANDLER( ta_texture_directpath0_w ) + { + int mode = pvrctrl_regs[SB_LMMODE0]&1; + if (mode&1) + { + printf("ta_texture_directpath0_w 32-bit access!\n"); + COMBINE_DATA(&dc_framebuffer_ram[offset]); + } + else + { + COMBINE_DATA(&dc_texture_ram[offset]); + } + } + + // SB_LMMODE1 + static WRITE64_HANDLER( ta_texture_directpath1_w ) + { + int mode = pvrctrl_regs[SB_LMMODE1]&1; + if (mode&1) + { + printf("ta_texture_directpath0_w 32-bit access!\n"); + COMBINE_DATA(&dc_framebuffer_ram[offset]); + } + else + { + COMBINE_DATA(&dc_texture_ram[offset]); + } + } + + +/* + * Naomi 1 address map + */ + +static ADDRESS_MAP_START( naomi_map, ADDRESS_SPACE_PROGRAM, 64 ) + /* Area 0 */ + AM_RANGE(0x00000000, 0x001fffff) AM_ROM AM_SHARE(3) AM_REGION("maincpu", 0) // BIOS + AM_RANGE(0xa0000000, 0xa01fffff) AM_ROM AM_SHARE(3) // non cachable access to 0x00000000 - 0x001fffff + + AM_RANGE(0x00200000, 0x00207fff) AM_RAM // bios uses it (battery backed ram ?) + AM_RANGE(0x005f6800, 0x005f69ff) AM_READWRITE( dc_sysctrl_r, dc_sysctrl_w ) + AM_RANGE(0x005f6c00, 0x005f6cff) AM_READWRITE( dc_maple_r, dc_maple_w ) + AM_RANGE(0x005f7000, 0x005f70ff) AM_DEVREADWRITE("rom_board", naomibd_r, naomibd_w) + AM_RANGE(0x005f7400, 0x005f74ff) AM_READWRITE( dc_g1_ctrl_r, dc_g1_ctrl_w ) + AM_RANGE(0x005f7800, 0x005f78ff) AM_READWRITE( dc_g2_ctrl_r, dc_g2_ctrl_w ) + AM_RANGE(0x005f7c00, 0x005f7cff) AM_READWRITE( pvr_ctrl_r, pvr_ctrl_w ) + AM_RANGE(0x005f8000, 0x005f9fff) AM_READWRITE( pvr_ta_r, pvr_ta_w ) + AM_RANGE(0x00600000, 0x006007ff) AM_READWRITE( dc_modem_r, dc_modem_w ) + AM_RANGE(0x00700000, 0x00707fff) AM_DEVREADWRITE( "aica", dc_aica_reg_r, dc_aica_reg_w ) + AM_RANGE(0x00710000, 0x0071000f) AM_READWRITE( dc_rtc_r, dc_rtc_w ) + AM_RANGE(0x00800000, 0x00ffffff) AM_READWRITE( naomi_arm_r, naomi_arm_w ) // sound RAM (8 MB) + + + AM_RANGE(0x0103ff00, 0x0103ffff) AM_READWRITE( naomi_unknown1_r, naomi_unknown1_w ) // bios uses it, actual start and end addresses not known + + /* Area 1 */ + AM_RANGE(0x04000000, 0x04ffffff) AM_RAM AM_BASE( &dc_texture_ram ) // texture memory 64 bit access + AM_RANGE(0x05000000, 0x05ffffff) AM_RAM AM_BASE( &dc_framebuffer_ram ) // apparently this actually accesses the same memory as the 64-bit texture memory access, but in a different format, keep it apart for now + + /* Area 2*/ + AM_RANGE(0x08000000, 0x0bffffff) AM_NOP // 'Unassigned' + + /* Area 3 */ + AM_RANGE(0x0c000000, 0x0dffffff) AM_RAM AM_BASE(&naomi_ram64) AM_SHARE(4) + AM_RANGE(0x0e000000, 0x0fffffff) AM_RAM AM_SHARE(4)// mirror + + AM_RANGE(0x8c000000, 0x8dffffff) AM_RAM AM_SHARE(4) // RAM access through cache + + /* Area 4 */ + AM_RANGE(0x10000000, 0x107fffff) AM_WRITE( ta_fifo_poly_w ) + AM_RANGE(0x10800000, 0x10ffffff) AM_WRITE( ta_fifo_yuv_w ) + AM_RANGE(0x11000000, 0x11ffffff) AM_WRITE( ta_texture_directpath0_w ) // access to texture / fraembfufer memory (either 32-bit or 64-bit area depending on SB_LMMODE0 register - cannot be written directly, only through dma / store queue + /* 0x12000000 -0x13ffffff Mirror area of 0x10000000 -0x11ffffff */ + AM_RANGE(0x12000000, 0x127fffff) AM_WRITE( ta_fifo_poly_w ) + AM_RANGE(0x12800000, 0x12ffffff) AM_WRITE( ta_fifo_yuv_w ) + AM_RANGE(0x13000000, 0x13ffffff) AM_WRITE( ta_texture_directpath1_w ) // access to texture / fraembfufer memory (either 32-bit or 64-bit area depending on SB_LMMODE1 register - cannot be written directly, only through dma / store queue + + /* Area 5 */ + //AM_RANGE(0x14000000, 0x17ffffff) AM_NOP // MPX Ext. + + /* Area 6 */ + //AM_RANGE(0x18000000, 0x1bffffff) AM_NOP // Unassigned + + /* Area 7 */ + //AM_RANGE(0x1c000000, 0x1fffffff) AM_NOP // SH4 Internal +ADDRESS_MAP_END + + +static ADDRESS_MAP_START( naomi_port, ADDRESS_SPACE_IO, 64 ) + AM_RANGE(0x00, 0x0f) AM_READWRITE(eeprom_93c46a_r, eeprom_93c46a_w) +ADDRESS_MAP_END + + +/* + * Atomiswave address map, identical to Dreamcast + */ + +static ADDRESS_MAP_START( aw_map, ADDRESS_SPACE_PROGRAM, 64 ) + /* Area 0 */ + AM_RANGE(0x00000000, 0x001fffff) AM_ROM AM_SHARE(3) AM_REGION("maincpu", 0) // BIOS + AM_RANGE(0xa0000000, 0xa01fffff) AM_ROM AM_SHARE(3) // non cachable access to 0x00000000 - 0x001fffff + + AM_RANGE(0x00200000, 0x00207fff) AM_RAM // bios uses it (battery backed ram ?) + AM_RANGE(0x005f6800, 0x005f69ff) AM_READWRITE( dc_sysctrl_r, dc_sysctrl_w ) + AM_RANGE(0x005f6c00, 0x005f6cff) AM_READWRITE( dc_maple_r, dc_maple_w ) + AM_RANGE(0x005f7000, 0x005f70ff) AM_DEVREADWRITE("rom_board", naomibd_r, naomibd_w) + AM_RANGE(0x005f7400, 0x005f74ff) AM_READWRITE( dc_g1_ctrl_r, dc_g1_ctrl_w ) + AM_RANGE(0x005f7800, 0x005f78ff) AM_READWRITE( dc_g2_ctrl_r, dc_g2_ctrl_w ) + AM_RANGE(0x005f7c00, 0x005f7cff) AM_READWRITE( pvr_ctrl_r, pvr_ctrl_w ) + AM_RANGE(0x005f8000, 0x005f9fff) AM_READWRITE( pvr_ta_r, pvr_ta_w ) + AM_RANGE(0x00600000, 0x006007ff) AM_READWRITE( dc_modem_r, dc_modem_w ) + AM_RANGE(0x00700000, 0x00707fff) AM_DEVREADWRITE( "aica", dc_aica_reg_r, dc_aica_reg_w ) + AM_RANGE(0x00710000, 0x0071000f) AM_READWRITE( dc_rtc_r, dc_rtc_w ) + AM_RANGE(0x00800000, 0x00ffffff) AM_READWRITE( naomi_arm_r, naomi_arm_w ) // sound RAM (8 MB) + + + AM_RANGE(0x0103ff00, 0x0103ffff) AM_READWRITE( naomi_unknown1_r, naomi_unknown1_w ) // bios uses it, actual start and end addresses not known + + /* Area 1 - half the texture memory, like dreamcast, not naomi */ + AM_RANGE(0x04000000, 0x047fffff) AM_RAM AM_MIRROR(0x00800000) AM_BASE( &dc_texture_ram ) // texture memory 64 bit access + AM_RANGE(0x05000000, 0x057fffff) AM_RAM AM_MIRROR(0x00800000) AM_BASE( &dc_framebuffer_ram ) // apparently this actually accesses the same memory as the 64-bit texture memory access, but in a different format, keep it apart for now + + /* Area 2*/ + AM_RANGE(0x08000000, 0x0bffffff) AM_NOP // 'Unassigned' + + /* Area 3 */ + AM_RANGE(0x0c000000, 0x0cffffff) AM_RAM AM_BASE(&naomi_ram64) AM_SHARE(4) + AM_RANGE(0x0d000000, 0x0dffffff) AM_RAM AM_SHARE(4)// extra ram on Naomi (mirror on DC) + AM_RANGE(0x0e000000, 0x0effffff) AM_RAM AM_SHARE(4)// mirror + AM_RANGE(0x0f000000, 0x0fffffff) AM_RAM AM_SHARE(4)// mirror + + AM_RANGE(0x8c000000, 0x8cffffff) AM_RAM AM_SHARE(4) // RAM access through cache + AM_RANGE(0x8d000000, 0x8dffffff) AM_RAM AM_SHARE(4) // RAM access through cache + + /* Area 4 - half the texture memory, like dreamcast, not naomi */ + AM_RANGE(0x10000000, 0x107fffff) AM_WRITE( ta_fifo_poly_w ) + AM_RANGE(0x10800000, 0x10ffffff) AM_WRITE( ta_fifo_yuv_w ) + AM_RANGE(0x11000000, 0x117fffff) AM_WRITE( ta_texture_directpath0_w ) AM_MIRROR(0x00800000) // access to texture / fraembfufer memory (either 32-bit or 64-bit area depending on SB_LMMODE0 register - cannot be written directly, only through dma / store queue + /* 0x12000000 -0x13ffffff Mirror area of 0x10000000 -0x11ffffff */ + AM_RANGE(0x12000000, 0x127fffff) AM_WRITE( ta_fifo_poly_w ) + AM_RANGE(0x12800000, 0x12ffffff) AM_WRITE( ta_fifo_yuv_w ) + AM_RANGE(0x13000000, 0x137fffff) AM_WRITE( ta_texture_directpath1_w ) AM_MIRROR(0x00800000) // access to texture / fraembfufer memory (either 32-bit or 64-bit area depending on SB_LMMODE1 register - cannot be written directly, only through dma / store queue + + + /* Area 5 */ + //AM_RANGE(0x14000000, 0x17ffffff) AM_NOP // MPX Ext. + + /* Area 6 */ + //AM_RANGE(0x18000000, 0x1bffffff) AM_NOP // Unassigned + + /* Area 7 */ + //AM_RANGE(0x1c000000, 0x1fffffff) AM_NOP // SH4 Internal +ADDRESS_MAP_END + +/* + * Aica + */ +static void aica_irq(const device_config *device, int irq) +{ + cputag_set_input_line(device->machine, "soundcpu", ARM7_FIRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE); +} + + +static const aica_interface aica_config = +{ + TRUE, + 0, + aica_irq +}; + + + +static ADDRESS_MAP_START( dc_audio_map, ADDRESS_SPACE_PROGRAM, 32 ) + ADDRESS_MAP_UNMAP_HIGH + AM_RANGE(0x00000000, 0x007fffff) AM_RAM AM_BASE( &dc_sound_ram ) /* shared with SH-4 */ + AM_RANGE(0x00800000, 0x00807fff) AM_DEVREADWRITE("aica", dc_arm_aica_r, dc_arm_aica_w) +ADDRESS_MAP_END + +/* +* Input ports +*/ + +#define NAOMI_MAME_DEBUG_DIP \ + PORT_START("MAMEDEBUG") \ + PORT_DIPNAME( 0x01, 0x00, "Bilinear Filtering" ) \ + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) \ + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) \ + + +/* for now we hardwire a joystick + 6 buttons for every game.*/ +static INPUT_PORTS_START( naomi ) + PORT_START("IN0") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Service") + PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW ) + PORT_START("IN1") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) + PORT_START("IN2") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) + PORT_START("IN3") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START2 ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) + PORT_START("IN4") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_PLAYER(2) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(2) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(2) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) + + PORT_START("COINS") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(dc_coin_slots_callback, &dc_coin_counts[0]) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_CHANGED(dc_coin_slots_callback, &dc_coin_counts[1]) + + NAOMI_MAME_DEBUG_DIP +INPUT_PORTS_END + +/* JVS mahjong panel */ +static INPUT_PORTS_START( naomi_mp ) + PORT_START("IN0") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Service") + PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW ) + PORT_START("IN1") + PORT_DIPNAME( 0x01, 0x00, "SYSA" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + PORT_START("IN2") + PORT_DIPNAME( 0x01, 0x00, "SYSB" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + PORT_START("IN3") + PORT_DIPNAME( 0x01, 0x00, "SYSC" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + PORT_START("IN4") + PORT_DIPNAME( 0x01, 0x00, "SYSD" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + + PORT_START("COINS") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(dc_coin_slots_callback, &dc_coin_counts[0]) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_CHANGED(dc_coin_slots_callback, &dc_coin_counts[1]) + + NAOMI_MAME_DEBUG_DIP +INPUT_PORTS_END + +static MACHINE_RESET( naomi ) +{ + MACHINE_RESET_CALL(dc); + aica_set_ram_base(devtag_get_device(machine, "aica"), dc_sound_ram, 8*1024*1024); +} + +/* + * Common for Naomi 1, Naomi GD-Rom, Naomi 2, Atomiswave ... + */ + +static MACHINE_DRIVER_START( naomi_base ) + /* basic machine hardware */ + MDRV_CPU_ADD("maincpu", SH4, CPU_CLOCK) // SH4!!! + MDRV_CPU_CONFIG(sh4cpu_config) + MDRV_CPU_PROGRAM_MAP(naomi_map) + MDRV_CPU_IO_MAP(naomi_port) + MDRV_CPU_VBLANK_INT("screen", naomi_vblank) + + MDRV_CPU_ADD("soundcpu", ARM7, ((XTAL_33_8688MHz*2)/3)/8) // AICA bus clock is 2/3rds * 33.8688. ARM7 gets 1 bus cycle out of each 8. + MDRV_CPU_PROGRAM_MAP(dc_audio_map) + + MDRV_MACHINE_START( dc ) + MDRV_MACHINE_RESET( naomi ) + + MDRV_NVRAM_HANDLER(naomi_eeproms) + + /* video hardware */ + MDRV_SCREEN_ADD("screen", RASTER) + MDRV_SCREEN_REFRESH_RATE(60) + MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) + MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) + MDRV_SCREEN_SIZE(640, 480) + MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) + + MDRV_PALETTE_LENGTH(0x1000) + + MDRV_VIDEO_START(dc) + MDRV_VIDEO_UPDATE(dc) + + MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MDRV_SOUND_ADD("aica", AICA, 0) + MDRV_SOUND_CONFIG(aica_config) + MDRV_SOUND_ROUTE(0, "lspeaker", 2.0) + MDRV_SOUND_ROUTE(1, "rspeaker", 2.0) +MACHINE_DRIVER_END + +/* + * Naomi 1 + */ + +static MACHINE_DRIVER_START( naomi ) + MDRV_IMPORT_FROM(naomi_base) + MDRV_NAOMI_ROM_BOARD_ADD("rom_board", "user1") +MACHINE_DRIVER_END + +/* + * Naomi 1 GD-Rom + */ + +static MACHINE_DRIVER_START( naomigd ) + MDRV_IMPORT_FROM(naomi_base) + MDRV_NAOMI_DIMM_BOARD_ADD("rom_board", "gdrom", "user1", "picreturn") +MACHINE_DRIVER_END + +/* + * Naomi 2 + */ + +// ... + +/* + * Naomi 2 GD-Rom + */ + +// ... + +/* + * Atomiswave + */ + +static MACHINE_DRIVER_START( aw ) + MDRV_IMPORT_FROM(naomi) + MDRV_CPU_MODIFY("maincpu") + MDRV_CPU_PROGRAM_MAP(aw_map) +MACHINE_DRIVER_END + +#define ROM_LOAD16_WORD_SWAP_BIOS(bios,name,offset,length,hash) \ + ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_BIOS(bios+1)) /* Note '+1' */ + +/* BIOS info: + +Revisions A through C can handle game carts only +Revisions D and later can also handle GD-Rom board +Revisions F and later can also handle GD-Rom board and or the network GD-Rom board + +F355 has it's own BIOS (3 screen version) and different JVS I/O Board + +Info from roms starting at 0x1ffd60 + +EPR-21576h - NAOMI BOOT ROM 2002 07/08 1.8- (Japan) +EPR-21576g - NAOMI BOOT ROM 2001 09/10 1.70 (Japan) +EPR-21576e - NAOMI BOOT ROM 2000 08/25 1.50 (Japan) +EPR-21576d - NAOMI BOOT ROM 1999 06/04 1.40 (Japan) +EPR-21576b - NAOMI BOOT ROM 1999 02/15 1.20 (Japan) +EPR-21576 - NAOMI BOOT ROM 1998 12/18 1.00 (Japan) +EPR-21577g - NAOMI BOOT ROM 2001 09/10 1.70 (USA) +EPR-21577e - NAOMI BOOT ROM 2000 08/25 1.50 (USA) +EPR-21577d - NAOMI BOOT ROM 1999 06/04 1.40 (USA) +EPR-21578e - NAOMI BOOT ROM 2000 08/25 1.50 (Export) +EPR-21578d - NAOMI BOOT ROM 1999 06/04 1.40 (Export) +EPR-21578b - NAOMI BOOT ROM 1999 02/15 1.20 (Export) +EPR-21579 - No known dump (Korea) +EPR-21580 - No known dump (Australia) +EPR-22851 - NAOMI BOOT ROM 1999 08/30 1.35 (Multisystem 3 screen Ferrari F355) + +EPR-21577e & EPR-2178e differ by 7 bytes: + +0x53e20 is the region byte (only one region byte) +0x1ffffa-0x1fffff is the BIOS checksum + + +House of the Dead 2 specific Naomi BIOS roms: + +Info from roms starting at 0x1ff060 + +EPR-21330 - HOUSE OF THE DEAD 2 IPL ROM 1998 11/14 (USA) +EPR-21331 - HOUSE OF THE DEAD 2 IPL ROM 1998 11/14 (Export) + +EPR-21330 & EPR-21331 differ by 7 bytes: + +0x40000 is the region byte (only one region byte) +0x1ffffa-0x1fffff is the BIOS checksum + + +Ferrari F355 specific Naomi BIOS roms: + +EPR-22850 - NAOMI BOOT ROM 1999 08/30 1.35 (USA) +EPR-22851 - NAOMI BOOT ROM 1999 08/30 1.35 (Export) + +EPR-22850 & EPR-22851 differ by 7 bytes: + +0x52F08 is the region byte (only one region byte) +0x1ffffa-0x1fffff is the BIOS checksum + + +Region byte encoding is as follows: + +0x00 = Japan +0x01 = USA +0x02 = Export +0x?? = Korea +0x?? = Australia + +Scan ROM for the text string "LOADING TEST MODE NOW" back up four (4) bytes for the region byte. + NOTE: this doesn't work for the HOTD2 or multi screen boot roms + +*/ +// game specific bios roms quite clearly don't belong in here. +// Japan bios is default, because most games require it. +/* bios e works, the newer japan one gives 'board malfunction' with some games?' */ +#define NAOMI_BIOS \ + ROM_SYSTEM_BIOS( 0, "bios0", "epr-21576e (Japan)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 0, "epr-21576e.bin", 0x000000, 0x200000, CRC(08c0add7) SHA1(e7c1a7673cb2ccb21748ef44105e46d1bad7266d) ) \ + ROM_SYSTEM_BIOS( 1, "bios1", "epr-21576g (Japan)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 1, "epr-21576g.bin", 0x000000, 0x200000, CRC(d2a1c6bf) SHA1(6d27d71aec4dfba98f66316ae74a1426d567698a) ) \ + ROM_SYSTEM_BIOS( 2, "bios2", "epr-21576h (Japan)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 2, "epr-21576h.bin", 0x000000, 0x200000, CRC(d4895685) SHA1(91424d481ff99a8d3f4c45cea6d3f0eada049a6d) ) \ + ROM_SYSTEM_BIOS( 3, "bios3", "epr-21576d (Japan)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 3, "epr-21576d.bin", 0x000000, 0x200000, CRC(3b2afa7b) SHA1(d007e1d321c198a38c5baff86eb2ab84385d150a) ) \ + ROM_SYSTEM_BIOS( 4, "bios4", "epr-21576b (Japan)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 4, "epr-21576b.bin", 0x000000, 0x200000, CRC(755a6e07) SHA1(7e8b8ccfc063144d89668e7224dcd8a36c54f3b3) ) \ + ROM_SYSTEM_BIOS( 5, "bios5", "epr-21576 (Japan)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 5, "epr-21576.bin", 0x000000, 0x200000, CRC(9dad3495) SHA1(5fb66f9a2b68d120f059c72758e65d34f461044a) ) \ + ROM_SYSTEM_BIOS( 6, "bios6", "epr-21578e (Export)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 6, "epr-21578e.bin", 0x000000, 0x200000, CRC(087f09a3) SHA1(0418eb2cf9766f0b1b874a4e92528779e22c0a4a) ) \ + ROM_SYSTEM_BIOS( 7, "bios7", "epr-21578d (Export)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 7, "epr-21578d.bin", 0x000000, 0x200000, CRC(dfd5f42a) SHA1(614a0db4743a5e5a206190d6786ade24325afbfd) ) \ + ROM_SYSTEM_BIOS( 8, "bios8", "epr-21578b (Export)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 8, "epr-21578b.bin", 0x000000, 0x200000, CRC(6c9aad83) SHA1(555918de76d8dbee2a97d8a95297ef694b3e803f) ) \ + ROM_SYSTEM_BIOS( 9, "bios9", "epr-21577g (USA)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 9, "epr-21577g.bin", 0x000000, 0x200000, CRC(25f64af7) SHA1(99f9e6cc0642319bd2da492611220540add573e8) ) \ + ROM_SYSTEM_BIOS( 10, "bios10", "epr-21577e (USA)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 10, "epr-21577e.bin", 0x000000, 0x200000, CRC(cf36e97b) SHA1(b085305982e7572e58b03a9d35f17ae319c3bbc6) ) \ + ROM_SYSTEM_BIOS( 11, "bios11", "epr-21577d (USA)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 11, "epr-21577d.bin", 0x000000, 0x200000, CRC(60ddcbbe) SHA1(58b15096d269d6df617ca1810b66b47deb184958) ) \ + ROM_SYSTEM_BIOS( 12, "bios12", "Naomi Dev BIOS" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 12, "dcnaodev.bios", 0x000000, 0x080000, CRC(7a50fab9) SHA1(ef79f448e0bf735d1264ad4f051d24178822110f) ) /* This one comes from a dev / beta board. The eprom was a 27C4096 */ + +// bios for House of the Dead 2 +#define HOTD2_BIOS \ + ROM_SYSTEM_BIOS( 0, "bios0", "HOTD2 (Export)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 0, "epr-21331.bin", 0x000000, 0x200000, CRC(065f8500) SHA1(49a3881e8d76f952ef5e887200d77b4a415d47fe) ) \ + ROM_SYSTEM_BIOS( 1, "bios1", "HOTD2 (USA)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 1, "epr-21330.bin", 0x000000, 0x200000, CRC(9e3bfa1b) SHA1(b539d38c767b0551b8e7956c1ff795de8bbe2fbc) ) \ + +#define F355_BIOS \ + ROM_SYSTEM_BIOS( 0, "bios0", "Ferrari F355 (Export)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 0, "epr-22851.bin", 0x000000, 0x200000, CRC(62483677) SHA1(3e3bcacf5f972c376b569f45307ee7fd0b5031b7) ) \ + ROM_SYSTEM_BIOS( 1, "bios1", "Ferrari F355 (USA)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 1, "epr-22850.bin", 0x000000, 0x200000, CRC(28aa539d) SHA1(14485368656af80504b212da620179c49f84c1a2) ) + + +/* only revisions d and higher support the GDROM, and there is an additional bios (and SH4!) on the DIMM board for the CD Controller */ +/* bios e works, the newer japan one gives 'board malfunction' with some games?' */ +#define NAOMIGD_BIOS \ + ROM_REGION( 0x200000, "maincpu", 0) \ + ROM_SYSTEM_BIOS( 0, "bios0", "epr-21576e (Japan)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 0, "epr-21576e.bin", 0x000000, 0x200000, CRC(08c0add7) SHA1(e7c1a7673cb2ccb21748ef44105e46d1bad7266d) ) \ + ROM_SYSTEM_BIOS( 1, "bios1", "epr-21576g (Japan)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 1, "epr-21576g.bin", 0x000000, 0x200000, CRC(d2a1c6bf) SHA1(6d27d71aec4dfba98f66316ae74a1426d567698a) ) \ + ROM_SYSTEM_BIOS( 2, "bios2", "epr-21576h (Japan)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 2, "epr-21576h.bin", 0x000000, 0x200000, CRC(d4895685) SHA1(91424d481ff99a8d3f4c45cea6d3f0eada049a6d) ) \ + ROM_SYSTEM_BIOS( 3, "bios3", "epr-21576d (Japan)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 3, "epr-21576d.bin", 0x000000, 0x200000, CRC(3b2afa7b) SHA1(d007e1d321c198a38c5baff86eb2ab84385d150a) ) \ + ROM_SYSTEM_BIOS( 4, "bios4", "epr-21578e (Export)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 4, "epr-21578e.bin", 0x000000, 0x200000, CRC(087f09a3) SHA1(0418eb2cf9766f0b1b874a4e92528779e22c0a4a) ) \ + ROM_SYSTEM_BIOS( 5, "bios5", "epr-21578d (Export)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 5, "epr-21578d.bin", 0x000000, 0x200000, CRC(dfd5f42a) SHA1(614a0db4743a5e5a206190d6786ade24325afbfd) ) \ + ROM_SYSTEM_BIOS( 6, "bios6", "epr-21577g (USA)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 6, "epr-21577g.bin", 0x000000, 0x200000, CRC(25f64af7) SHA1(99f9e6cc0642319bd2da492611220540add573e8) ) \ + ROM_SYSTEM_BIOS( 7, "bios7", "epr-21577e (USA)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 7, "epr-21577e.bin", 0x000000, 0x200000, CRC(cf36e97b) SHA1(b085305982e7572e58b03a9d35f17ae319c3bbc6) ) \ + ROM_SYSTEM_BIOS( 8, "bios8", "epr-21577d (USA)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 8, "epr-21577d.bin", 0x000000, 0x200000, CRC(60ddcbbe) SHA1(58b15096d269d6df617ca1810b66b47deb184958) ) \ + ROM_REGION( 0x200000, "user2", 0) \ + ROM_LOAD16_WORD_SWAP( "fpr-23489c.ic14", 0x000000, 0x200000, CRC(bc38bea1) SHA1(b36fcc6902f397d9749e9d02de1bbb7a5e29d468) ) \ + +/* NAOMI2 BIOS: + +EPR-23605 - NAOMI BOOT ROM 2001 01/19 1.50 (Japan) +EPR-23605A - NAOMI BOOT ROM 2001 06/20 1.60 (Japan) +EPR-23605B - NAOMI BOOT ROM 2001 09/10 1.70 (Japan) +EPR-23605C - NAOMI BOOT ROM 2002 07/08 1.8- (Japan) +EPR-23607 - NAOMI BOOT ROM 2001 01/19 1.50 (USA) +EPR-23607B - NAOMI BOOT ROM 2001 09/10 1.70 (USA) +EPR-23608 - NAOMI BOOT ROM 2001 01/19 1.50 (Export) +EPR-23608B - NAOMI BOOT ROM 2001 09/10 1.70 (Export) + +EPR-23605B, EPR-23607B & EPR-23608B all differ by 8 bytes: + +0x0553a0 is the first region byte +0x1ecf40 is a second region byte (value is the same as the first region byte ) +0x1fffa-1ffff is the BIOS rom checksum + +Region byte encoding is as follows: + +0x00 = Japan +0x01 = USA +0x02 = Export +0x?? = Korea +0x?? = Australia + +*/ + +#define NAOMI2_BIOS \ + ROM_REGION( 0x200000, "maincpu", 0) \ + ROM_SYSTEM_BIOS( 0, "bios0", "epr-23605c (Japan)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 0, "epr-23605c.bin", 0x000000, 0x200000, CRC(297ea6ed) SHA1(cfbfe57c80e6ee86a101fa83aec0a01e00c0f42a) ) \ + ROM_SYSTEM_BIOS( 1, "bios1", "epr-23605b (Japan)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 1, "epr-23605b.bin", 0x000000, 0x200000, CRC(3a3242d4) SHA1(aaca4df51ef91d926f8191d372f3dfe1d20d9484) ) \ + ROM_SYSTEM_BIOS( 2, "bios2", "epr-23605a (Japan)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 2, "epr-23605a.bin", 0x000000, 0x200000, CRC(7bc3fc2d) SHA1(a4a9531a7c66ff30046908cf71f6c7b6fb59c392) ) \ + ROM_SYSTEM_BIOS( 3, "bios3", "epr-23605 (Japan)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 3, "epr-23605.bin", 0x000000, 0x200000, CRC(5731e446) SHA1(787b0844fc408cf124c12405c095c59948709ea6) ) \ + ROM_SYSTEM_BIOS( 4, "bios4", "epr-23608b (Export)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 4, "epr-23608b.bin", 0x000000, 0x200000, CRC(a554b1e3) SHA1(343b727a3619d1c75a9b6d4cc156a9050447f155) ) \ + ROM_SYSTEM_BIOS( 5, "bios5", "epr-23608 (Export)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 5, "epr-23608.bin", 0x000000, 0x200000, CRC(929cc3a6) SHA1(47d00c818de23f733a4a33b1bbc72eb8aa729246) ) \ + ROM_SYSTEM_BIOS( 6, "bios6", "epr-23607b (USA)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 6, "epr-23607b.bin", 0x000000, 0x200000, CRC(f308c5e9) SHA1(5470ab1cee6afecbd8ca8cf40f8fbe4ec2cb1471) ) \ + ROM_SYSTEM_BIOS( 7, "bios7", "epr-23607 (USA)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 7, "epr-23607.bin", 0x000000, 0x200000, CRC(2b55add2) SHA1(547de5f97d3183c8cd069c4fa3c09f13d8b637d9) ) \ + +/* this is one flashrom, however the second half looks like it's used for game settings, may differ between dumps, and may not be needed / could be blanked */ +#define AW_BIOS \ + ROM_SYSTEM_BIOS( 0, "bios0", "Atomiswave BIOS" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 0, "bios.ic23_l", 0x000000, 0x010000, BAD_DUMP CRC(e5693ce3) SHA1(1bde3ed87af64b0f675ebd47f12a53e1fc5709c1) ) /* Might be bad.. especially. bytes 0x0000, 0x6000, 0x8000 which gave different reads */ \ + ROM_LOAD16_WORD_SWAP_BIOS( 0, "bios.ic23_h-dolphin_blue_settings", 0x010000, 0x010000, BAD_DUMP CRC(5d5687c7) SHA1(2600ce09c44872d1793f6b55bf44342673da5ad1) ) /* it appears to flash settings game data here */ /* this is one flashrom, however the second half looks like it's used for game settings, may differ between dumps, and may not be needed / could be blanked */ + + +ROM_START( naomi ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0x8400000, "user1", ROMREGION_ERASE) +ROM_END + +ROM_START( naomigd ) + NAOMIGD_BIOS + + ROM_REGION( 0x8400000, "user1", ROMREGION_ERASE) +ROM_END + +ROM_START( hod2bios ) + ROM_REGION( 0x200000, "maincpu", 0) + HOTD2_BIOS + + ROM_REGION( 0x8400000, "user1", ROMREGION_ERASE) +ROM_END + +ROM_START( f355bios ) + ROM_REGION( 0x200000, "maincpu", 0) + F355_BIOS + + ROM_REGION( 0x8400000, "user1", ROMREGION_ERASE) +ROM_END + +ROM_START( naomi2 ) + NAOMI2_BIOS + + ROM_REGION( 0x8400000, "user1", ROMREGION_ERASE) +ROM_END + +ROM_START( awbios ) + ROM_REGION( 0x200000, "maincpu", 0) + AW_BIOS + + ROM_REGION( 0x8400000, "user1", ROMREGION_ERASE) +ROM_END + + +/********************************************** + * + * Naomi Cart ROM defines + * + *********************************************/ + + +/* Info above each set is automatically generated from the IC22 rom and may not be accurate */ + +/* +SYSTEMID: NAOMI +JAP: GUN SPIKE +USA: CANNON SPIKE +EXP: CANNON SPIKE + +NO. Type Byte Word +IC22 32M 0000* 0000* invalid value +IC1 64M 7AC6 C534 +IC2 64M 3959 6667 +IC3 64M F60D 69E5 +IC4 64M FBD4 AE40 +IC5 64M 1717 F3EC +IC6 64M A622 1D3D +IC7 64M 33A3 4480 +IC8 64M FC26 A49D +IC9 64M 528D 5206 +IC10 64M 7C94 8779 +IC11 64M 271E BEF7 +IC12 64M BA24 102F +*/ + +ROM_START( cspike ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0x6800000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-23210.ic22", 0x0000000, 0x0400000, CRC(a15c54b5) SHA1(5c7872244d3d648e4c04751f120d0e9d47239921) ) + ROM_RELOAD( 0x400000, 0x400000) + ROM_LOAD("mpr-23198.ic1", 0x0800000, 0x0800000, CRC(ce8d3edf) SHA1(1df5bb4eb440c221b8f1e5f019b02accc235fc28) ) + ROM_LOAD("mpr-23199.ic2", 0x1000000, 0x0800000, CRC(0979392a) SHA1(7dc433da6f3e47a721a2e86720a65d9752248e92) ) + ROM_LOAD("mpr-23200.ic3", 0x1800000, 0x0800000, CRC(e4b2db33) SHA1(063bc3789f68be5fcefeeec9e1c8268feb84b7eb) ) + ROM_LOAD("mpr-23201.ic4", 0x2000000, 0x0800000, CRC(c55ca0fa) SHA1(e6fde606b9ed4fd195da304a7b57e8b7797e368f) ) + ROM_LOAD("mpr-23202.ic5", 0x2800000, 0x0800000, CRC(983bb21c) SHA1(a30f9b09370cceadf11defc85b5acd3e578477e0) ) + ROM_LOAD("mpr-23203.ic6", 0x3000000, 0x0800000, CRC(f61b8d96) SHA1(a3522963b1e13b809818ffe5a209dd4ce087ec38) ) + ROM_LOAD("mpr-23204.ic7", 0x3800000, 0x0800000, CRC(03593ecd) SHA1(5ef3ccbfb7b1cc85ad352b13d70eefcad2b209f6) ) + ROM_LOAD("mpr-23205.ic8", 0x4000000, 0x0800000, CRC(e8c9349b) SHA1(310f02c5dad84e84362f0f674afa405f7d72f8ce) ) + ROM_LOAD("mpr-23206.ic9", 0x4800000, 0x0800000, CRC(8089d80f) SHA1(821f5f24616920bf0ed4c86597c27f6a3c39b8e6) ) + ROM_LOAD("mpr-23207.ic10", 0x5000000, 0x0800000, CRC(39f692a1) SHA1(14bc86b48a995378b4dd3609d38b90cddf2d7483) ) + ROM_LOAD("mpr-23208.ic11", 0x5800000, 0x0800000, CRC(b9494f4b) SHA1(2f35b25edf5210a82d4b67e639eeae11440d065a) ) + ROM_LOAD("mpr-23209.ic12s",0x6000000, 0x0800000, CRC(560188c0) SHA1(77f14c9a031c6e5414ffa854d20c40115361d715) ) +ROM_END + +/* + +SYSTEMID: NAOMI +JAP: CAPCOM VS SNK JAPAN +USA: CAPCOM VS SNK USA +EXP: CAPCOM VS SNK EXPORT + +NO. Type Byte Word +IC22 32M 0000 0000 +IC1 64M B836 4AA4 +IC2 64M 19C1 9965 +IC3 64M B98C EFB2 +IC4 64M 2458 31CD +IC5 64M 59D2 E957 +IC6 64M 1004 7E0B +IC7 64M C63F B2A7 +IC8 64M 9D78 342F +IC9 64M 681F D97A +IC10 64M 7544 E4D3 +IC11 64M 8351 8A4C +IC12 64M B713 2408 +IC13 64M A12E 8DE4 + +*/ + +ROM_START( capsnk ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0x7000000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-23511a.ic22", 0x00000, 0x400000, CRC(fe00650f) SHA1(ca8e9e9178ed2b6598bdea83be1bf0dd7aa509f9) ) + ROM_LOAD("ic1", 0x0800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic2", 0x1000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic3", 0x1800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic4", 0x2000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic5", 0x2800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic6", 0x3000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic7", 0x3800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic8", 0x4000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic9", 0x4800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic10",0x5000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic11",0x5800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic12",0x6000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic13",0x6800000, 0x0800000, NO_DUMP ) +ROM_END + +/* + +SYSTEMID: NAOMI +JAP: COSMIC SMASH IN JAPAN +USA: COSMIC SMASH IN USA +EXP: COSMIC SMASH IN EXPORT + +NO. Type Byte Word +IC22 32M 0000 0000 EPR23428A.22 +IC1 64M C82B E769 MPR23420.1 +IC2 64M E0C3 43B6 MPR23421.2 +IC3 64M C896 F766 MPR23422.3 +IC4 64M 2E60 4CBF MPR23423.4 +IC5 64M BB81 7E26 MPR23424.5 +IC6 64M B3A8 F2EA MPR23425.6 +IC7 64M 05C5 A084 MPR23426.7 +?IC8 64M 9E13 7535 MPR23427.8 + +Serial: BCHE-01A0803 + +*/ + +ROM_START( csmash ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0x4800000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-23428a.ic22", 0x0000000, 0x400000, CRC(d628dbce) SHA1(91ec1296ead572a64c37f8ac2c1a96742f19d50b) ) + ROM_RELOAD( 0x400000, 0x400000) + ROM_LOAD("mpr-23420.ic1", 0x0800000, 0x0800000, CRC(9d5991f2) SHA1(c75871db314b01935d1daaacf1a762e73e5fd411) ) + ROM_LOAD("mpr-23421.ic2", 0x1000000, 0x0800000, CRC(6c351db3) SHA1(cdd601321a38fc34152517abdc473b73a4c6f630) ) + ROM_LOAD("mpr-23422.ic3", 0x1800000, 0x0800000, CRC(a1d4bd29) SHA1(6c446fd1819f55412351f15cf57b769c0c56c1db) ) + ROM_LOAD("mpr-23423.ic4", 0x2000000, 0x0800000, CRC(08cbf373) SHA1(0d9a593f5cc5d632d85d7253c135eef2e8e01598) ) + ROM_LOAD("mpr-23424.ic5", 0x2800000, 0x0800000, CRC(f4404000) SHA1(e49d941e47e63bb7f3fddc3c3d2c1653611914ee) ) + ROM_LOAD("mpr-23425.ic6", 0x3000000, 0x0800000, CRC(47f51da2) SHA1(af5ecd460114caed3a00157ffd3a2df0fbf348c0) ) + ROM_LOAD("mpr-23426.ic7", 0x3800000, 0x0800000, CRC(7f91b13f) SHA1(2d534f77291ebfedc011bf0e803a1b9243fb477f) ) + ROM_LOAD("mpr-23427.ic8", 0x4000000, 0x0800000, CRC(5851d525) SHA1(1cb1073542d75a3bcc0d363ed31d49bcaf1fd494) ) +ROM_END + +ROM_START( csmasho ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0x4800000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-23428.ic22", 0x0000000, 0x400000, CRC(f8597496) SHA1(2bb9f25b63b7410934ae4b1e052e1308a5c5a57f) ) + ROM_RELOAD( 0x400000, 0x400000) + ROM_LOAD("mpr-23420.ic1", 0x0800000, 0x0800000, CRC(9d5991f2) SHA1(c75871db314b01935d1daaacf1a762e73e5fd411) ) + ROM_LOAD("mpr-23421.ic2", 0x1000000, 0x0800000, CRC(6c351db3) SHA1(cdd601321a38fc34152517abdc473b73a4c6f630) ) + ROM_LOAD("mpr-23422.ic3", 0x1800000, 0x0800000, CRC(a1d4bd29) SHA1(6c446fd1819f55412351f15cf57b769c0c56c1db) ) + ROM_LOAD("mpr-23423.ic4", 0x2000000, 0x0800000, CRC(08cbf373) SHA1(0d9a593f5cc5d632d85d7253c135eef2e8e01598) ) + ROM_LOAD("mpr-23424.ic5", 0x2800000, 0x0800000, CRC(f4404000) SHA1(e49d941e47e63bb7f3fddc3c3d2c1653611914ee) ) + ROM_LOAD("mpr-23425.ic6", 0x3000000, 0x0800000, CRC(47f51da2) SHA1(af5ecd460114caed3a00157ffd3a2df0fbf348c0) ) + ROM_LOAD("mpr-23426.ic7", 0x3800000, 0x0800000, CRC(7f91b13f) SHA1(2d534f77291ebfedc011bf0e803a1b9243fb477f) ) + ROM_LOAD("mpr-23427.ic8", 0x4000000, 0x0800000, CRC(5851d525) SHA1(1cb1073542d75a3bcc0d363ed31d49bcaf1fd494) ) +ROM_END + +/* + +SYSTEMID: NAOMI +JAP: DEATH CRIMSON OX +USA: DEATH CRIMSON OX +EXP: DEATH CRIMSON OX + +*/ + +ROM_START( deathcox ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0x5800000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-23524.ic22",0x0000000, 0x0400000, CRC(edc20e44) SHA1(6167ee86624f5b78b3ced0dd82259e83053f4f9d) ) + ROM_RELOAD( 0x400000, 0x400000) + ROM_LOAD("mpr-23514.ic1", 0x0800000, 0x0800000, CRC(1f2b090e) SHA1(f2863d306512112cd3025c9ce3300ac0a396ee2d) ) + ROM_LOAD("mpr-23515.ic2", 0x1000000, 0x0800000, CRC(dc8557eb) SHA1(855bf4a8a7a7184a64a60d30efd505eb1181d8c6) ) + ROM_LOAD("mpr-23516.ic3", 0x1800000, 0x0800000, CRC(94494cbb) SHA1(fc977c77fa424541573c5cac28dac013d3354754) ) + ROM_LOAD("mpr-23517.ic4", 0x2000000, 0x0800000, CRC(69ba6a41) SHA1(1d5528f7d3f8721492db966ec041966192bebdf8) ) + ROM_LOAD("mpr-23518.ic5", 0x2800000, 0x0800000, CRC(49882766) SHA1(f6a7a7039dc251e02d69d4c95130102dfbb25fc9) ) + ROM_LOAD("mpr-23519.ic6", 0x3000000, 0x0800000, CRC(cdc82805) SHA1(947cdcdc16fc61ba4ca1258d170483b3decdacf2) ) + ROM_LOAD("mpr-23520.ic7", 0x3800000, 0x0800000, CRC(1a268360) SHA1(b35dab00e4e656f13fcad92bebd2c256c1965f54) ) + ROM_LOAD("mpr-23521.ic8", 0x4000000, 0x0800000, CRC(cf8674b8) SHA1(bdd2a0ef98138021707b3dd06b1d9855308ed3ec) ) + ROM_LOAD("mpr-23522.ic9", 0x4800000, 0x0800000, CRC(7ae6716e) SHA1(658b794ae6e3898885524582a207faa1076a65ca) ) + ROM_LOAD("mpr-23523.ic10",0x5000000, 0x0800000, CRC(c91efb67) SHA1(3d79870551310da7a641858ffec3840714e9cc22) ) +ROM_END + +/* + +SYSTEMID: NAOMI +JAP: DEAD OR ALIVE 2 +USA: DEAD OR ALIVE 2 USA ------ +EXP: DEAD OR ALIVE 2 EXPORT---- + +NO. Type Byte Word +IC22 32M 2B49 A054 +IC1 64M B74A 1815 +IC2 64M 6B34 AB5A +IC3 64M 7EEF EA1F +IC4 64M 0700 8C2F +IC5 64M E365 B9CC +IC6 64M 7FE0 DC66 +IC7 64M BF8D 439B +IC8 64M 84DC 2F86 +IC9 64M 15CF 8961 +IC10 64M 7776 B985 +IC11 64M BCE9 21E9 +IC12 64M 87FA E9C0 +IC13 64M B82E 47A7 +IC14 64M 3821 846E +IC15 64M B491 C66E +IC16 64M 5774 918D +IC17 64M 219B A171 +IC18 64M 4848 643A +IC19 64M 6E1F 2570 +IC20 64M 0CED F2A8 +IC21 64M 002C 8ECA + +*/ + +ROM_START( doa2 ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0xb000000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-22121.ic22",0x0000000, 0x0400000, CRC(30f93b5e) SHA1(0e33383e7ab9a721dab4708b063598f2e9c9f2e7) ) // partially encrypted + + ROM_LOAD("mpr-22100.ic1", 0x0800000, 0x0800000, CRC(92a53e5e) SHA1(87fcdeee9c4e65a3eb6eb345eed85d4f2df26c3c) ) + ROM_LOAD("mpr-22101.ic2", 0x1000000, 0x0800000, CRC(14cd7dce) SHA1(5df14a5dad14bc922b4f88881dc2e9c8e74d6170) ) + ROM_LOAD("mpr-22102.ic3", 0x1800000, 0x0800000, CRC(34e778b1) SHA1(750ddf5cda9622dd2b0f7069d247ffd55911c38f) ) + ROM_LOAD("mpr-22103.ic4", 0x2000000, 0x0800000, CRC(6f3db8df) SHA1(e9bbcf7897594ae47a9e3c8641ccb2c09b0809fe) ) + ROM_LOAD("mpr-22104.ic5", 0x2800000, 0x0800000, CRC(fcc2787f) SHA1(c28eaf91fa64e49e2276702678a4f8f17e09c3b9) ) + ROM_LOAD("mpr-22105.ic6", 0x3000000, 0x0800000, CRC(3e2da942) SHA1(d8f28c40ab59fa96a1fb19ad3adbee687088a5ab) ) + ROM_LOAD("mpr-22106.ic7", 0x3800000, 0x0800000, CRC(03aceaaf) SHA1(977e5b660254e7c5fdbd9d52c1f00c8a174a5d7b) ) + ROM_LOAD("mpr-22107.ic8", 0x4000000, 0x0800000, CRC(6f1705e4) SHA1(b8215dd4ef7214e75c2ec79ad974a32422c17647) ) + ROM_LOAD("mpr-22108.ic9", 0x4800000, 0x0800000, CRC(d34d3d8a) SHA1(910f1e4d8a54a621d9212e1425152c3029c96234) ) + ROM_LOAD("mpr-22109.ic10",0x5000000, 0x0800000, CRC(00ef44dd) SHA1(3fd100007daf59693de2329df1b4981dcdf435cd) ) + ROM_LOAD("mpr-22110.ic11",0x5800000, 0x0800000, CRC(a193b577) SHA1(3513853f88c491905481dadc5ce00cc5819b2663) ) + ROM_LOAD("mpr-22111.ic12",0x6000000, 0x0800000, CRC(55dddebf) SHA1(a7b8702cf578f5be4dcf8e2eaf11bf8b71d1b4ad) ) + ROM_LOAD("mpr-22112.ic13",0x6800000, 0x0800000, CRC(c5ffe564) SHA1(efe4d0cb5a536b26489c6dd31b1e446a9be643c9) ) + ROM_LOAD("mpr-22113.ic14",0x7000000, 0x0800000, CRC(12e7adf0) SHA1(2755c3efc6ca6d5680ead1489f42798c0187c5a4) ) + ROM_LOAD("mpr-22114.ic15",0x7800000, 0x0800000, CRC(d181d0a0) SHA1(2a0e46dbb31f5c11b6ae2fc8c786192bf3701ec5) ) + ROM_LOAD("mpr-22115.ic16",0x8000000, 0x0800000, CRC(ee2c842d) SHA1(8e33f241300481bb8875bda37e3917be71ed2594) ) + ROM_LOAD("mpr-22116.ic17",0x8800000, 0x0800000, CRC(224ab770) SHA1(85d849ee077e36da1df759caa4a32525395f741c) ) + ROM_LOAD("mpr-22117.ic18",0x9000000, 0x0800000, CRC(884a45a9) SHA1(d947cb3a045c5463523355fa631d55148e12c31e) ) + ROM_LOAD("mpr-22118.ic19",0x9800000, 0x0800000, CRC(8d631cbf) SHA1(fe8a65d35b1cdaed650ddde931e59f0768ffff53) ) + ROM_LOAD("mpr-22119.ic20",0xa000000, 0x0800000, CRC(d608fa86) SHA1(54c8107cccec8cbb536f13cda5b220b7972190b7) ) + ROM_LOAD("mpr-22120.ic21",0xa800000, 0x0800000, CRC(a30facb4) SHA1(70415ca34095c795297486bce1f956f6a8d4817f) ) +ROM_END + +/* + +SYSTEMID: NAOMI +JAP: DEAD OR ALIVE 2 +USA: DEAD OR ALIVE 2 USA ------ +EXP: DEAD OR ALIVE 2 EXPORT---- + +NO. Type Byte Word +IC22 32M 2B49 A054 +IC1 64M B74A 1815 +IC2 64M 6B34 AB5A +IC3 64M 7EEF EA1F +IC4 64M 0700 8C2F +IC5 64M E365 B9CC +IC6 64M 7FE0 DC66 +IC7 64M BF8D 439B +IC8 64M 84DC 2F86 +IC9 64M 15CF 8961 +IC10 64M 7776 B985 +IC11 64M BCE9 21E9 +IC12 64M 87FA E9C0 +IC13 64M B82E 47A7 +IC14 64M 3821 846E +IC15 64M B491 C66E +IC16 64M 5774 918D +IC17 64M 219B A171 +IC18 64M 4848 643A +IC19 64M 6E1F 2570 +IC20 64M 0CED F2A8 +IC21 64M 002C 8ECA + +Serial: BALH-13A0175 + +*/ + +ROM_START( doa2m ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0xb000000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("doa2verm.ic22", 0x0000000, 0x0400000, CRC(94b16f08) SHA1(225cd3e5dd5f21facf0a1d5e66fa17db8497573d) ) + + ROM_LOAD("mpr-22100.ic1", 0x0800000, 0x0800000, CRC(92a53e5e) SHA1(87fcdeee9c4e65a3eb6eb345eed85d4f2df26c3c) ) + ROM_LOAD("mpr-22101.ic2", 0x1000000, 0x0800000, CRC(14cd7dce) SHA1(5df14a5dad14bc922b4f88881dc2e9c8e74d6170) ) + ROM_LOAD("mpr-22102.ic3", 0x1800000, 0x0800000, CRC(34e778b1) SHA1(750ddf5cda9622dd2b0f7069d247ffd55911c38f) ) + ROM_LOAD("mpr-22103.ic4", 0x2000000, 0x0800000, CRC(6f3db8df) SHA1(e9bbcf7897594ae47a9e3c8641ccb2c09b0809fe) ) + ROM_LOAD("mpr-22104.ic5", 0x2800000, 0x0800000, CRC(fcc2787f) SHA1(c28eaf91fa64e49e2276702678a4f8f17e09c3b9) ) + ROM_LOAD("mpr-22105.ic6", 0x3000000, 0x0800000, CRC(3e2da942) SHA1(d8f28c40ab59fa96a1fb19ad3adbee687088a5ab) ) + ROM_LOAD("mpr-22106.ic7", 0x3800000, 0x0800000, CRC(03aceaaf) SHA1(977e5b660254e7c5fdbd9d52c1f00c8a174a5d7b) ) + ROM_LOAD("mpr-22107.ic8", 0x4000000, 0x0800000, CRC(6f1705e4) SHA1(b8215dd4ef7214e75c2ec79ad974a32422c17647) ) + ROM_LOAD("mpr-22108.ic9", 0x4800000, 0x0800000, CRC(d34d3d8a) SHA1(910f1e4d8a54a621d9212e1425152c3029c96234) ) + ROM_LOAD("mpr-22109.ic10",0x5000000, 0x0800000, CRC(00ef44dd) SHA1(3fd100007daf59693de2329df1b4981dcdf435cd) ) + ROM_LOAD("mpr-22110.ic11",0x5800000, 0x0800000, CRC(a193b577) SHA1(3513853f88c491905481dadc5ce00cc5819b2663) ) + ROM_LOAD("mpr-22111.ic12",0x6000000, 0x0800000, CRC(55dddebf) SHA1(a7b8702cf578f5be4dcf8e2eaf11bf8b71d1b4ad) ) + ROM_LOAD("mpr-22112.ic13",0x6800000, 0x0800000, CRC(c5ffe564) SHA1(efe4d0cb5a536b26489c6dd31b1e446a9be643c9) ) + ROM_LOAD("mpr-22113.ic14",0x7000000, 0x0800000, CRC(12e7adf0) SHA1(2755c3efc6ca6d5680ead1489f42798c0187c5a4) ) + ROM_LOAD("mpr-22114.ic15",0x7800000, 0x0800000, CRC(d181d0a0) SHA1(2a0e46dbb31f5c11b6ae2fc8c786192bf3701ec5) ) + ROM_LOAD("mpr-22115.ic16",0x8000000, 0x0800000, CRC(ee2c842d) SHA1(8e33f241300481bb8875bda37e3917be71ed2594) ) + ROM_LOAD("mpr-22116.ic17",0x8800000, 0x0800000, CRC(224ab770) SHA1(85d849ee077e36da1df759caa4a32525395f741c) ) + ROM_LOAD("mpr-22117.ic18",0x9000000, 0x0800000, CRC(884a45a9) SHA1(d947cb3a045c5463523355fa631d55148e12c31e) ) + ROM_LOAD("mpr-22118.ic19",0x9800000, 0x0800000, CRC(8d631cbf) SHA1(fe8a65d35b1cdaed650ddde931e59f0768ffff53) ) + ROM_LOAD("mpr-22119.ic20",0xa000000, 0x0800000, CRC(d608fa86) SHA1(54c8107cccec8cbb536f13cda5b220b7972190b7) ) + ROM_LOAD("mpr-22120.ic21",0xa800000, 0x0800000, CRC(a30facb4) SHA1(70415ca34095c795297486bce1f956f6a8d4817f) ) +ROM_END + +/* + +SYSTEMID: NAOMI +JAP: DERBY OWNERS CLUB ------------ +USA: DERBY OWNERS CLUB ------------ +EXP: DERBY OWNERS CLUB IN EXPORT -- + +NO. Type Byte Word +IC22 32M 0000 0000 +IC1 64M 8AF3 D0BC +IC2 64M 1E79 0410 +IC3 64M 146D C51E +IC4 64M E9AD 86BE +IC5 64M BBB2 8685 +IC6 64M A0E1 C2E0 +IC7 64M B8CF 67B5 +IC8 64M 005E C1D6 +IC9 64M 1F53 9304 +IC10 64M FAC9 8AA4 +IC11 64M B6B1 5665 +IC12 64M 21DB 74F5 +IC13 64M A991 A8AB +IC14 64M 05BD 428D + +Serial: BAXE-02A1386 + +*/ + +ROM_START( derbyoc ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0x7800000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-22099b.ic22", 0x0000000, 0x0400000, CRC(5e708879) SHA1(fada4f4bf29fc8f77f354167f8db4f904610fe1a) ) + ROM_LOAD("mpr-22085.ic1", 0x0800000, 0x0800000, CRC(fffe9cc5) SHA1(ce6082fc648718b3831f709ba8b6212946c72d70) ) + ROM_LOAD("mpr-22086.ic2", 0x1000000, 0x0800000, CRC(610fe214) SHA1(c982d9e4722c2b6cb87f2bc3e2ac0f764f0bae79) ) + ROM_LOAD("mpr-22087.ic3", 0x1800000, 0x0800000, CRC(f0cd2a26) SHA1(21ff7d6540cfeb5e563d3528bd4bb31c5f285f1a) ) + ROM_LOAD("mpr-22088.ic4", 0x2000000, 0x0800000, CRC(62a7e6db) SHA1(103e2413c9706a5a98f05646fd3a7d7808593ad8) ) + ROM_LOAD("mpr-22089.ic5", 0x2800000, 0x0800000, CRC(cb135eb6) SHA1(a49df8fbae1ea0fb1251d0d8f302cc8687c3be0b) ) + ROM_LOAD("mpr-22090.ic6", 0x3000000, 0x0800000, CRC(13e44d57) SHA1(450fe281d34c088e61a4c2ee6ae434f330deb482) ) + ROM_LOAD("mpr-22091.ic7", 0x3800000, 0x0800000, CRC(efa1e2fc) SHA1(058635bee7a87b8191127060c6a28c053001b466) ) + ROM_LOAD("mpr-22092.ic8", 0x4000000, 0x0800000, CRC(de1ea163) SHA1(f2b0169fac3e1074628dec75642e7c41c8160964) ) + ROM_LOAD("mpr-22093.ic9", 0x4800000, 0x0800000, CRC(ecbc523b) SHA1(952618a0966838f5b814ff1265c899481aae1ba9) ) + ROM_LOAD("mpr-22094.ic10", 0x5000000, 0x0800000, CRC(72af7a70) SHA1(b1437dbf47f95bbdb9fe7a215c5a3b0f3839d917) ) + ROM_LOAD("mpr-22095.ic11", 0x5800000, 0x0800000, CRC(ae74b61a) SHA1(1c9de865447c9993d7faff2e61837e4b74353c3a) ) + ROM_LOAD("mpr-22096.ic12", 0x6000000, 0x0800000, CRC(d8c41648) SHA1(d465f4b841164da0738336e203c5bc6e1e799a76) ) + ROM_LOAD("mpr-22097.ic13", 0x6800000, 0x0800000, CRC(f1dedac5) SHA1(9d4499cbafe80dd0b36be617de7994a96e1e9a01) ) + ROM_LOAD("mpr-22098.ic14", 0x7000000, 0x0800000, CRC(f9824d2e) SHA1(f20f8cc2b1bef9077ede1cb874da8f2a335d39de) ) +ROM_END + +/* +SYSTEMID: NAOMI +JAP: DERBY OWNERS CLUB II----------- +USA: DERBY OWNERS CLUB II----------- +EXP: DERBY OWNERS CLUB II-IN EXPORT +*/ + +ROM_START( derbyoc2 ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0xb000000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-22306.ic22", 0x0000000, 0x0400000, CRC(fcac20eb) SHA1(26cec9f615cd18ce7fccfc5e273e42c58dea1995) ) + ROM_LOAD("ic1", 0x0800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic2", 0x1000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic3", 0x1800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic4", 0x2000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic5", 0x2800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic6", 0x3000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic7", 0x3800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic8", 0x4000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic9", 0x4800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic10",0x5000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic11",0x5800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic12",0x6000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic13",0x6800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic14",0x7000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic15",0x7800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic16",0x8000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic17",0x8800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic18",0x9000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic19",0x9800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic20",0xa000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic21",0xa800000, 0x0800000, NO_DUMP ) +ROM_END + +/* + +SYSTEMID: NAOMI +JAP: DYNAMITE BASEBALL NAOMI +USA: SAMPLE GAME IN USA-------- +EXP: SAMPLE GAME + +NO. Type Byte Word +IC22 16M EF41 1DBC +IC1 64M 2743 8DE9 +IC2 64M 1D2B B4D5 +IC3 64M 9127 8536 +IC4 64M 946A 851B +IC5 64M BDF4 AF2C +IC6 64M 78A2 DADB +IC7 64M 9816 06D3 +IC8 64M F8D9 9C38 +IC9 64M 3C7D 532A +IC10 64M 37A2 D3F1 +IC11 64M 5BF2 05FC +IC12 64M 694F A25A +IC13 64M 685C CDA8 +IC14 64M 3DFA 32A9 +IC15 64M 071F 820F +IC16 64M 1E89 D6B5 +IC17 64M 889C 504B +IC18 64M 8B78 1BB5 +IC19 64M 9816 7EE9 +IC20 64M E5C2 CECB +IC21 64M 5C65 8F82 + +Serial: ??? (sticker removed) + +Protection notes (same code snippet seen in Zombie Revenge): +0C0A8148: 013C MOV.B @(R0,R3),R1 +0C0A814A: 611C EXTU.B R1,R1 +0C0A814C: 31C7 CMP/GT R12,R1 +0C0A814E: 1F11 MOV.L R1,@($04,R15) +0C0A8150: 8F04 BFS $0C0A815C +0C0A8152: E500 MOV #$00,R5 +0C0A8154: D023 MOV.L @($008C,PC),R0 [0C0A81E4] +0C0A8156: 2052 MOV.L R5,@R0 +0C0A8158: AFFE BRA $0C0A8158 +0C0A815A: 0009 NOP + +*/ + +ROM_START( dybbnao ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0xb000000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-21575.ic22",0x0000000, 0x0200000, CRC(ba61e248) SHA1(3cce5d8b307038515d7da7ec567bfa2e3aafc274) ) + ROM_LOAD("mpr-21554.ic1", 0x0800000, 0x0800000, CRC(6eb29c37) SHA1(3548a93f9efa3bd548f9e30223a9b3570031f126) ) + ROM_LOAD("mpr-21555.ic2", 0x1000000, 0x0800000, CRC(3ff79959) SHA1(abd5407fcfa5556fc3f0c56892daad0c741a681f) ) + ROM_LOAD("mpr-21556.ic3", 0x1800000, 0x0800000, CRC(79bc8caf) SHA1(8cb77c66a86a99b85f2e3c8a5fed457f75598af4) ) + ROM_LOAD("mpr-21557.ic4", 0x2000000, 0x0800000, CRC(6f88e6fb) SHA1(7a7fdf910769d451a7cfc571811180433c353e8d) ) + ROM_LOAD("mpr-21558.ic5", 0x2800000, 0x0800000, CRC(6d4416cf) SHA1(e7ea9c0fe86e84c0358797664807056d8cfdcefe) ) + ROM_LOAD("mpr-21559.ic6", 0x3000000, 0x0800000, CRC(f4afbadf) SHA1(0d30b02835968e6044334204e5e8f8e88be6e783) ) + ROM_LOAD("mpr-21560.ic7", 0x3800000, 0x0800000, CRC(3b2e6e64) SHA1(0ad1daae658d53ca9ae9b197676eafacf820a0fe) ) + ROM_LOAD("mpr-21561.ic8", 0x4000000, 0x0800000, CRC(3c5136ea) SHA1(a0c8f4a947a6c729597a0a3d2348954d35eb5b11) ) + ROM_LOAD("mpr-21562.ic9", 0x4800000, 0x0800000, CRC(e158f4be) SHA1(37b8bcaaaede70c626cee891c53c0004b1cf23df) ) + ROM_LOAD("mpr-21563.ic10",0x5000000, 0x0800000, CRC(6b15befa) SHA1(9e0fd34a878d20b249b07bf01ce167f82f67de53) ) + ROM_LOAD("mpr-21564.ic11",0x5800000, 0x0800000, CRC(cecfaa8a) SHA1(fad935bf97a05e5991f4e0894e81c2c51f920db5) ) + ROM_LOAD("mpr-21565.ic12",0x6000000, 0x0800000, CRC(7e87d973) SHA1(66e2da9f721020e4a6aa423b3922b50b774b15f7) ) + ROM_LOAD("mpr-21566.ic13",0x6800000, 0x0800000, CRC(5354d553) SHA1(7dd84c30b0554b60598cc430366227be594b8221) ) + ROM_LOAD("mpr-21567.ic14",0x7000000, 0x0800000, CRC(9e17fdb2) SHA1(f709a2723bc028553f8c538a4b891333b70c4a62) ) + ROM_LOAD("mpr-21568.ic15",0x7800000, 0x0800000, CRC(b278efcd) SHA1(aa033eb7c5bfc76c847e0e79c3ac04f56edc5688) ) + ROM_LOAD("mpr-21569.ic16",0x8000000, 0x0800000, CRC(724e4d34) SHA1(4398fbc02e70c1ccd9869d18b345e2d790f6c314) ) + ROM_LOAD("mpr-21570.ic17",0x8800000, 0x0800000, CRC(b3375b2b) SHA1(e442d5359bab5581419408ecef796a48eee373ab) ) + ROM_LOAD("mpr-21571.ic18",0x9000000, 0x0800000, CRC(4bcefff9) SHA1(47437073756351b447cc939a2c99ebabe7a6436b) ) + ROM_LOAD("mpr-21572.ic19",0x9800000, 0x0800000, CRC(a47fd15e) SHA1(b595cadedc2e378219146ce19c0338f7e0dcc769) ) + ROM_LOAD("mpr-21573.ic20",0xa000000, 0x0800000, CRC(5d822e63) SHA1(8412980b288531c294d5cf9a6394aa0b9503d7df) ) + ROM_LOAD("mpr-21574.ic21",0xa800000, 0x0800000, CRC(d794a42c) SHA1(a79c7818c6ec993e718494b1d5407eb270a29abe) ) +ROM_END + +/* + +SYSTEMID: NAOMI +JAP: DYNAMITE BASEBALL '99 +USA: WORLD SERIES 99 +EXP: WORLD SERIES 99 + +NO. Type Byte Word +IC22 16M 0000 0000 +IC1 64M 77B9 3C1B +IC2 64M F7FB 025A +IC3 64M B3D4 22C1 +IC4 64M 060F 6279 +IC5 64M FE49 CAEB +IC6 64M E34C 5FAD +IC7 64M CC04 498C +IC8 64M 388C DF17 +IC9 64M 5B91 C458 +IC10 64M AF73 4A18 +IC11 64M 2E5B A198 +IC12 64M FFDB 41CA +IC13 64M 04E1 EA4C +IC14 64M 5B22 DA9A +IC15 64M 64E7 0873 +IC16 64M 1EE7 BE11 +IC17 64M 79C3 3608 +IC18 64M D4CE 5AEB +IC19 64M E846 60B8 + +Serial: BBDE-01A0097 + +*/ + +ROM_START( dybb99 ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0xa000000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-22141b.ic22",0x0000000, 0x0200000, CRC(6d0e0785) SHA1(aa19e7bac4c266771d1e65cffa534a49d7566f51) ) + ROM_LOAD("mpr-22122.ic1", 0x0800000, 0x0800000, CRC(403da794) SHA1(321bc5b8966d05e60110bc0b17d0f37fe1facc56) ) + ROM_LOAD("mpr-22123.ic2", 0x1000000, 0x0800000, CRC(14cfeab8) SHA1(593d006bc2e6f4d1602d7045dc51d974fc5bbd4c) ) + ROM_LOAD("mpr-22124.ic3", 0x1800000, 0x0800000, CRC(19f89fce) SHA1(a442af4e3c913fd34257bc9af29e2361f98f2fa5) ) + ROM_LOAD("mpr-22125.ic4", 0x2000000, 0x0800000, CRC(a9e7298e) SHA1(287284a3d5ea230f3b17e9acb606f28498da230e) ) + ROM_LOAD("mpr-22126.ic5", 0x2800000, 0x0800000, CRC(9f6a5d94) SHA1(71849a4e0bf1bc033e7d073ecbf85793502384c4) ) + ROM_LOAD("mpr-22127.ic6", 0x3000000, 0x0800000, CRC(653d27e3) SHA1(f31c2f237f79cfcc0db657e1fb83503da65029d8) ) + ROM_LOAD("mpr-22128.ic7", 0x3800000, 0x0800000, CRC(e1fd22a1) SHA1(3d12f025ebf5323ce28508062dd2039d186b6223) ) + ROM_LOAD("mpr-22129.ic8", 0x4000000, 0x0800000, CRC(ecf90b4a) SHA1(0403ada8958c2aee56b236032359ae13267ed966) ) + ROM_LOAD("mpr-22130.ic9", 0x4800000, 0x0800000, CRC(26638b66) SHA1(915a8a9b6835b74f49594a02212a7da170c6a74b) ) + ROM_LOAD("mpr-22131.ic10", 0x5000000, 0x0800000, CRC(60e911f8) SHA1(035694e1382e3ca99d4b0cda1082a3a2bd84bcac) ) + ROM_LOAD("mpr-22132.ic11", 0x5800000, 0x0800000, CRC(093ee986) SHA1(e43743f8a93def9e56463bb99ef45a0de3b66d0f) ) + ROM_LOAD("mpr-22133.ic12", 0x6000000, 0x0800000, CRC(d4fc133d) SHA1(a04a21107c1d2dc6c52385e52627f6d97adc6934) ) + ROM_LOAD("mpr-22134.ic13", 0x6800000, 0x0800000, CRC(31497387) SHA1(a1c9626f2fe2d2c75e02513616865da87a140aa8) ) + ROM_LOAD("mpr-22135.ic14", 0x7000000, 0x0800000, CRC(42ab4b4f) SHA1(5f5ba43926ee24649d893e5087f68ef92f8ae88c) ) + ROM_LOAD("mpr-22136.ic15", 0x7800000, 0x0800000, CRC(1f313f03) SHA1(5e7b9d3935049473c128f24cb7718cb3385b03b7) ) + ROM_LOAD("mpr-22137.ic16", 0x8000000, 0x0800000, CRC(819e4cb2) SHA1(1f6a4382c6787d9453b49bca2ae2acab89710368) ) + ROM_LOAD("mpr-22138.ic17", 0x8800000, 0x0800000, CRC(59557b9f) SHA1(beda44c65c69110bdf8afb7542ae39913dab54f2) ) + ROM_LOAD("mpr-22139.ic18", 0x9000000, 0x0800000, CRC(92faa2ca) SHA1(4953f0219c3ae62de0a89473cb7b9dd30b33fcfb) ) + ROM_LOAD("mpr-22140.ic19", 0x9800000, 0x0800000, CRC(4cb54893) SHA1(a99b39cc3c82c3cf90f794bb8c8ba60638a6f921) ) +ROM_END + +/* + +SYSTEMID: NAOMI +JAP: F355 CHALLENGE JAPAN +USA: F355 CHALLENGE USA +EXP: F355 CHALLENGE EXPORT + +*/ + +ROM_START( f355 ) + ROM_REGION( 0x200000, "maincpu", 0) + F355_BIOS +// NAOMI_BIOS + + ROM_REGION( 0xb000000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-21902.ic22",0x0000000, 0x0400000, CRC(04e8acec) SHA1(82e20f99876b13b77c0393ef545316f9eeb2c29c) ) + + ROM_LOAD("mpr-21881.ic1", 0x0800000, 0x0800000, CRC(00bf0d58) SHA1(cf2c58168501c77318e946a4a4d4663993a7913c) ) + ROM_LOAD("mpr-21882.ic2", 0x1000000, 0x0800000, CRC(f87923cd) SHA1(71de4f550e507c9e967331c4a17349df064608ea) ) + ROM_LOAD("mpr-21883.ic3", 0x1800000, 0x0800000, CRC(8c8280b8) SHA1(1a7003f4111ed9715b9ef0b13b0e9ace6a6f5434) ) + ROM_LOAD("mpr-21884.ic4", 0x2000000, 0x0800000, CRC(7bfa2f9a) SHA1(5796291b14ab25f8fed8d4af43558c7294d49e27) ) + ROM_LOAD("mpr-21885.ic5", 0x2800000, 0x0800000, CRC(5a999e6c) SHA1(7a60fe7d2f234c5d9c02ba403422e3a3de5a86ba) ) + ROM_LOAD("mpr-21886.ic6", 0x3000000, 0x0800000, CRC(dee42cfb) SHA1(437257e035e1b9cfbc3a0c15b24ef1aac4f2fbcb) ) + ROM_LOAD("mpr-21887.ic7", 0x3800000, 0x0800000, CRC(fdcc0334) SHA1(3e3d2094a082f3f2dac5ffe5a7e26cf9e61a279b) ) + ROM_LOAD("mpr-21888.ic8", 0x4000000, 0x0800000, CRC(0c717590) SHA1(d304351b07145252816afc9dd82587a1731f665d) ) + ROM_LOAD("mpr-21889.ic9", 0x4800000, 0x0800000, CRC(e8935135) SHA1(609788d5adf976d5313b3fca02ebc2f3c5e2758b) ) + ROM_LOAD("mpr-21890.ic10",0x5000000, 0x0800000, CRC(aeb9d086) SHA1(22f7d2c09718bf3acb910b5950b0601adad859a2) ) + ROM_LOAD("mpr-21891.ic11",0x5800000, 0x0800000, CRC(16d07b04) SHA1(6f222e226e63e30a73649735349c1928c37e011b) ) + ROM_LOAD("mpr-21892.ic12",0x6000000, 0x0800000, CRC(2d91eed2) SHA1(f3cda9776c800ac11e13b6914d59edb11f3e116b) ) + ROM_LOAD("mpr-21893.ic13",0x6800000, 0x0800000, CRC(e55ef69b) SHA1(fa62f8034728751477effcfecff2bc4cdc982b28) ) + ROM_LOAD("mpr-21894.ic14",0x7000000, 0x0800000, CRC(f1acfaea) SHA1(2684f79c6b7595075df41d1f398f228b4aedab16) ) + ROM_LOAD("mpr-21895.ic15",0x7800000, 0x0800000, CRC(98368844) SHA1(331f87def4f82ceb1bf74b16709ef61dfcda1758) ) + ROM_LOAD("mpr-21896.ic16",0x8000000, 0x0800000, CRC(4bc2ab68) SHA1(3a6d6b7599ca0f2c63cdbc3f5916e548bf3697c7) ) + ROM_LOAD("mpr-21897.ic17",0x8800000, 0x0800000, CRC(4ef4448d) SHA1(475021aec754d4526aff77776c8d2abce2b23199) ) + ROM_LOAD("mpr-21898.ic18",0x9000000, 0x0800000, CRC(cacea996) SHA1(df2b7ce00d8d6171806f676966f5f45d7fb76431) ) + ROM_LOAD("mpr-21899.ic19",0x9800000, 0x0800000, CRC(14a4b87d) SHA1(33177dea88c6aec31e2c16c8d0d3f29c7ea772c5) ) + ROM_LOAD("mpr-21900.ic20",0xa000000, 0x0800000, CRC(81901130) SHA1(1573b5c4360e29ba1a4b4901af49d5399fa1e635) ) + ROM_LOAD("mpr-21901.ic21",0xa800000, 0x0800000, BAD_DUMP CRC(55dcbd6d) SHA1(9fec353f9e58016090e177f899a799e2e8fc7c9f) ) // returns bad in Naomi test mode +ROM_END + +/* +SYSTEMID: NAOMI +JAP: GIANT GRAM +USA: GIANT GRAM +EXP: GIANT GRAM + +NO. Type Byte Word +IC22 16M 0000 1111 +IC1 64M E504 548E + +Serial: BAJE-01A0021 +*/ + +ROM_START( ggram2 ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0x6000000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-21820.ic22", 0x0000000, 0x0200000, CRC(0a198278) SHA1(0df5fc8b56ddafc66d92cb3923b851a5717b551d) ) + ROM_LOAD("mpr-21821.ic1", 0x0800000, 0x0800000, CRC(ed127b65) SHA1(8b6d03fc733f601a48006d3268faa8983ca69d70) ) + /* IC2 empty */ + ROM_LOAD("mpr-21823.ic3", 0x1800000, 0x0800000, CRC(a304b528) SHA1(32197c74c659de2cc5f72f13c84bacac7b136d36) ) + ROM_LOAD("mpr-21824.ic4", 0x2000000, 0x0800000, CRC(6cf92c79) SHA1(378c71f506f129b6a9aebc9fc1faf96722a6d46d) ) + ROM_LOAD("mpr-21825.ic5", 0x2800000, 0x0800000, CRC(ebac834e) SHA1(bf01fa9021b79418af63d494d8ab89ef58570fb9) ) + ROM_LOAD("mpr-21826.ic6", 0x3000000, 0x0800000, CRC(da00dcb6) SHA1(744a67d7a63aa57fd5d85c5bb3dd2b2fff30dd1d) ) + ROM_LOAD("mpr-21827.ic7", 0x3800000, 0x0800000, CRC(40874dc1) SHA1(86a2958af503264ebe12928b6f3f17e2fb6675ae) ) + /* IC8 empty */ + ROM_LOAD("mpr-21829.ic9", 0x4800000, 0x0800000, CRC(c5553df2) SHA1(b97a82ac9133dab4bfd87392f803754b6d00389f) ) + ROM_LOAD("mpr-21830.ic10", 0x5000000, 0x0800000, CRC(e01ceb86) SHA1(dd5703d7712cfc0053bddfff63e78dda372b6ff2) ) + ROM_LOAD("mpr-21831.ic11", 0x5800000, 0x0800000, CRC(751848d0) SHA1(9c2267fd3c6f9ea5f2679bb2ca20d511a49b2845) ) +ROM_END + +/* + +SYSTEMID: NAOMI +JAP: GIANT GRAM 2000 +USA: GIANT GRAM 2000 +EXP: GIANT GRAM 2000 + +NO. Type Byte Word +IC22 32M 0000 0000 +IC1 64M 904A 81AE +IC2 64M E9F7 B152 +IC3 64M A4D0 8FB7 +IC4 64M A869 64FB +IC5 64M 30CB 3483 +IC6 64M 94DD 7F14 +IC7 64M BA8B EA07 +IC8 64M 6ADA 5CDA +IC9 64M 7CDA 86C1 +IC10 64M 86F2 73A3 +IC11 64M 44D8 1D11 +IC12 64M F25E EDA8 +IC13 64M 4804 6251 +IC14 64M E4FE 3808 +IC15 64M FD3D D37A +IC16 64M 6D48 F5B3 +IC17 64M F0C6 CA29 +IC18 64M 07C3 E4AE +IC19 64M 50F8 8500 +IC20 64M 4EA2 D0CE +IC21 64M 090B 5667 + +Serial: BCCG-21A0451 + +*/ + +ROM_START( gram2000 ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0xb000000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-23377.ic11", 0x0000000, 0x0400000, CRC(4ca3149c) SHA1(9d25fc659658b416202b033754669be2f3abcdbe) ) + /* ic1 empty? test mode reports a bad result. */ + ROM_LOAD32_WORD("mpr-23357.ic17", 0x1000000, 0x0800000, CRC(eaf77487) SHA1(bdfc4666a6724441c11b31d89fa30c4bd11cbdd1) ) //ic 2 + ROM_LOAD32_WORD("mpr-23358.ic18", 0x1000002, 0x0800000, CRC(96819a5b) SHA1(e28c9d7b0579ab5d6116401b49f30dc8e4961618) ) //ic 3 + ROM_LOAD32_WORD("mpr-23359.ic19", 0x2000000, 0x0800000, CRC(757b9e89) SHA1(b131af1cbcb4fcebb7081b208acc86841192ff14) ) //ic 4 + ROM_LOAD32_WORD("mpr-23360.ic20", 0x2000002, 0x0800000, CRC(b38d28ff) SHA1(df4ff5be67c9812cdf8f018a9e60ec82b9faf7e4) ) //ic 5 + ROM_LOAD32_WORD("mpr-23361.ic21", 0x3000000, 0x0800000, CRC(680d7d77) SHA1(83cb29157f84739e424df7565e7bcb935564866f) ) //ic 6 + ROM_LOAD32_WORD("mpr-23362.ic22", 0x3000002, 0x0800000, CRC(84b7988d) SHA1(4e5d657be03f2c0b5e771e19c907aac60d8d8dac) ) //ic 7 + ROM_LOAD32_WORD("mpr-23363.ic23", 0x4000000, 0x0800000, CRC(17ae2b21) SHA1(8672166fbf99393ea2485ffb0fc4e64f43865bde) ) //ic 8 + ROM_LOAD32_WORD("mpr-23364.ic24", 0x4000002, 0x0800000, CRC(3d422a1c) SHA1(c82b0a9ebb56f17b4ce60293beee612c08564a25) ) //ic 9 + ROM_LOAD32_WORD("mpr-23365.ic25", 0x5000000, 0x0800000, CRC(e975496c) SHA1(6b309e28697c2884b806d17900702c62074d90a4) ) //ic 10 + ROM_LOAD32_WORD("mpr-23366.ic26", 0x5000002, 0x0800000, CRC(55e96378) SHA1(190ec23fabc60b820fd9b1486fd6cb1bfe56ba6c) ) //ic 11 + ROM_LOAD32_WORD("mpr-23367.ic27", 0x6000000, 0x0800000, CRC(5d40d017) SHA1(67a405c58687c119e774511b97399b5854ceb09b) ) //ic 12 + ROM_LOAD32_WORD("mpr-23368.ic28", 0x6000002, 0x0800000, CRC(8fb3be5f) SHA1(52c1f4537bf2dc2b47996dea87317ee9b7860cd9) ) //ic 13 + ROM_LOAD32_WORD("mpr-23369.ic29", 0x7000000, 0x0800000, CRC(a6a1671d) SHA1(4c458ce901a5cbb1cfd09bcf6926160a89c81e30) ) //ic 14 + ROM_LOAD32_WORD("mpr-23370.ic30", 0x7000002, 0x0800000, CRC(29876427) SHA1(18faeadd0c285edc94ff269b0c2faa0a3cc4c296) ) //ic 15 + ROM_LOAD32_WORD("mpr-23371.ic31", 0x8000000, 0x0800000, CRC(5cad6596) SHA1(1f19ca43c13afbe1a7cc48cf51a82aa06aec99f8) ) //ic 16 + ROM_LOAD32_WORD("mpr-23372.ic32", 0x8000002, 0x0800000, CRC(3d848b16) SHA1(328289998981dae6b593636a5bd2c6d0954c2625) ) //ic 17 + ROM_LOAD32_WORD("mpr-23373.ic33", 0x9000000, 0x0800000, CRC(369227f9) SHA1(85ce0f4f139788cda35471658196a84a36019fe6) ) //ic 18 + ROM_LOAD32_WORD("mpr-23374.ic34", 0x9000002, 0x0800000, CRC(1f8a2e08) SHA1(ff9b9bfada831baeb4830a3d1a4bfb38570b9972) ) //ic 19 + ROM_LOAD32_WORD("mpr-23375.ic35", 0xa000000, 0x0800000, CRC(7d4043db) SHA1(cadf22419e5b63c33a179bb6b0742035fc9d8028) ) //ic 20 + ROM_LOAD32_WORD("mpr-23376.ic36", 0xa000002, 0x0800000, CRC(e09cb473) SHA1(c3ec980f1a56142a0e06bae9594d6038acf0690d) ) //ic 21 +ROM_END + +/* +SYSTEMID: NAOMI +JAP: GUILTY GEAR X +USA: DISABLE +EXP: DISABLE + +*/ + +ROM_START( ggx ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0x7800000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-23356.ic22", 0x0000000, 0x0400000, CRC(ed2d289f) SHA1(d4f73c6cd25f320616e21f1ff0cdc0a566185dcb) ) + ROM_LOAD("mpr-23342.ic1", 0x0800000, 0x0800000, CRC(4fd89557) SHA1(3a687393d38e890acb0d1b0edc3ea585773c0222) ) + ROM_LOAD("mpr-23343.ic2", 0x1000000, 0x0800000, CRC(2e4417b6) SHA1(0f87fa92f01116b0acfae5f1b5a148c1a12a487f) ) + ROM_LOAD("mpr-23344.ic3", 0x1800000, 0x0800000, CRC(968eea3b) SHA1(a3bb7233b9a950f00b4dcd7bb055dbdba2b29860) ) + ROM_LOAD("mpr-23345.ic4", 0x2000000, 0x0800000, CRC(30efe1ec) SHA1(be28243ab84acb41229d42056ba051a839e7af65) ) + ROM_LOAD("mpr-23346.ic5", 0x2800000, 0x0800000, CRC(b34d9461) SHA1(44bd132189c5487fef559883300993393f9f29c6) ) + ROM_LOAD("mpr-23347.ic6", 0x3000000, 0x0800000, CRC(5a254cd1) SHA1(5ca00400c9e7f6c2565b1ff2d2552a90faadf6dd) ) + ROM_LOAD("mpr-23348.ic7", 0x3800000, 0x0800000, CRC(aff43142) SHA1(c23bbfceb47885164250ca4800a52b9e9e9e80bc) ) + ROM_LOAD("mpr-23349.ic8", 0x4000000, 0x0800000, CRC(e83871c7) SHA1(49a8140f38d896e8645fbc838f22af561bd2aa7d) ) + ROM_LOAD("mpr-23350.ic9", 0x4800000, 0x0800000, CRC(4237010b) SHA1(e757dff4c353416f99eaf3cb1945b94d2768fc4f) ) + ROM_LOAD("mpr-23351.ic10", 0x5000000, 0x0800000, CRC(b096f712) SHA1(f8e2322ba83224029cd4b91cf4d51a9376923b45) ) + ROM_LOAD("mpr-23352.ic11", 0x5800000, 0x0800000, CRC(1a01ab38) SHA1(c161d5f0d60849f4e2b51ac00ca877e1c5624bff) ) + ROM_LOAD("mpr-23353.ic12", 0x6000000, 0x0800000, CRC(daa0ca24) SHA1(afce14e213e79add7fded838e71bb4447425906a) ) + ROM_LOAD("mpr-23354.ic13", 0x6800000, 0x0800000, CRC(cea127f7) SHA1(11f12472ebfc93eb72b764c780e30afd4812dbe9) ) + ROM_LOAD("mpr-23355.ic14", 0x7000000, 0x0800000, CRC(e809685f) SHA1(dc052b4eb4fdcfdc22c4807316ce34ee7a0d58a6) ) +ROM_END + +/* + +SYSTEMID: NAOMI +JAP: HEAVY METAL JAPAN +USA: HEAVY METAL USA +EXP: HEAVY METAL EURO + +NO. Type Byte Word +IC22 32M 0000 0000 +IC1 64M CBA3 16D2 +IC2 64M 087A 079B +IC3 64M CDB0 804C +IC4 64M 326A E815 +IC5 64M C164 5DB4 +IC6 64M 38A0 AAFC +IC7 64M 1134 DFCC +IC8 64M 6597 6975 +IC9 64M D6FB 8917 +IC10 64M 6442 18AC +IC11 64M 4F77 EEFE + +*/ + + +ROM_START( hmgeo ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0x6000000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-23716a.ic22", 0x0000000, 0x0400000, CRC(c5cb0d3b) SHA1(20de8f5ee183e996ccde77b10564a302939662db) ) + ROM_RELOAD( 0x400000, 0x400000) + ROM_LOAD("mpr-23705.ic1", 0x0800000, 0x0800000, CRC(2549b57d) SHA1(02c04c8ccb0de680171d06700ca9a40208286894) ) + ROM_LOAD("mpr-23706.ic2", 0x1000000, 0x0800000, CRC(9f21865c) SHA1(a1f5aec34097cf2b86110110f586ba8b3cf28bd1) ) + ROM_LOAD("mpr-23707.ic3", 0x1800000, 0x0800000, CRC(ba2f42cd) SHA1(e924f8ef58cc81b7303d8fb3baf0e384c6387e7f) ) + ROM_LOAD("mpr-23708.ic4", 0x2000000, 0x0800000, CRC(19c4e61b) SHA1(a4619df98818d33bdaa3e6429c14d1aeec316e6a)) + ROM_LOAD("mpr-23709.ic5", 0x2800000, 0x0800000, CRC(676430b3) SHA1(5fa40c45afe97b0f09e575e3c01d44aa9259961d) ) + ROM_LOAD("mpr-23710.ic6", 0x3000000, 0x0800000, CRC(5d32dba3) SHA1(5bb5796a682cc6ee68458403c69343bf753ece7a) ) + ROM_LOAD("mpr-23711.ic7", 0x3800000, 0x0800000, CRC(650df507) SHA1(dff192b3bd4f39627779e2ba86d9dd13536221dd) ) + ROM_LOAD("mpr-23712.ic8", 0x4000000, 0x0800000, CRC(154f10ce) SHA1(67f6ff297f77632efe1965a81ed9f5c7dfa7a6b3) ) + ROM_LOAD("mpr-23713.ic9", 0x4800000, 0x0800000, CRC(2969bac7) SHA1(5f1cf6ac726c2fe183d66e4022962e44592f9ccd) ) + ROM_LOAD("mpr-23714.ic10",0x5000000, 0x0800000, CRC(da462c44) SHA1(ca450b6c07f939f96eba7b44c45b4e38abd598aa) ) + ROM_LOAD("mpr-23715.ic11",0x5800000, 0x0800000, BAD_DUMP CRC(59dfd3ad) SHA1(bb8f7a1bcf16038b18f4485a6b6d81fa72ca7bd0) ) +ROM_END + +/* + +SYSTEMID: NAOMI +JAP: GIGAWING2 JAPAN +USA: GIGAWING2 USA +EXP: GIGAWING2 EXPORT + +NO. Type Byte Word +IC22 16M C1C3 618F +IC1 64M 8C09 3A15 +IC2 64M 91DC C17F +IC3 64M 25CB 2AA0 +IC4 64M EB35 C1FF +IC5 64M 8B25 914E +IC6 64M 72CB 68FA +IC7 64M 191E 2AF3 +IC8 64M EACA 12CD +IC9 64M 717F 40ED +IC10 64M 1E43 0F1A + +*/ + +ROM_START( gwing2 ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0x5800000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-22270.ic22", 0x0000000, 0x0200000, CRC(876b3c97) SHA1(eb171d4a0521c3bea42b4aae3607faec63e10581) ) + ROM_LOAD("ic1", 0x0800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic2", 0x1000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic3", 0x1800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic4", 0x2000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic5", 0x2800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic6", 0x3000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic7", 0x3800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic8", 0x4000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic9", 0x4800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic10",0x5000000, 0x0800000, NO_DUMP ) +ROM_END + +/* +SYSTEMID: NAOMI +JAP: IDOL JANSHI SUCHIE-PAI 3 +USA: DISABLE +EXP: DISABLE + +NO. Type Byte Word +IC22 16M 0000 0000 +IC1 64M E467 524B +IC2 64M 9D05 4992 +IC3 64M E3F7 6481 +IC4 64M 6C22 25E3 +IC5 64M 180F E89F +IC6 64M 60C9 2B86 +IC7 64M 4EDE 4539 +IC8 64M 3AD3 0046 +IC9 64M 8D37 BA16 +IC10 64M 8AE3 4D71 +IC11 64M B519 1393 +IC12 64M 4695 B159 +IC13 64M 536F D0C6 +IC14 32M 81F9 DA1B +*/ + +ROM_START( suchie3 ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0x7800000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-21979.ic22",0x0000000, 0x0200000, CRC(335c9e25) SHA1(476790fdd99a8c13336e795b4a39b071ed86a97c) ) + ROM_LOAD("mpr-21980.ic1", 0x0800000, 0x0800000, CRC(2b5f958a) SHA1(609585dda27c5e111378a92f04fa03ae11d42540) ) + ROM_LOAD("mpr-21981.ic2", 0x1000000, 0x0800000, CRC(b4fff4ee) SHA1(333fb5a662775662881154b654233f207782a8aa) ) + ROM_LOAD("mpr-21982.ic3", 0x1800000, 0x0800000, CRC(923ee0ff) SHA1(4f92cc1abfd948a1ed15fdca11251aba96bdc022) ) + ROM_LOAD("mpr-21983.ic4", 0x2000000, 0x0800000, CRC(dd659ab1) SHA1(96d9825fc5cf72a9ef83f10e480fd8925b1d6762) ) + ROM_LOAD("mpr-21984.ic5", 0x2800000, 0x0800000, CRC(b34de0c7) SHA1(dbb7a6a19af2571441b5ecbddddae6891809ffcf) ) + ROM_LOAD("mpr-21985.ic6", 0x3000000, 0x0800000, CRC(f1516e0a) SHA1(246d287df592cd69df689dc10e8647a9dbf804b7) ) + ROM_LOAD("mpr-21986.ic7", 0x3800000, 0x0800000, CRC(2779c418) SHA1(8d1a89ddf0c68f1eaf6eb0dafadf9b614492fff1) ) + ROM_LOAD("mpr-21987.ic8", 0x4000000, 0x0800000, CRC(6aaaacdd) SHA1(f5e67c88db8bce8f2f4cab73a5d0a24ba57c812b) ) + ROM_LOAD("mpr-21988.ic9", 0x4800000, 0x0800000, CRC(ed61b155) SHA1(679124f0f7c7bc4791025cff274d903cf5bcae70) ) + ROM_LOAD("mpr-21989.ic10",0x5000000, 0x0800000, CRC(ae8562cf) SHA1(e31986e53159729434a7952e8c4ed2adf8dd8e9d) ) + ROM_LOAD("mpr-21990.ic11",0x5800000, 0x0800000, CRC(57fd9fdd) SHA1(62b3bc4a2828751459557b63d900ca6d46792e24) ) + ROM_LOAD("mpr-21991.ic12",0x6000000, 0x0800000, CRC(d82f834a) SHA1(06902713bdf6f68182749916cacc9ae6528dc355) ) + ROM_LOAD("mpr-21992.ic13",0x6800000, 0x0800000, CRC(599a2fb8) SHA1(2a0007064ad2ee1e1a0fda1d5676df4ff19a9f2f) ) + ROM_LOAD("mpr-21993.ic14",0x7000000, 0x0400000, CRC(fb28cf0a) SHA1(d51b1d4514a93074d1f77bd1bc5995739604cf56) ) +ROM_END + +/* +SYSTEMID: NAOMI +JAP: SHANGRI-LA +USA: SHANGRI-LA +EXP: SHANGRI-LA +*/ + +ROM_START( shangril ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0x6800000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-22060.ic22", 0x0000000, 0x0400000, CRC(5ae18595) SHA1(baaf8fd948b07ab9970571fecebc3c4fab5d4897) ) + ROM_LOAD("mpr-22061.ic1", 0x0800000, 0x0800000, CRC(4d760b34) SHA1(ba7dce0ab7961a77622a41c3f50c112a7e9904aa) ) + ROM_LOAD("mpr-22062.ic2", 0x1000000, 0x0800000, CRC(f713c59f) SHA1(75d8559f1b847fd6a51009fe9333b9627adcbd75) ) + ROM_LOAD("mpr-22063.ic3", 0x1800000, 0x0800000, CRC(a93ad631) SHA1(c829c58ed899fe3d4f71950c883098a215bcda1b) ) + ROM_LOAD("mpr-22064.ic4", 0x2000000, 0x0800000, CRC(56e34efd) SHA1(f810a4a0105adb7f1eaa078440e28a9bac20c3ea) ) + ROM_LOAD("mpr-22065.ic5", 0x2800000, 0x0800000, CRC(44b230bd) SHA1(d560690ddd1b9bbe919b20599d25c544df2dc808) ) + ROM_LOAD("mpr-22066.ic6", 0x3000000, 0x0800000, CRC(69f0be28) SHA1(05fc6f3b18645b165cfa0ac7b3d56013aabb360b) ) + ROM_LOAD("mpr-22067.ic7", 0x3800000, 0x0800000, CRC(344f9d01) SHA1(260e748dc265fb2b5d50f9a856ccdd157ac103fd) ) + ROM_LOAD("mpr-22068.ic8", 0x4000000, 0x0800000, CRC(48d0d510) SHA1(d3aa51f29699363c8949b20493eba1a5c585ca0e) ) + ROM_LOAD("mpr-22069.ic9", 0x4800000, 0x0800000, CRC(94e6dfa9) SHA1(83ca9ea5d2892511626be362ff2cab22f2b945cf) ) + ROM_LOAD("mpr-22070.ic10", 0x5000000, 0x0800000, CRC(8dcd2b3d) SHA1(0d8b735120fc63306516f6acc333345cc7774ff1) ) + ROM_LOAD("mpr-22071.ic11", 0x5800000, 0x0800000, CRC(1ab1f1ab) SHA1(bb8fa8d5a681115a82e9598ebe599b106f7aae9d) ) + ROM_LOAD("mpr-22072.ic12", 0x6000000, 0x0800000, CRC(cb8d2634) SHA1(03ac8fb3a1acb1f8e32d9325c4da42417752f934) ) +ROM_END + +/* +SYSTEMID: NAOMI +JAP: MARVEL VS. CAPCOM 2 +USA: MARVEL VS. CAPCOM 2 +EXP: MARVEL VS. CAPCOM 2 + +Note: the following game is one of the few known regular Naomi game to have a rom test item in its specific test mode menu. +So the Naomi regular board test item is unreliable in this circumstance. + +protection notes: +CPU 'maincpu' (PC=0C001014): unmapped program memory qword write to 0231FCF8 = 00000000E2534910 & 00000000FFFFFFFF +CPU 'maincpu': warning - attempt to direct-map address 02534910 in program space +CPU 'maincpu' (PC=02534910): unmapped program memory qword read from 02534910 & 000000000000FFFF +CPU 'maincpu': warning - attempt to direct-map address 02534912 in program space +CPU 'maincpu' (PC=02534912): unmapped program memory qword read from 02534910 & 00000000FFFF0000 +CPU 'maincpu': warning - attempt to direct-map address 02534914 in program space +*/ + + +ROM_START( mvsc2 ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0x8800000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-23085a.ic11", 0x0000000, 0x0400000, CRC(5d5b7ad1) SHA1(f58c31b245fc33fa541f9f074548402a63f7c3d3) ) //ic 22 + ROM_RELOAD( 0x400000, 0x400000) + ROM_LOAD("mpr-23048.ic17", 0x0800000, 0x0800000, CRC(93d7a63a) SHA1(c50d10b4a3f9db51eae5749f5b665d7c8ab6c898) ) //ic 1 + ROM_LOAD("mpr-23049.ic18", 0x1000000, 0x0800000, CRC(003dcce0) SHA1(fb71c8ca9271d2155878c72d8fe2df3031e6c014) ) //ic 2 + ROM_LOAD("mpr-23050.ic19", 0x1800000, 0x0800000, CRC(1d6b88a7) SHA1(ba42e9d1d912d88a7ad839b878975ba590634320) ) //ic 3 + ROM_LOAD("mpr-23051.ic20", 0x2000000, 0x0800000, CRC(01226aaa) SHA1(a4c6a0eda05e53d0e51b92a4317a86a708a7efdb) ) //ic 4 + ROM_LOAD("mpr-23052.ic21", 0x2800000, 0x0800000, CRC(74bee120) SHA1(5a0fb48fa758a2be2e08e3b1298103c5aa748835) ) //ic 5 + ROM_LOAD("mpr-23053.ic22", 0x3000000, 0x0800000, CRC(d92d4401) SHA1(a868780f8d2e176ff10781e1c08bf932f34ac504) ) //ic 6 + ROM_LOAD("mpr-23054.ic23", 0x3800000, 0x0800000, CRC(78ba02e8) SHA1(0f696a33e1e6671001efc309ed62f084a246ad24) ) //ic 7 + ROM_LOAD("mpr-23055.ic24", 0x4000000, 0x0800000, CRC(84319604) SHA1(c3dde162e043a54e1325202b46191b32e8784a1c) ) //ic 8 + ROM_LOAD("mpr-23056.ic25", 0x4800000, 0x0800000, CRC(d7386034) SHA1(be1f3ca5f283e428dc59dc072de3e7d36e122d53) ) //ic 9 + ROM_LOAD("mpr-23057.ic26", 0x5000000, 0x0800000, CRC(a3f087db) SHA1(b52d7c072cb5c2fdd10d0ac0b62cebe48b229ae3) ) //ic 10 + ROM_LOAD("mpr-23058.ic27", 0x5800000, 0x0800000, CRC(61a6cc5d) SHA1(34e52cb076888313a80f2b87876b8d37b91d85a0) ) //ic 11 + ROM_LOAD("mpr-23059.ic28", 0x6000000, 0x0800000, CRC(64808024) SHA1(1a6c60c330642b273978d3dd02d95d17d36ee3f2) ) //ic 12 + ROM_LOAD("mpr-23060.ic29", 0x6800000, 0x0800000, CRC(67519942) SHA1(fc758d9075625f8140d5d828c8f6b7a91bcc9119) ) //ic 13 + ROM_LOAD("mpr-23061.ic30", 0x7000000, 0x0800000, CRC(fb1844c4) SHA1(1d1571516a6dbed0c4ded3b80efde9cc9281f66f) ) //ic 14 + ROM_LOAD32_WORD("mpr-23083.ic31", 0x8000000, 0x0400000, CRC(c61d2dfe) SHA1(a05fb979ed7c8040de91716fc8814e6bd995efa2) ) //ic 15 + ROM_LOAD32_WORD("mpr-23084.ic32", 0x8000002, 0x0400000, CRC(4ebbbdd9) SHA1(9ad8c1a644850de6e35705318cd1991e1d6e60a8) ) //ic 16 +ROM_END + +/* toy fighter - 1999 sega */ + +ROM_START( toyfight ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0x8000000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-22035.ic22",0x0000000, 0x0400000, CRC(dbc76493) SHA1(a9772bdb62610a39adf2b9f397781bcddda3e635) ) + + ROM_LOAD("mpr-22025.ic1", 0x0800000, 0x0800000, CRC(30237202) SHA1(e229a7671b3a34b26a461716bd7b437da100e1c8) ) + ROM_LOAD("mpr-22026.ic2", 0x1000000, 0x0800000, CRC(f28e71ff) SHA1(019425fcf234beca2b586de5235cf9f171563533) ) + ROM_LOAD("mpr-22027.ic3", 0x1800000, 0x0800000, CRC(1a84632d) SHA1(f3880f21399c6713c48c710c06d0344a0a28f026) ) + ROM_LOAD("mpr-22028.ic4", 0x2000000, 0x0800000, CRC(2b34ccba) SHA1(76c39ea19c3be1d9a9ce9e67035be7543b71ff26) ) + ROM_LOAD("mpr-22029.ic5", 0x2800000, 0x0800000, CRC(8162953a) SHA1(15c9e10080a5f2e70c31b9b89a256050a1aed4e9) ) + ROM_LOAD("mpr-22030.ic6", 0x3000000, 0x0800000, CRC(5bf5fed6) SHA1(6c8eedb177aa49aee9a8b090f2e5f96644416c6c) ) + ROM_LOAD("mpr-22031.ic7", 0x3800000, 0x0800000, CRC(ee7c40cc) SHA1(b9d92ef5bae0e932ec8769a30ebd841a263d3e2a) ) + ROM_LOAD("mpr-22032.ic8", 0x4000000, 0x0800000, CRC(3c48c9ba) SHA1(00be199b23040f8e81db2ec489ba98cbf615652c) ) + ROM_LOAD("mpr-22033.ic9", 0x4800000, 0x0800000, CRC(5fe5586e) SHA1(3ff41ae1f81469597684faadd88e62b5e0634352) ) + ROM_LOAD("mpr-22034.ic10",0x5000000, 0x0800000, CRC(3aa5ce5e) SHA1(f00a906235e4522d6fc2ac771324114346875314) ) +ROM_END + + +/* + +SYSTEMID: NAOMI +JAP: SLASHOUT JAPAN VERSION +USA: SLASHOUT USA VERSION +EXP: SLASHOUT EXPORT VERSION + +NO. Type Byte Word +IC22 32M 0000 0000 +IC1 64M D1BF FB18 +IC2 64M 1F98 4295 +IC3 64M 5F61 67E3 +IC4 64M C6A4 449B +IC5 64M BB2A 58AB +IC6 64M 60B2 5262 +IC7 64M 178B 3705 +IC8 64M E4B9 FF46 +IC9 64M D4FC 2273 +IC10 64M 6BA5 8087 +IC11 64M 7DBA A143 +IC12 64M B708 0C61 +IC13 64M 0C4A 8DF0 +IC14 64M B2FF A057 +IC15 64M 60DB 3D06 +IC16 64M B5EA 4965 +IC17 64M 6586 1F3F + +*/ + +ROM_START( slasho ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0x9000000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-23341.ic22", 0x0000000, 0x0400000, CRC(477fa123) SHA1(d2474766dcd0b0e5fe317a858534829eb1c26789) ) + ROM_RELOAD( 0x400000, 0x400000) + ROM_LOAD("mpr-23324.ic1", 0x0800000, 0x0800000, CRC(8624493a) SHA1(4fe940a889619f2a75c45e15efb2b8ed9020bc55) ) + ROM_LOAD("mpr-23325.ic2", 0x1000000, 0x0800000, CRC(f952d0d4) SHA1(4b5403b98bf977c1e3a045619e1eddb4e4ab69c7) ) + ROM_LOAD("mpr-23326.ic3", 0x1800000, 0x0800000, CRC(6c5ce16e) SHA1(110b5d536557ab6610a7c32db2e6e46901da9579) ) + ROM_LOAD("mpr-23327.ic4", 0x2000000, 0x0800000, CRC(1b3d02a0) SHA1(3e02a0cb3d945e5d6cea03236d6571d45a7afd51) ) + ROM_LOAD("mpr-23328.ic5", 0x2800000, 0x0800000, CRC(50053662) SHA1(3ced87ee533fd7a32d64c41f1fcbde9c648ab188) ) + ROM_LOAD("mpr-23329.ic6", 0x3000000, 0x0800000, CRC(96148e80) SHA1(c0f30556395edb9a7558006e89d6adc2f6bdc048) ) + ROM_LOAD("mpr-23330.ic7", 0x3800000, 0x0800000, CRC(15f2f9a1) SHA1(9cea71b6f6466ccd840218f5dcb09ea7525208d8) ) + ROM_LOAD("mpr-23331.ic8", 0x4000000, 0x0800000, CRC(a084ab51) SHA1(1f5c863012004bbeefc82b172a92011a175428a6) ) + ROM_LOAD("mpr-23332.ic9", 0x4800000, 0x0800000, CRC(50539e17) SHA1(38ec16a868c892e177fbb45be563e1b649956550) ) + ROM_LOAD("mpr-23333.ic10", 0x5000000, 0x0800000, CRC(29891831) SHA1(f318bca11ac5eb24b32d5b910a596280221a44ab) ) + ROM_LOAD("mpr-23334.ic11", 0x5800000, 0x0800000, CRC(c1ad0614) SHA1(e38ff316da889eb029d0a9348f6b2284f3a36f29) ) + ROM_LOAD("mpr-23335.ic12s",0x6000000, 0x0800000, CRC(faeb25ed) SHA1(623f3f78c94ba44e77491c18a6521a19b1101a67) ) + ROM_LOAD("mpr-23336.ic13s",0x6800000, 0x0800000, CRC(63589d0f) SHA1(53770cc1268892e8cdb76b6edf2fb39e8b605554) ) + ROM_LOAD("mpr-23337.ic14s",0x7000000, 0x0800000, CRC(2bc46263) SHA1(38ec579768ac37ed3ad21911b1970241906af8ea) ) + ROM_LOAD("mpr-23338.ic15s",0x7800000, 0x0800000, CRC(323e4db2) SHA1(c5484589c1613110faef6cf8b8f4def8867a8226) ) + ROM_LOAD("mpr-23339.ic16s",0x8000000, 0x0800000, CRC(fd8c2736) SHA1(34ae1a4e35b4aac6666719fb4fc0959bd64ff3d6) ) + ROM_LOAD("mpr-23340.ic17s",0x8800000, 0x0800000, CRC(001604f8) SHA1(615ec027d383d44d4aadb1175be6320e4139d7d1) ) +ROM_END + + +/* + +SYSTEMID: NAOMI +JAP: MOERO JUSTICE GAKUEN JAPAN +USA: PROJECT JUSTICE USA +EXP: PROJECT JUSTICE EXPORT + +NO. Type Byte Word +IC22 32M 0000 0000 +IC1 64M 3E87 5491 +IC2 64M 2789 9802 +IC3 64M 60E7 E775 +IC4 64M 36F4 9353 +IC5 64M 31B6 CEF6 +IC6 64M 3F79 7B58 +IC7 64M 620C A31F +IC8 64M A093 160C +IC9 64M 4DD9 4184 +IC10 64M AF3F C64A +IC11 64M 0EE1 A0C2 +IC12 64M 2EF9 E0A3 +IC13 64M 72A5 3156 +IC14 64M D414 B896 +IC15 64M 7BCE 3A7A +IC16 64M E371 962D +IC17 64M E813 E342 +IC18 64M D2B8 3989 +IC19 64M 3A4B 4614 +IC20 64M 11B0 9921 +IC21 64M 698C 7A39 + +Serial: BCLE-01A2130 + +*/ + +ROM_START( pjustic ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0xb000000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-23548a.ic22", 0x0000000, 0x0400000, CRC(f4ccf1ec) SHA1(97485b2a4b9452ffeea2501f42d20d718410e716) ) + ROM_LOAD("ic1", 0x0800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic2", 0x1000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic3", 0x1800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic4", 0x2000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic5", 0x2800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic6", 0x3000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic7", 0x3800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic8", 0x4000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic9", 0x4800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic10",0x5000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic11",0x5800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic12",0x6000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic13",0x6800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic14",0x7000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic15",0x7800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic16",0x8000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic17",0x8800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic18",0x9000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic19",0x9800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic20",0xa000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic21",0xa800000, 0x0800000, NO_DUMP ) +ROM_END + +/* + +SYSTEMID: NAOMI +JAP: POWER STONE JAPAN +USA: POWER STONE USA +EXP: POWER STONE EURO + +NO. Type Byte Word +IC22 16M 0000 0000 +IC1 64M 0258 45D8 +IC2 64M 0DF2 0810 +IC3 64M 5F93 9FAF +IC4 64M 05E0 C80F +IC5 64M F023 3F68 +IC6 64M 941E F563 +IC7 64M 374E 46F6 +IC8 64M C529 0501 + +*/ + +ROM_START( pstone ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0x4800000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-21597.ic22",0x0000000, 0x0200000, CRC(62c7acc0) SHA1(bb61641a7f3650757132cde379447bdc9bd91c78) ) + ROM_RELOAD( 0x200000, 0x200000) + ROM_RELOAD( 0x400000, 0x200000) + ROM_RELOAD( 0x600000, 0x200000) + ROM_LOAD("mpr-21589.ic1", 0x0800000, 0x0800000, CRC(2fa66608) SHA1(144bda75f892a1e4dbd8332439e9e44fad1d0695) ) + ROM_LOAD("mpr-21590.ic2", 0x1000000, 0x0800000, CRC(6341b399) SHA1(d123b6a3eb7c4800950cc5849d748b0edafabc7d) ) + ROM_LOAD("mpr-21591.ic3", 0x1800000, 0x0800000, CRC(7f2d99aa) SHA1(00f9ae67be0d7229c37479b6dc0ed5816035fd98) ) + ROM_LOAD("mpr-21592.ic4", 0x2000000, 0x0800000, CRC(6ebe3b25) SHA1(c7dec77d55b0fcf1d230311b24553581a90a7d22) ) + ROM_LOAD("mpr-21593.ic5", 0x2800000, 0x0800000, CRC(84366f3e) SHA1(c61985f627813db2e16182e437ab4a69d5253c9f) ) + ROM_LOAD("mpr-21594.ic6", 0x3000000, 0x0800000, CRC(ddfa0467) SHA1(e758eae50035d5f18d99dbed728513e306d9566f) ) + ROM_LOAD("mpr-21595.ic7", 0x3800000, 0x0800000, CRC(7ab218f7) SHA1(c5c022e63f926cce09d49331647cde20e8e42ab3) ) + ROM_LOAD("mpr-21596.ic8", 0x4000000, 0x0800000, CRC(f27dbdc5) SHA1(d54717d62897546968de2f049239f68bee49bdd8) ) +ROM_END + +/* + +SYSTEMID: NAOMI +JAP: POWER STONE 2 JAPAN +USA: POWER STONE 2 USA +EXP: POWER STONE 2 EURO + +NO. Type Byte Word +IC22 32M 0000 0000 +IC1 64M 04FF B3D4 +IC2 64M 52D4 0BF0 +IC3 64M 5273 0EB8 +IC4 64M B39A 21F5 +IC5 64M 53CB 6540 +IC6 64M 0AC8 74ED +IC7 64M D05A EB30 +IC8 64M 8217 4E66 +IC9 64M 193C 6851 + +Serial: BBJE-01A1613 + +*/ + +ROM_START( pstone2 ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0x5000000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-23127.ic22", 0x0000000, 0x0400000, CRC(185761d6) SHA1(8c91b594dd59313d249c9da7b39dee21d3c9082e) ) + ROM_RELOAD( 0x400000, 0x400000) + ROM_LOAD("mpr-23118.ic1", 0x0800000, 0x0800000, CRC(c69f3c3c) SHA1(e96ad24473197f8581f5e4398244b9b76957bfdd) ) + ROM_LOAD("mpr-23119.ic2", 0x1000000, 0x0800000, CRC(a80d444d) SHA1(a7d2a5831412134a26ba37bf83e5ce38eb9f3928) ) + ROM_LOAD("mpr-23120.ic3", 0x1800000, 0x0800000, CRC(c285dd64) SHA1(e64507caedb9f312ab291b41b8d7fe8922eb434e) ) + ROM_LOAD("mpr-23121.ic4", 0x2000000, 0x0800000, CRC(1f3f6505) SHA1(da5eb3b9b5c85f5f0b4afe0c0ee8d034108300a2) ) + ROM_LOAD("mpr-23122.ic5", 0x2800000, 0x0800000, CRC(5e403a12) SHA1(e71c15e63c30e60b6db1fcd2841f66490f31579a) ) + ROM_LOAD("mpr-23123.ic6", 0x3000000, 0x0800000, CRC(4b71078b) SHA1(f3ed39402f585ae5cf6f8987bf6be6c6d46eafa1) ) + ROM_LOAD("mpr-23124.ic7", 0x3800000, 0x0800000, CRC(508c0207) SHA1(e50d97a17cdd6771fbc63a254a4d638e7daa8f57) ) + ROM_LOAD("mpr-23125.ic8", 0x4000000, 0x0800000, CRC(b9938bbc) SHA1(d55d7adecb5a5a4a276a5a17c12808085d980fd9) ) + ROM_LOAD("mpr-23126.ic9", 0x4800000, 0x0800000, CRC(fbb0325b) SHA1(21b965519d7508d84344641d43e8af2c3ca29ba4) ) +ROM_END + +/* + +SYSTEMID: NAOMI +JAP: OUTTRIGGER JAPAN +USA: OUTTRIGGER USA +EXP: OUTTRIGGER EXPORT + +NO. Type Byte Word +IC22 32M 0000 0000 +IC1 64M 362E D34B +IC2 64M 4EF4 FF8D +IC3 64M 5E77 9052 +IC4 64M E123 41B3 +IC5 64M 43A0 58D4 +IC6 64M C946 D3EE +IC7 64M 5313 3F17 +IC8 64M 2591 FEB7 +IC9 64M CBA3 E150 +IC10 64M 2639 D291 +IC11 64M 3A96 86EA +IC12 64M 8586 3ED5 +IC13 64M 9028 E59C +IC14 64M 8A42 26E2 +IC15 64M 98C4 1618 +IC16 64M 122B 8C85 +IC17 64M 3D5E F9B0 +IC18 64M 1EFA 490E +IC19 64M 9F22 6F77 + +Serial (from 2 carts): BAZE-01A0288 + BAZE-02A0217 + +*/ + +ROM_START( otrigger ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0xa000000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-22163.ic22", 0x0000000, 0x0400000, CRC(3bdafb6a) SHA1(c4c5a4ba94d85c4353df22d70bb08be67e9c22c3) ) + ROM_RELOAD( 0x400000, 0x400000) + ROM_LOAD("mpr-22142.ic1", 0x0800000, 0x0800000, CRC(5b45fa35) SHA1(7d3fbecc6f0dce2b13bfb21ed68f44632b91b94b) ) + ROM_LOAD("mpr-22143.ic2", 0x1000000, 0x0800000, CRC(b43c4d6d) SHA1(77e0b37ca3ee94b7f77d88ccb14bd0469a76aac0) ) + ROM_LOAD("mpr-22144.ic3", 0x1800000, 0x0800000, CRC(e78581af) SHA1(d1fe4da3f16dd5ebc7d9eaa092de1e16ec9c3321) ) + ROM_LOAD("mpr-22145.ic4", 0x2000000, 0x0800000, CRC(2b6274ea) SHA1(89165cf84ebb02e99163624c6d31da38aeec000e) ) + ROM_LOAD("mpr-22146.ic5", 0x2800000, 0x0800000, CRC(c24eb03f) SHA1(2f4b720b4ab106f891f4469b6e93a9979b1c1061) ) + ROM_LOAD("mpr-22147.ic6", 0x3000000, 0x0800000, CRC(578e36fd) SHA1(f39f74b046efbff7e7baf70effdd368605da496f) ) + ROM_LOAD("mpr-22148.ic7", 0x3800000, 0x0800000, CRC(e6053373) SHA1(e7bafaffeac9b6851a3fce060be21e8be8eaa71e) ) + ROM_LOAD("mpr-22149.ic8", 0x4000000, 0x0800000, CRC(cc86691b) SHA1(624958bc07eef5fac98642e9acd460cd5fe0c815) ) + ROM_LOAD("mpr-22150.ic9", 0x4800000, 0x0800000, CRC(f585d41d) SHA1(335df3d3f2631e5c03c39465cd702b77ce3f9717) ) + ROM_LOAD("mpr-22151.ic10", 0x5000000, 0x0800000, CRC(aae31a4b) SHA1(1472e477c2c6b89ca03824838757bdf20efbdf45) ) + ROM_LOAD("mpr-22152.ic11", 0x5800000, 0x0800000, CRC(5ed2c5ea) SHA1(2b9237eda566ccb87b4914db61a03e2c9035a280) ) + ROM_LOAD("mpr-22153.ic12s",0x6000000, 0x0800000, CRC(16630b85) SHA1(10e926c0d13270b5bf99d7456fe63baafc2df56a) ) + ROM_LOAD("mpr-22154.ic13s",0x6800000, 0x0800000, CRC(30a2d60b) SHA1(6431b2d4e5106e25e5517707c9667bcd714f43ac) ) + ROM_LOAD("mpr-22155.ic14s",0x7000000, 0x0800000, CRC(163993a5) SHA1(351a626a0dc9a3030b10fc0b822075f3010fdc05) ) + ROM_LOAD("mpr-22156.ic15s",0x7800000, 0x0800000, CRC(37720b4f) SHA1(bd60beadb0081ed20610c3988577bbf37bfdab07) ) + ROM_LOAD("mpr-22157.ic16s",0x8000000, 0x0800000, CRC(dfd6fa83) SHA1(e0dc9606f5521af16c29a30378e81843c8dbc188) ) + ROM_LOAD("mpr-22158.ic17s",0x8800000, 0x0800000, CRC(f5d96fe9) SHA1(d5d0ac3d6b7c9b851a18b22d5fb599710c684a76) ) + ROM_LOAD("mpr-22159.ic18s",0x9000000, 0x0800000, CRC(f8b5e99d) SHA1(bb174a6a80967d0ff05c3a7512e4f0f9c921d130) ) + ROM_LOAD("mpr-22160.ic19s",0x9800000, 0x0800000, CRC(579eef4e) SHA1(bfcabd57f623647053afcedcabfbc74e5736819f) ) +ROM_END + +/* + +SYSTEMID: NAOMI +JAP: AH! MY GODDESS QUIZ GAME-- +USA: AH! MY GODDESS QUIZ GAME-- +EXP: AH! MY GODDESS QUIZ GAME-- + +*/ + +ROM_START( qmegamis ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0x9000000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-23227.ic11", 0x0000000, 0x0400000, CRC(3f76087e) SHA1(664d28ef95394590b186e7badaf96ddaf781c104) ) //ic 22 + ROM_RELOAD( 0x400000, 0x400000) + /*ic 1 empty */ + ROM_LOAD32_WORD("mpr-23211.ic17", 0x1000000, 0x0800000, CRC(a46670e7) SHA1(dbcb72fdf444f07ce986af329e7ff2cb42721729) ) //ic 2 + ROM_LOAD32_WORD("mpr-23212.ic18", 0x1000002, 0x0800000, CRC(5e6839d5) SHA1(678c706f5c1eee65b32d9455ca4d0803c38349bd) ) //ic 3 + ROM_LOAD32_WORD("mpr-23213.ic19", 0x2000000, 0x0800000, CRC(98e5e2c1) SHA1(1d5338c625fcd979dd841c3e5de09a3bd3d239b6) ) //ic 4 + ROM_LOAD32_WORD("mpr-23214.ic20", 0x2000002, 0x0800000, CRC(37cfdd37) SHA1(e9097af91a164b6ffeed98008e85f4d4f00894df) ) //ic 5 + ROM_LOAD32_WORD("mpr-23215.ic21", 0x3000000, 0x0800000, CRC(f0d97107) SHA1(35422cd3238f516243fa6d1f282d802ff4f4ab17) ) //ic 6 + ROM_LOAD32_WORD("mpr-23216.ic22", 0x3000002, 0x0800000, CRC(68a9363f) SHA1(ca9a015f18041bff1a0c57a61a50143c42115f9d) ) //ic 7 + ROM_LOAD32_WORD("mpr-23217.ic23", 0x4000000, 0x0800000, CRC(1b49de82) SHA1(07b115d8e66f02fe3f184c23353fb11452dcb2b4) ) //ic 8 + ROM_LOAD32_WORD("mpr-23218.ic24", 0x4000002, 0x0800000, CRC(2c2c1e42) SHA1(ac8b1d580a8aaef184415ac4572eb9b2d5f37cf8) ) //ic 9 + ROM_LOAD32_WORD("mpr-23219.ic25", 0x5000000, 0x0800000, CRC(62957622) SHA1(ca7e2cd009fb38db3c25896ef8206350a7221fc8) ) //ic 10 + ROM_LOAD32_WORD("mpr-23220.ic26", 0x5000002, 0x0800000, CRC(70c2bea3) SHA1(3fe1d806358a35eced1f1c3a83e3593d92c3cf52) ) //ic 11 + ROM_LOAD32_WORD("mpr-23221.ic27", 0x6000000, 0x0800000, CRC(eb6a522e) SHA1(a7928d2296d67f7913d6582bdb6cd58b09d01673) ) //ic 12 + ROM_LOAD32_WORD("mpr-23222.ic28", 0x6000002, 0x0800000, CRC(f7d932bd) SHA1(e2b53fd30af5f45160aa988e3a80cee9330f0deb) ) //ic 13 + ROM_LOAD32_WORD("mpr-23223.ic29", 0x7000000, 0x0800000, CRC(2f8c15e0) SHA1(55c8554404263b629172d30dbb240104ab352c0f) ) //ic 14 + ROM_LOAD32_WORD("mpr-23224.ic30", 0x7000002, 0x0800000, CRC(bed270e1) SHA1(342199ac5903681f2bfdb9dfd57ce06202f14685) ) //ic 15 + ROM_LOAD32_WORD("mpr-23225.ic31", 0x8000000, 0x0800000, CRC(ea558614) SHA1(b7dfe5598639a8e59e3cbbee38b1d9a1d8e022ea) ) //ic 16 + ROM_LOAD32_WORD("mpr-23226.ic32", 0x8000002, 0x0800000, CRC(cd5da506) SHA1(2e76c8892c1d389b0f12a0046213f43d2ab07d78) ) //ic 17 +ROM_END + +/* + +SYSTEMID: NAOMI +JAP: SAMBA DE AMIGO +USA: SAMBADEAMIGO +EXP: SAMBADEAMIGO + +NO. Type Byte Word +IC22 32M 0000 0000 +IC1 64M B1FA 1BE9 +IC2 64M 51FD 0C32 +IC3 64M 8AA0 6E7A +IC4 64M 3B30 E31D +IC5 64M D604 FBE3 +IC6 64M 1D51 FF2D +IC7 64M EE89 720D +IC8 64M 0551 7046 +IC9 64M 6883 6427 +IC10 64M 70E5 CEC3 +IC11 64M E70E 0C63 +IC12 64M 0FD0 B1F8 +IC13 64M 2D48 6B19 +IC14 64M CBFF F163 +IC15 64M 10D1 E09D +IC16 64M A10B DDB4 + +*/ + +ROM_START( samba ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0x8800000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-22966b.ic22",0x0000000, 0x0400000, CRC(893116b8) SHA1(35cb4f40690ff21af5ab7cc5adbc53228d6fb0b3) ) + ROM_LOAD("mpr-22950.ic1", 0x0800000, 0x0800000, CRC(16dee15c) SHA1(b46849e492756ff406bf8956303472255fcf55a5) ) + ROM_LOAD("mpr-22951.ic2", 0x1000000, 0x0800000, CRC(f509496f) SHA1(41281576f7d58c8ede9c0a89bfd46a98d5b97033) ) + ROM_LOAD("mpr-22952.ic3", 0x1800000, 0x0800000, CRC(fb9b3ef0) SHA1(e9d44b673c273e97445a12186496a0594e291542) ) + ROM_LOAD("mpr-22953.ic4", 0x2000000, 0x0800000, CRC(07207ce0) SHA1(b802bb4e78f3737a4e333f819b9a4e0249037288) ) + ROM_LOAD("mpr-22954.ic5", 0x2800000, 0x0800000, CRC(c8e797d1) SHA1(fadbd1e24882787634229003245293ce79ba2617) ) + ROM_LOAD("mpr-22955.ic6", 0x3000000, 0x0800000, CRC(064ef007) SHA1(8325f9aa537ce329e71dce2b588a3d4fc176c37b) ) + ROM_LOAD("mpr-22956.ic7", 0x3800000, 0x0800000, CRC(fe8f2964) SHA1(3a33162f797cd93b7dbb313b531215e340719110) ) + ROM_LOAD("mpr-22957.ic8", 0x4000000, 0x0800000, CRC(74842c01) SHA1(b02884925270edb66831ab502a0aa2f9430adc9f) ) + ROM_LOAD("mpr-22958.ic9", 0x4800000, 0x0800000, CRC(b1ead447) SHA1(06b848eb7f592763768050a1ae82b4cac9499684) ) + ROM_LOAD("mpr-22959.ic10", 0x5000000, 0x0800000, CRC(d32d7983) SHA1(86a9e5eae4598b6998f0ea578d6152e66c1a0df1) ) + ROM_LOAD("mpr-22960.ic11", 0x5800000, 0x0800000, CRC(6c3b228e) SHA1(782c0fda106222be75b1973586c8bf78fd2186e7) ) + ROM_LOAD("mpr-22961.ic12s",0x6000000, 0x0800000, CRC(d6d26a8d) SHA1(7d416f8ac9fbbeb9bfe217ccc8eccf1644511110) ) + ROM_LOAD("mpr-22962.ic13s",0x6800000, 0x0800000, CRC(c2f41101) SHA1(0bf87cbffb7d6a5ab32543cef56c9759f475419a) ) + ROM_LOAD("mpr-22963.ic14s",0x7000000, 0x0800000, CRC(a53e9919) SHA1(d81eb79bc706f85ebfbc56a9b2889ae62d629e8e) ) + ROM_LOAD("mpr-22964.ic15s",0x7800000, 0x0800000, CRC(f581d5a3) SHA1(8cf769f5b0a48951246bb60e9cf58232bcee7bc8) ) + ROM_LOAD("mpr-22965.ic16s",0x8000000, 0x0800000, CRC(8f7bfa8a) SHA1(19f137b1552978d232785c4408805b71835585c6) ) +ROM_END + +/* + +SYSTEMID: NAOMI +JAP: SEGA MARINE FISHING IN JAPAN +USA: SEGA MARINE FISHING IN USA +EXP: SEGA MARINE FISHING IN EXPORT + +*/ + +ROM_START( smarinef ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0x6800000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-22221.ic22",0x0000000, 0x0400000, CRC(9d984375) SHA1(fe1185d70b4bc1529e3579fd6b2b678c7d548400) ) + ROM_LOAD("mpr-22208.ic1", 0x0800000, 0x0800000, CRC(6a1e418c) SHA1(7092c6a34ac0c2c6fb2b4b78415d08ef473785d9) ) + ROM_LOAD("mpr-22209.ic2", 0x1000000, 0x0800000, CRC(ecf5be54) SHA1(d7c264da4e232ce6f9b05c9920394f8027fa4a1d) ) + /* IC3 empty */ + /* IC4 empty */ + ROM_LOAD("mpr-22212.ic5", 0x2800000, 0x0800000, CRC(8305f462) SHA1(7993231fa71f509b3b7fec691b5a6139947a01e7) ) + ROM_LOAD("mpr-22213.ic6", 0x3000000, 0x0800000, CRC(0912eaea) SHA1(e4cb1262f3b53d3c619900767cfa192115a53d4b) ) + ROM_LOAD("mpr-22214.ic7", 0x3800000, 0x0800000, CRC(661526b6) SHA1(490321a893f706eaea49c6c35c01af6ae45adf01) ) + ROM_LOAD("mpr-22215.ic8", 0x4000000, 0x0800000, CRC(a80714fa) SHA1(b32dde5cc79a9ae9f7f34064c2382115e9303070) ) + ROM_LOAD("mpr-22216.ic9", 0x4800000, 0x0800000, CRC(cf3d1049) SHA1(a390304256dfac623b6fe1b205d918ce3eb67723) ) + ROM_LOAD("mpr-22217.ic10",0x5000000, 0x0800000, CRC(48c92fd6) SHA1(26b17a8d0130512807cf533a60c10c6d1e769de0) ) + ROM_LOAD("mpr-22218.ic11",0x5800000, 0x0800000, CRC(f9ca31b8) SHA1(ea3d0f38ca1a46c896c06f038a6362ad3c9f90b2) ) + ROM_LOAD("mpr-22219.ic12",0x6000000, 0x0800000, CRC(b3b45811) SHA1(045e7236b814f848d4c9767618ddcd4344d880ec) ) +ROM_END + +/* + +SYSTEMID: NAOMI +JAP: SPAWN JAPAN +USA: SPAWN USA +EXP: SPAWN EURO + +NO. Type Byte Word +IC22 32M FFFF FFFF +IC1 64M C56E 3D11 +IC2 64M A206 CC87 +IC3 64M FD3F C5DF +IC4 64M 5833 09A4 +IC5 64M B42C AA08 +IC6 64M C7A4 E2DE +IC7 64M 58CB 5DFD +IC8 64M 144B 783D +IC9 64M A4A8 D0BE +IC10 64M 94A8 401F + +Serial: BAVE-02A1305 + +*/ + +ROM_START( spawn ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0x5800000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-22977b.ic22",0x0000000, 0x0400000, CRC(814ff5d1) SHA1(5a0a9e55878927f98750000eb7d9391cbecfe21d) ) + ROM_LOAD("mpr-22967.ic1", 0x0800000, 0x0800000, CRC(78c7d914) SHA1(0a000e396f9a83c2c777cfb61212a82ec17417ba) ) + ROM_LOAD("mpr-22968.ic2", 0x1000000, 0x0800000, CRC(8c4ae1bb) SHA1(a91934a01d306c8fd8f987b3013f33aec028de70) ) + ROM_LOAD("mpr-22969.ic3", 0x1800000, 0x0800000, CRC(2928627c) SHA1(146844edd22b0caf00b40f7635c8753d5758e958) ) + ROM_LOAD("mpr-22970.ic4", 0x2000000, 0x0800000, CRC(12e27ffd) SHA1(d09096cd1ff9218cd849bfe05b34ec4d642e1663) ) + ROM_LOAD("mpr-22971.ic5", 0x2800000, 0x0800000, CRC(993d2bce) SHA1(f04e484704dbddbbff0f36ac5a019fbdde56d402) ) + ROM_LOAD("mpr-22972.ic6", 0x3000000, 0x0800000, CRC(e0f75067) SHA1(741ebef9e7ae6e5207f1819c3eea80491b934c63) ) + ROM_LOAD("mpr-22973.ic7", 0x3800000, 0x0800000, CRC(698498ca) SHA1(b3691409cbf644b8acea01abaebf7b2dea4dd4f7) ) + ROM_LOAD("mpr-22974.ic8", 0x4000000, 0x0800000, CRC(20983c51) SHA1(f7321abf8bf5f2a7329c98174e5cf9b1ebf596b2) ) + ROM_LOAD("mpr-22975.ic9", 0x4800000, 0x0800000, CRC(0d3c70d1) SHA1(22920bc5fd1dda760b5cb17482e9181be899bc08) ) + ROM_LOAD("mpr-22976.ic10", 0x5000000, 0x0800000, CRC(092d8063) SHA1(14fafd3f4c4f2b37172453d1c815fb9b8f4814f4) ) +ROM_END + +/* + +SYSTEMID: NAOMI +JAP: THE TYPING OF THE DEAD +USA: THE TYPING OF THE DEAD +EXP: THE TYPING OF THE DEAD + +*/ + +ROM_START( totd ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0xb000000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-23021a.ic22", 0x0000000, 0x0400000, CRC(07d21033) SHA1(d1e619d13c1c01648eb1a6964aad1554dd16c6d5) ) + + ROM_LOAD("mpr-23001.ic1", 0x0800000, 0x0800000, CRC(2eaab8ed) SHA1(e078bd8781e2a04e23fd18b11d118b2548fa59a8) ) + ROM_LOAD("mpr-23002.ic2", 0x1000000, 0x0800000, CRC(617edcc7) SHA1(10f92cd9be94739c7c2f94cf9a5fa54accbe6227) ) + ROM_LOAD("mpr-23003.ic3", 0x1800000, 0x0800000, CRC(37d6d9f8) SHA1(3ad3fa65f33d250eb8a620e7dc7c6b1209794a80) ) + ROM_LOAD("mpr-23004.ic4", 0x2000000, 0x0800000, CRC(e41186f2) SHA1(2f4b26d8dba1629db539736cf88ec85c21820aeb) ) + ROM_LOAD("mpr-23005.ic5", 0x2800000, 0x0800000, CRC(2b8e1fc6) SHA1(a5cd8c5840dd316dd1ad9500804b459476ca8ba0) ) + ROM_LOAD("mpr-23006.ic6", 0x3000000, 0x0800000, CRC(3de23e27) SHA1(d3aae2a7e5c78fc3bf8e296392d8f893961d946f) ) //on board but actually 0xff filled + ROM_LOAD("mpr-23007.ic7", 0x3800000, 0x0800000, CRC(ca16cfdf) SHA1(6279bc9bd661bde2d3e36ca52625f9b91867c4b4) ) + ROM_LOAD("mpr-23008.ic8", 0x4000000, 0x0800000, CRC(8c33191c) SHA1(6227fbb3d51c4301dd1fc60ec43df7c18eef06fa) ) + ROM_LOAD("mpr-23009.ic9", 0x4800000, 0x0800000, CRC(c982d24d) SHA1(d5a15d04f19f5569709b0b1cde64814230f4f0bb) ) + ROM_LOAD("mpr-23010.ic10",0x5000000, 0x0800000, CRC(c6e129b4) SHA1(642a9e1052efcb43d2b809f13d10617b43bd38f3) ) + ROM_LOAD("mpr-23011.ic11",0x5800000, 0x0800000, CRC(9e6942ff) SHA1(8c657d7d74c4c9106756a9934bc3c850f5069e29) ) + ROM_LOAD("mpr-23012.ic12s",0x6000000, 0x0800000, CRC(20e1ebe8) SHA1(e24cb5f48101e665c90af9be333e54ec274004fb) ) + ROM_LOAD("mpr-23013.ic13s",0x6800000, 0x0800000, CRC(3de23e27) SHA1(d3aae2a7e5c78fc3bf8e296392d8f893961d946f) ) //on board but actually 0xff filled + ROM_LOAD("mpr-23014.ic14s",0x7000000, 0x0800000, CRC(c4f95fdb) SHA1(8c0e806e27d7bed274dcb20b932897ea8b8bbf86) ) + ROM_LOAD("mpr-23015.ic15s",0x7800000, 0x0800000, CRC(5360c49d) SHA1(dbdf955d9bb9a387ded8ada18d26d222d73514d7) ) + ROM_LOAD("mpr-23016.ic16s",0x8000000, 0x0800000, CRC(fae2958b) SHA1(2bfe164723b7b2f57ae0c6e2fe348459f00dc460) ) + ROM_LOAD("mpr-23017.ic17s",0x8800000, 0x0800000, CRC(22337e15) SHA1(6a9f5569177c2936d8ff04da74e1fd036a093422) ) + ROM_LOAD("mpr-23018.ic18s",0x9000000, 0x0800000, CRC(5a608e74) SHA1(4f2ec47dad71d77ad1b8c640db236332c06d7ab7) ) + ROM_LOAD("mpr-23019.ic19s",0x9800000, 0x0800000, CRC(5cc91cc4) SHA1(66a68991f716ec23555784163aa5140b4e44c7ab) ) + ROM_LOAD("mpr-23020.ic20s",0xa000000, 0x0800000, CRC(b5943007) SHA1(d0e95084aec5e05027c21a6b4a3331408853781b) ) + //ic21 not populated +ROM_END + +/* + +SYSTEMID: NAOMI +JAP: VIRTUA NBA +USA: VIRTUA NBA +EXP: VIRTUA NBA + +NO. Type Byte Word +IC22 32M 0000 0000 +IC1 64M 5C4A BB88 +IC2 64M 1799 B55E +IC3 64M FB19 6FE8 +IC4 64M 6207 33FE +IC5 64M 38F0 F24C +IC6 64M A3B1 FF6F +IC7 64M 737F B4DD +IC8 64M FD19 49CE +IC9 64M 424E 76D5 +IC10 64M 84CC B74C +IC11 64M 8FC6 D9C8 +IC12 64M A838 143A +IC13 64M 88C3 456F +IC14 64M 1C72 971E +IC15 64M B950 F203 +IC16 64M 39F6 54CE +IC17 64M 91C7 47B0 +IC18 64M 5B94 7E77 +IC19 64M DE42 F390 +IC20 64M B876 73CE +IC21 64M AD60 2F74 + +*/ + +ROM_START( virnba ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0xb000000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-23073.ic22",0x0000000, 0x0400000, CRC(ce5c3d28) SHA1(ca3eeae1cf78435787338bb7b3e71301c0f71dd9) ) + ROM_LOAD("mpr-22928.ic1", 0x0800000, 0x0800000, CRC(63245c98) SHA1(a5a542244f07c6c8b66961a231fb56c89d2cf20c) ) + ROM_LOAD("mpr-22929.ic2", 0x1000000, 0x0800000, CRC(eea89d21) SHA1(5fe184267e637f155d767f8d931462d9593eff5a) ) + ROM_LOAD("mpr-22930.ic3", 0x1800000, 0x0800000, CRC(2fbefa9a) SHA1(a6df46cb8742022e436cdc6a9a50490c7a551421) ) + ROM_LOAD("mpr-22931.ic4", 0x2000000, 0x0800000, CRC(7332e559) SHA1(9147b69f84713f8e6c2c84b71ccd48bae879c655) ) + ROM_LOAD("mpr-22932.ic5", 0x2800000, 0x0800000, CRC(ef80e18c) SHA1(51406b82c66dc1822657948c62e1c4b8e628a739) ) + ROM_LOAD("mpr-22933.ic6", 0x3000000, 0x0800000, CRC(6a374076) SHA1(3b7c1ce5e3ae027e578c60a885724deeadc07448) ) + ROM_LOAD("mpr-22934.ic7", 0x3800000, 0x0800000, CRC(72f3ee15) SHA1(cf81e47c311769c9dc38fdbbef1a5e3f6b8a0be1) ) + ROM_LOAD("mpr-22935.ic8", 0x4000000, 0x0800000, CRC(35fda6e9) SHA1(857b3c0f576d69d3637503fa53608bc6484eb331) ) + ROM_LOAD("mpr-22936.ic9", 0x4800000, 0x0800000, CRC(b26df107) SHA1(900f1d06fdc9b6951de1b7e61a27ac846b2061db) ) + ROM_LOAD("mpr-22937.ic10",0x5000000, 0x0800000, CRC(477a374b) SHA1(309b723f7d2840d6a2f24ad2f877928cc8138a12) ) + ROM_LOAD("mpr-22938.ic11",0x5800000, 0x0800000, CRC(d59431a4) SHA1(6e3cd8cbde18a6a8672aa302cb119e486c0417e0) ) + ROM_LOAD("mpr-22939.ic12",0x6000000, 0x0800000, CRC(b31d3e6d) SHA1(d55e56a66dc678b973c3d60d3cffb59032bc3c46) ) + ROM_LOAD("mpr-22940.ic13",0x6800000, 0x0800000, CRC(90a81fbf) SHA1(5066b5eda80e881f6f399722f010161c0a452922) ) + ROM_LOAD("mpr-22941.ic14",0x7000000, 0x0800000, CRC(8a72a77d) SHA1(5ce73a76c7915d5a19b05f57b1dfdcd1fe3c53a1) ) + ROM_LOAD("mpr-22942.ic15",0x7800000, 0x0800000, CRC(710f709f) SHA1(2483f0b1106bc82710457a148772e50e83a439d8) ) + ROM_LOAD("mpr-22943.ic16",0x8000000, 0x0800000, CRC(c544f593) SHA1(553af7b6c63d6d6221c4286b8a13840a86e55d5f) ) + ROM_LOAD("mpr-22944.ic17",0x8800000, 0x0800000, CRC(cb096baa) SHA1(cbc267953a749dd24a03d87b65bc19b19bebf205) ) + ROM_LOAD("mpr-22945.ic18",0x9000000, 0x0800000, CRC(f2f914e8) SHA1(ec600abde40bfb5004ec8200ee0eef9410ebca6a) ) + ROM_LOAD("mpr-22946.ic19",0x9800000, 0x0800000, CRC(c79696c5) SHA1(4a9ac8b4ae1ce5d196e6c74fecc241b74aebc4ab) ) + ROM_LOAD("mpr-22947.ic20",0xa000000, 0x0800000, CRC(5e5eb595) SHA1(401d4a11d436988d716bb014b36233f171dc576d) ) + ROM_LOAD("mpr-22948.ic21",0xa800000, 0x0800000, CRC(1b0de917) SHA1(fd1742ea9bb2f1ce871ee3266171f26634e1c8e7) ) +ROM_END + +ROM_START( virnbao ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0xb000000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-22949.ic22",0x0000000, 0x0400000, CRC(fd91447e) SHA1(0759d6517aeb684d0cb809c1ae1350615cc0aecc) ) + ROM_LOAD("mpr-22928.ic1", 0x0800000, 0x0800000, CRC(63245c98) SHA1(a5a542244f07c6c8b66961a231fb56c89d2cf20c) ) + ROM_LOAD("mpr-22929.ic2", 0x1000000, 0x0800000, CRC(eea89d21) SHA1(5fe184267e637f155d767f8d931462d9593eff5a) ) + ROM_LOAD("mpr-22930.ic3", 0x1800000, 0x0800000, CRC(2fbefa9a) SHA1(a6df46cb8742022e436cdc6a9a50490c7a551421) ) + ROM_LOAD("mpr-22931.ic4", 0x2000000, 0x0800000, CRC(7332e559) SHA1(9147b69f84713f8e6c2c84b71ccd48bae879c655) ) + ROM_LOAD("mpr-22932.ic5", 0x2800000, 0x0800000, CRC(ef80e18c) SHA1(51406b82c66dc1822657948c62e1c4b8e628a739) ) + ROM_LOAD("mpr-22933.ic6", 0x3000000, 0x0800000, CRC(6a374076) SHA1(3b7c1ce5e3ae027e578c60a885724deeadc07448) ) + ROM_LOAD("mpr-22934.ic7", 0x3800000, 0x0800000, CRC(72f3ee15) SHA1(cf81e47c311769c9dc38fdbbef1a5e3f6b8a0be1) ) + ROM_LOAD("mpr-22935.ic8", 0x4000000, 0x0800000, CRC(35fda6e9) SHA1(857b3c0f576d69d3637503fa53608bc6484eb331) ) + ROM_LOAD("mpr-22936.ic9", 0x4800000, 0x0800000, CRC(b26df107) SHA1(900f1d06fdc9b6951de1b7e61a27ac846b2061db) ) + ROM_LOAD("mpr-22937.ic10",0x5000000, 0x0800000, CRC(477a374b) SHA1(309b723f7d2840d6a2f24ad2f877928cc8138a12) ) + ROM_LOAD("mpr-22938.ic11",0x5800000, 0x0800000, CRC(d59431a4) SHA1(6e3cd8cbde18a6a8672aa302cb119e486c0417e0) ) + ROM_LOAD("mpr-22939.ic12",0x6000000, 0x0800000, CRC(b31d3e6d) SHA1(d55e56a66dc678b973c3d60d3cffb59032bc3c46) ) + ROM_LOAD("mpr-22940.ic13",0x6800000, 0x0800000, CRC(90a81fbf) SHA1(5066b5eda80e881f6f399722f010161c0a452922) ) + ROM_LOAD("mpr-22941.ic14",0x7000000, 0x0800000, CRC(8a72a77d) SHA1(5ce73a76c7915d5a19b05f57b1dfdcd1fe3c53a1) ) + ROM_LOAD("mpr-22942.ic15",0x7800000, 0x0800000, CRC(710f709f) SHA1(2483f0b1106bc82710457a148772e50e83a439d8) ) + ROM_LOAD("mpr-22943.ic16",0x8000000, 0x0800000, CRC(c544f593) SHA1(553af7b6c63d6d6221c4286b8a13840a86e55d5f) ) + ROM_LOAD("mpr-22944.ic17",0x8800000, 0x0800000, CRC(cb096baa) SHA1(cbc267953a749dd24a03d87b65bc19b19bebf205) ) + ROM_LOAD("mpr-22945.ic18",0x9000000, 0x0800000, CRC(f2f914e8) SHA1(ec600abde40bfb5004ec8200ee0eef9410ebca6a) ) + ROM_LOAD("mpr-22946.ic19",0x9800000, 0x0800000, CRC(c79696c5) SHA1(4a9ac8b4ae1ce5d196e6c74fecc241b74aebc4ab) ) + ROM_LOAD("mpr-22947.ic20",0xa000000, 0x0800000, CRC(5e5eb595) SHA1(401d4a11d436988d716bb014b36233f171dc576d) ) + ROM_LOAD("mpr-22948.ic21",0xa800000, 0x0800000, CRC(1b0de917) SHA1(fd1742ea9bb2f1ce871ee3266171f26634e1c8e7) ) +ROM_END + +/* + +SYSTEMID: NAOMI +JAP: VIRTUA STRIKER 2 VER.2000 +USA: VIRTUA STRIKER 2 VER.2000 +EXP: VIRTUA STRIKER 2 VER.2000 + +NO. Type Byte Word +IC22 32M 2B49 A054 EPR21929C.22 +IC1 64M F5DD E983 MPR21914 +IC2 64M 4CB7 198B MPR21915 +IC3 64M 5661 47C0 MPR21916 +IC4 64M CD15 DC9A MPR21917 +IC5 64M 7855 BCC7 MPR21918 +IC6 64M 59D2 CB75 MPR21919 +IC7 64M B795 BE9C MPR21920 +IC8 64M D2DE 5AF2 MPR21921 +IC9 64M 7AAD 0DD5 MPR21922 +IC10 64M B31B 2C4E MPR21923 +IC11 64M 5C32 D746 MPR21924 +IC12 64M 1886 D5EA MPR21925 +IC13 64M D7B3 24D7 MPR21926 +IC14 64M 9EF2 E513 MPR21927 +IC15 32M 0DF9 FC01 MPR21928 + +*/ + +ROM_START( vs2_2k ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0x8000000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-21929.ic22", 0x0000000, 0x0400000, CRC(831af08a) SHA1(af4c74623be823fd061765cede354c6a9722fd10) ) + ROM_LOAD("mpr-21924.ic1", 0x0800000, 0x0800000, CRC(f91ef69b) SHA1(4ed23091efad7ddf1878a0bfcdcbba3cf151af84) ) + ROM_LOAD("mpr-21925.ic2", 0x1000000, 0x0800000, CRC(40128a67) SHA1(9d191c4ec33465f29bbc09491dde62f354a9ab15) ) + ROM_LOAD("mpr-21911.ic3", 0x1800000, 0x0800000, CRC(19708b3c) SHA1(7d1ef995ce870ffcb68f420a571efb084f5bfcf2) ) + ROM_LOAD("mpr-21926.ic4", 0x2000000, 0x0800000, CRC(b082379b) SHA1(42f585279da1de7e613e42b76e1b81986c48e6ea) ) + ROM_LOAD("mpr-21913.ic5", 0x2800000, 0x0800000, CRC(a3bc1a47) SHA1(0e5043ab6e118feb59f68c84c095cf5b1dba7d09) ) + ROM_LOAD("mpr-21914.ic6", 0x3000000, 0x0800000, CRC(b1dfada7) SHA1(b4c906bc96b615975f6319a1fdbd5b990e7e4124) ) + ROM_LOAD("mpr-21915.ic7", 0x3800000, 0x0800000, CRC(1c189e28) SHA1(93400de2cb803357fa17ae7e1a5297177f9bcfa1) ) + ROM_LOAD("mpr-21916.ic8", 0x4000000, 0x0800000, CRC(55bcb652) SHA1(4de2e7e584dd4999dc8e405837a18a904dfee0bf) ) + ROM_LOAD("mpr-21917.ic9", 0x4800000, 0x0800000, CRC(2ecda3ff) SHA1(54afc77a01470662d580f5676b4e8dc4d04f63f8) ) + ROM_LOAD("mpr-21918.ic10", 0x5000000, 0x0800000, CRC(a5cd42ad) SHA1(59f62e995d45311b1592434d1ffa42c261fa8ba1) ) + ROM_LOAD("mpr-21919.ic11", 0x5800000, 0x0800000, CRC(cc1a4ed9) SHA1(0e3aaeaa55f1d145fb4877b6d187a3ee78cf214e) ) + ROM_LOAD("mpr-21920.ic12s",0x6000000, 0x0800000, CRC(9452c5fb) SHA1(5a04f96d83cca6248f513de0c6240fc671bcadf9) ) + ROM_LOAD("mpr-21921.ic13s",0x6800000, 0x0800000, CRC(d6346491) SHA1(830971cbc14cab022a09ad4c6e11ee49c550e308) ) + ROM_LOAD("mpr-21922.ic14s",0x7000000, 0x0800000, CRC(a1901e1e) SHA1(2281f91ac696cc14886bcdf4b0685ce2f5bb8117) ) + ROM_LOAD("mpr-21923.ic15s",0x7800000, 0x0400000, CRC(d127d9a5) SHA1(78c95357344ea15469b84fa8b1332e76521892cd) ) +ROM_END + +/* + +SYSTEMID: NAOMI +JAP: POWER SMASH -------------- +USA: VIRTUA TENNIS IN USA ----- +EXP: VIRTUA TENNIS IN EXPORT -- + +NO. Type Byte Word +IC22 32M 0000 1111 +IC1 64M 7422 83DD +IC2 64M 7F26 A93D +IC3 64M 8E02 D3FC +IC4 64M 2545 F734 +IC5 64M E197 B75D +IC6 64M 9453 CF75 +IC7 64M 29AC 2FEB +IC8 64M 0434 2E9E +IC9 64M C86E 79E6 +IC10 64M C67A BF14 +IC11 64M F590 D280 + +*/ + +ROM_START( vtennis ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0x6000000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-22927.ic22", 0x0000000, 0x0400000, CRC(89781723) SHA1(cf644aa66abcec6964d77485a0292f11ba80dd0d) ) + ROM_RELOAD( 0x400000, 0x400000) + ROM_LOAD("mpr-22916.ic1", 0x0800000, 0x0800000, CRC(903873e5) SHA1(09af791bc02cca0e2dc72187679830ed9f4fc772) ) + ROM_LOAD("mpr-22917.ic2", 0x1000000, 0x0800000, CRC(5f020fa6) SHA1(bd2519be8c88ff34cf2fd2b17271d2b41b64ce9f) ) + ROM_LOAD("mpr-22918.ic3", 0x1800000, 0x0800000, CRC(3c3bf533) SHA1(db43ca9332e76b968b9b388b4824b768f82b9859) ) + ROM_LOAD("mpr-22919.ic4", 0x2000000, 0x0800000, CRC(3d8dd003) SHA1(91f494b06b9977215ab726a2499b5855d4d49e81) ) + ROM_LOAD("mpr-22920.ic5", 0x2800000, 0x0800000, CRC(efd781d4) SHA1(ced5a8dc8ff7677b3cac2a4fae04670c46cc96af) ) + ROM_LOAD("mpr-22921.ic6", 0x3000000, 0x0800000, CRC(79e75be1) SHA1(82318613c947907e01bbe50569b05ef24789d7c9) ) + ROM_LOAD("mpr-22922.ic7", 0x3800000, 0x0800000, CRC(44bd3883) SHA1(5c595d903d8865bf8bf3aafb1f527bff232718ed) ) + ROM_LOAD("mpr-22923.ic8", 0x4000000, 0x0800000, CRC(9ebdf0f8) SHA1(f1b688bda387fc00c70cb6a0c374c6c13926c138) ) + ROM_LOAD("mpr-22924.ic9", 0x4800000, 0x0800000, CRC(ecde9d57) SHA1(1fbe7fdf66a56f4f1765baf113dff95142bfd114) ) + ROM_LOAD("mpr-22925.ic10",0x5000000, 0x0800000, CRC(81057e42) SHA1(d41137ae28c64dbdb50150db8cf25851bc0709c4) ) + ROM_LOAD("mpr-22926.ic11",0x5800000, 0x0800000, CRC(57eec89d) SHA1(dd8f9a9155e51ee5260f559449fb0ea245077952) ) +ROM_END + +/* +SYSTEMID: NAOMI +JAP: ROYAL RUMBLE +USA: ROYAL RUMBLE +EXP: ROYAL RUMBLE +*/ + +ROM_START( wwfroyal ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0x8000000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-22261.ic22", 0x0000000, 0x0400000, CRC(60e5a6cd) SHA1(d74ee8318e40190231b94030176223da8305c053) ) + ROM_LOAD("ic1", 0x0800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic2", 0x1000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic3", 0x1800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic4", 0x2000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic5", 0x2800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic6", 0x3000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic7", 0x3800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic8", 0x4000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic9", 0x4800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic10",0x5000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic11",0x5800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic12",0x6000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic13",0x6800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic14",0x7000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic15",0x7800000, 0x0800000, NO_DUMP ) +ROM_END + +/* + +SYSTEMID: NAOMI +JAP: ZOMBIE REVENGE IN JAPAN +USA: ZOMBIE REVENGE IN USA +EXP: ZOMBIE REVENGE IN EXPORT + +NO. Type Byte Word +IC22 16M 0000 0000 +IC1 64M 899B 97E1 +IC2 64M 6F0B 2D2D +IC3 64M 4328 C898 +IC4 64M 0205 57C5 +IC5 64M 93A7 A717 +IC6 64M 936B A35B +IC7 64M 2F51 2BFC +IC8 64M D627 54C5 +IC9 64M D2F9 B84C +IC10 64M 9B5A B70B +IC11 64M 3F0F 9AEB +IC12 64M 5778 EBCA +IC13 64M 75DB 8563 +IC14 64M 427A 577C +IC15 64M A7B7 D0D6 +IC16 64M 9F01 FCFE +IC17 64M DFB4 58F7 +IC18 64M C453 B313 +IC19 64M 04B8 49FB + +Protection notes: +0C0E6758: 013C MOV.B @(R0,R3),R1 ;checks $c7a45b8+94, natively it's 0xbb, it should be 0 or 1 +0C0E675A: 611C EXTU.B R1,R1 +0C0E675C: 31C7 CMP/GT R12,R1 +0C0E675E: 1F11 MOV.L R1,@($04,R15) +0C0E6760: 8F04 BFS $0C0E676C ;if R12 > R1 go ahead, otherwise kill yourself +0C0E6762: E500 MOV #$00,R5 +0C0E6764: D023 MOV.L @($008C,PC),R0 [0C0E67F4] +0C0E6766: 2052 MOV.L R5,@R0 +0C0E6768: AFFE BRA $0C0E6768 +*/ + +ROM_START( zombrvn ) + ROM_REGION( 0x200000, "maincpu", 0) + NAOMI_BIOS + + ROM_REGION( 0xa000000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-21707.ic22", 0x0000000, 0x0200000, CRC(4daa11e9) SHA1(2dc219a5e0d0b41cce6d07631baff0495c479e13) ) + ROM_RELOAD( 0x200000, 0x200000) + ROM_RELOAD( 0x400000, 0x200000) + ROM_RELOAD( 0x600000, 0x200000) + ROM_LOAD("mpr-21708.ic1", 0x0800000, 0x0800000, CRC(b1ca1ca0) SHA1(7f6823c8f8b58d3102e73c153a3f4ce5ad70694d) ) + ROM_LOAD("mpr-21709.ic2", 0x1000000, 0x0800000, CRC(1ccc22bb) SHA1(0d0b4b13a997e33d89c0b67e579ff5cb63f49355) ) + ROM_LOAD("mpr-21710.ic3", 0x1800000, 0x0800000, CRC(954f49ba) SHA1(67d532048eeb0e7ddd77784138708b256a9386cd) ) + ROM_LOAD("mpr-21711.ic4", 0x2000000, 0x0800000, CRC(bda785e2) SHA1(85fe90fce718f278fc90d3b64411be2b420fef17) ) + ROM_LOAD("mpr-21712.ic5", 0x2800000, 0x0800000, CRC(38309255) SHA1(f693e76b520f25bc510ab1025303cd7e544d9386) ) + ROM_LOAD("mpr-21713.ic6", 0x3000000, 0x0800000, CRC(7c66c88e) SHA1(3bac6db0a5ea65b100911a9674312d4b94f6f57a) ) + ROM_LOAD("mpr-21714.ic7", 0x3800000, 0x0800000, CRC(dd8db07e) SHA1(087299d342e86f629e4878d592540faaba78d5c1) ) + ROM_LOAD("mpr-21715.ic8", 0x4000000, 0x0800000, CRC(7243da2e) SHA1(a797ff85527224d128268cf62e028ee8b308b406) ) + ROM_LOAD("mpr-21716.ic9", 0x4800000, 0x0800000, CRC(01dd88c2) SHA1(77b8bf78d760ad769964209e881e5eddc74d45d4) ) + ROM_LOAD("mpr-21717.ic10",0x5000000, 0x0800000, CRC(95139ec0) SHA1(90db6f18e18e842f731ef34892ac520fd9f4a8d6) ) + ROM_LOAD("mpr-21718.ic11",0x5800000, 0x0800000, CRC(4d36a24a) SHA1(0bc2d80e6149b2d97582a58fdf43d0bdbcfcedfc) ) + ROM_LOAD("mpr-21719.ic12",0x6000000, 0x0800000, CRC(2b86df0a) SHA1(1d6bf4d2568df3ce3a2e60dc51167b5344b00ebd) ) + ROM_LOAD("mpr-21720.ic13",0x6800000, 0x0800000, CRC(ff681ece) SHA1(896e2c484e640d8c426f0159a1be419e476ad14f) ) + ROM_LOAD("mpr-21721.ic14",0x7000000, 0x0800000, CRC(216abba6) SHA1(0819d727a235fe6a3ccfe6474fce9b13718e235c) ) + ROM_LOAD("mpr-21722.ic15",0x7800000, 0x0800000, CRC(b2de7e5f) SHA1(626bf13c40df936a34176821d38418214a5407cb) ) + ROM_LOAD("mpr-21723.ic16",0x8000000, 0x0800000, CRC(515932ae) SHA1(978495c9f9f24d0cdae5a44c3376f7a43f0ce9f5) ) + ROM_LOAD("mpr-21724.ic17",0x8800000, 0x0800000, CRC(f048aeb7) SHA1(39b7bf0ce65f6e13aa0ae5fd6a142959b9ce5acf) ) + ROM_LOAD("mpr-21725.ic18",0x9000000, 0x0800000, CRC(2202077b) SHA1(0893a85379f994277083c0bc5b178dd34508f816) ) + ROM_LOAD("mpr-21726.ic19",0x9800000, 0x0800000, CRC(429bf290) SHA1(6733e1bcf100e73ab43273f6feedc187fcaa55d4) ) +ROM_END + +/* GD-ROM titles - a PIC supplies a decryption key + +PIC stuff + +command response comment + +kayjyo!? ->:\x70\x1f\x71\x1f\0\0\0 (unlock gdrom) +C1strdf0 ->5BDA.BIN (lower part of boot filename string, BDA.BIN in this example) +D1strdf1 ->6\0\0\0\0\0\0\0 (upper part of filename string) +bsec_ver ->8VER0001 (always the same? ) +atestpic ->7TEST_OK (always the same? ) +AKEYCODE ->3....... (high 7 bytes of des key) +Bkeycode ->4.\0\0\0\0\0\0 (low byte of des key, then \0 fill) +!....... ->0DIMMID0 (redefine upper 7 bytes of session key) +"....... ->1DIMMID1 (redefine next 7 bytes) +#.. ->2DIMMID2 (last 2 bytes) + + +default session key is +"NAOMIGDROMSYSTEM" + +info from Elsemi: + +it sends bsec_ver, and if it's ok, then the next commands are the session key changes +if you want to have the encryption described somewhere so it's not lost. it's simple: +unsigned char Enc(unsigned char val,unsigned char n) +{ + val^=Key[8+n]; + val+=Key[n]; + + return val; +} + +do for each value in the message to send +that will encrypt the char in the nth position in the packet to send +time to go to sleep + + +*/ + +#ifdef UNUSED_FUNCTION +// rather crude function to write out a key file +void naomi_write_keyfile(void) +{ + // default key structure + UINT8 response[10][8] = { + { ':', 0x70, 0x1f, 0x71, 0x1f, 0x00, 0x00, 0x00 }, // response to kayjyo!? + { '8', 'V', 'E', 'R', '0', '0', '0', '1' }, // response to bsec_ver + { '7', 'T', 'E', 'S', 'T', '_', 'O', 'K' }, // response to atestpic + { '6', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // response to D1strdf1 (upper part of filename) + { '5', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // response to C1strdf0 (lower part of filename) + { '4', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // response to Bkeycode (lower byte of DES key) + { '3', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // response to AKEYCODE (high 7 bytes of DES key) + { '2', 'D', 'I', 'M', 'M', 'I', 'D', '2' }, // response to #.. (rewrite low 2 bytes of session key) + { '1', 'D', 'I', 'M', 'M', 'I', 'D', '1' }, // response to "....... (rewrite middle 7 bytes of session key) + { '0', 'D', 'I', 'M', 'M', 'I', 'D', '0' }, // response to !....... (rewrite upper 7 bytes of session key) + }; + + int i; + char bootname[256]; + char picname[256]; + + // ######### edit this ########### + UINT64 key = 0x4FF16D1A9E0BFBCDULL; + + memset(bootname,0x00,14); + memset(picname,0x00,256); + + // ######### edit this ########### + strcpy(picname,"317-5072-com.data"); + strcpy(bootname,"BCY.BIN"); + + for (i=0;i<14;i++) + { + if (i<7) + { + response[4][i+1] = bootname[i]; + } + else + { + response[3][i-6] = bootname[i]; + } + } + + for (i=0;i<8;i++) + { + UINT8 keybyte = (key>>(7-i)*8)&0xff; + + if (i<7) + { + response[6][i+1] = keybyte; + } + else + { + response[5][1] = keybyte; + } + } + + + { + FILE *fp; + fp=fopen(picname, "w+b"); + if (fp) + { + fwrite(response, 10*8, 1, fp); + fclose(fp); + } + } + + +} +#endif + +/* All games have the regional titles at the start of the IC22 rom in the following order + + JAPAN + USA + EXPORT (EURO in some titles) + KOREA (ASIA in some titles) + AUSTRALIA + UNUSED + UNUSED + UNUSED + + with the lists below it has been assumed that if the title is listed for a region + then it is available / works in that region, this has not been confirmed as correct. + +*/ + +/* Naomi & Naomi GD-ROM */ +GAME( 1998, naomi, 0, naomi, naomi, naomi, ROT0, "Sega", "Naomi Bios", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT ) + +/* Complete Dumps */ +/* 840-xxxxx (Sega games)*/ +/* 0001C */ GAME( 1998, dybbnao, naomi, naomi, naomi, naomi, ROT0, "Sega", "Dynamite Baseball NAOMI (JPN)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0003C */ GAME( 1999, zombrvn, naomi, naomi, naomi, naomi, ROT0, "Sega", "Zombie Revenge (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0007C */ GAME( 1999, ggram2, naomi, naomi, naomi, naomi, ROT0, "Sega", "Giant Gram (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0010C */ GAME( 1999, vs2_2k, naomi, naomi, naomi, naomi, ROT0, "Sega", "Virtua Striker 2 Ver. 2000 (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0011C */ GAME( 1999, toyfight, naomi, naomi, naomi, naomi, ROT0, "Sega", "Toy Fighter", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0015C */ GAME( 1999, vtennis, naomi, naomi, naomi, naomi, ROT0, "Sega", "Power Smash (JPN) / Virtua Tennis (USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0016C */ GAME( 1999, derbyoc, naomi, naomi, naomi, naomi, ROT0, "Sega", "Derby Owners Club (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0017C */ GAME( 1999, otrigger, naomi, naomi, naomi, naomi, ROT0, "Sega", "OutTrigger (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0019C */ GAME( 1999, dybb99, naomi, naomi, naomi, naomi, ROT0, "Sega", "Dynamite Baseball '99 (JPN) / World Series '99 (USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0020C */ GAME( 1999, samba, naomi, naomi, naomi, naomi, ROT0, "Sega", "Samba De Amigo (JPN)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0021C */ GAME( 2000, virnba, naomi, naomi, naomi, naomi, ROT0, "Sega", "Virtua NBA (JPN, USA, EXP, KOR, AUS)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0021C */ GAME( 2000, virnbao, virnba, naomi, naomi, naomi, ROT0, "Sega", "Virtua NBA (JPN, USA, EXP, KOR, AUS) (original)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0026C */ GAME( 2000, totd, naomi, naomi, naomi, naomi, ROT0, "Sega", "The Typing of the Dead (JPN, USA, EXP, KOR, AUS)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0027C */ GAME( 2000, smarinef, naomi, naomi, naomi, naomi, ROT0, "Sega", "Sega Marine Fishing", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0030C */ GAME( 2000, qmegamis, naomi, naomi, naomi, naomi, ROT0, "Sega", "Quiz Ah Megamisama (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0039C */ GAME( 2000, gram2000, naomi, naomi, naomi, naomi, ROT0, "Sega", "Giant Gram 2000 (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0041C */ GAME( 2000, slasho, naomi, naomi, naomi, naomi, ROT0, "Sega", "Slashout (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0044C */ GAME( 2001, csmash, naomi, naomi, naomi, naomi, ROT0, "Sega", "Cosmic Smash (JPN, USA, EXP, KOR, AUS) (rev. A)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0044C */ GAME( 2001, csmasho, csmash, naomi, naomi, naomi, ROT0, "Sega", "Cosmic Smash (JPN, USA, EXP, KOR, AUS) (original)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) + +/* 841-xxxxx ("Licensed by Sega" games)*/ +/* 0001C */ GAME( 1999, pstone, naomi, naomi, naomi, naomi, ROT0, "Capcom", "Power Stone (JPN, USA, EUR, ASI, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0002C */ GAME( 1999, suchie3, naomi, naomi, naomi_mp, naomi_mp, ROT0, "Jaleco", "Idol Janshi Suchie-Pai 3 (JPN)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0003C */ GAME( 1999, doa2, naomi, naomi, naomi, naomi, ROT0, "Tecmo", "Dead or Alive 2 (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0003C */ GAME( 2000, doa2m, doa2, naomi, naomi, naomi, ROT0, "Tecmo", "Dead or Alive 2 Millennium (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0004C */ GAME( 1999, shangril, naomi, naomi, naomi_mp, naomi_mp, ROT0, "Marvelous Ent.", "Dengen Tenshi Taisen Janshi Shangri-la (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0005C */ GAME( 1999, spawn, naomi, naomi, naomi, naomi, ROT0, "Capcom", "Spawn (JPN, USA, EUR, ASI, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0007C */ GAME( 2000, mvsc2, naomi, naomi, naomi, naomi, ROT0, "Capcom", "Marvel vs. Capcom 2 (JPN, USA, EUR, ASI, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0008C */ GAME( 2000, pstone2, naomi, naomi, naomi, naomi, ROT0, "Capcom", "Power Stone 2 (JPN, USA, EUR, ASI, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0012C */ GAME( 2000, cspike, naomi, naomi, naomi, naomi, ROT0, "Psikyo / Capcom", "Gun Spike (JPN) / Cannon Spike (USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0013C */ GAME( 2000, ggx, naomi, naomi, naomi, naomi, ROT0, "Arc System Works","Guilty Gear X (JPN)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 0016 */ GAME( 2000, deathcox, naomi, naomi, naomi, naomi, ROT0, "Ecole", "Death Crimson OX (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* xxxx */ GAME( 2001, hmgeo, naomi, naomi, naomi, naomi, ROT0, "Capcom", "Heavy Metal Geomatrix (JPN, USA, EUR, ASI, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) + +/* Incomplete Dumps (just the program rom IC22) */ +/* 841-0011C */ GAME( 2000, capsnk, naomi, naomi, naomi, naomi, ROT0, "Capcom / SNK", "Capcom Vs. SNK Millennium Fight 2000 (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 840-0083C */ GAME( 1999, derbyoc2, naomi, naomi, naomi, naomi, ROT0, "Sega", "Derby Owners Club II (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 841-0014C */ GAME( 2000, gwing2, naomi, naomi, naomi, naomi, ROT0, "Takumi / Capcom", "Giga Wing 2 (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 841-0015C */ GAME( 2000, pjustic, naomi, naomi, naomi, naomi, ROT0, "Capcom", "Moero Justice Gakuen (JPN) / Project Justice (USA, EXP, KOR, AUS) ", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +/* 840-0040C */ GAME( 2000, wwfroyal, naomi, naomi, naomi, naomi, ROT0, "Sega", "WWF Royal Rumble (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) + +/* Games with game specific bios sets */ +GAME( 1998, hod2bios, 0, naomi, naomi, 0, ROT0, "Sega", "Naomi House of the Dead 2 Bios", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT ) +/* HOTD2 isn't dumped */ +GAME( 1999, f355bios, 0, naomi, naomi, 0, ROT0, "Sega", "Naomi Ferrari F355 Challenge Bios", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT ) +GAME( 1999, f355, f355bios, naomi, naomi, 0, ROT0, "Sega", "Ferrari F355 Challenge", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) + +/********************************************** + * + * Naomi GD-ROM defines + * + *********************************************/ + +ROM_START( gundmgd ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0001", 0, SHA1(615e19c22f32096f3aad557019a14313b60a4070) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-5069-COM) + //(sticker 253-5509-5069) + ROM_LOAD("317-5069-com.data", 0x00, 0x50, CRC(8e2f0cbd) SHA1(a5f3a990a03bfa50a1a742593c5ec07645c8718d) ) +ROM_END + + +ROM_START( sfz3ugd ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0002", 0, SHA1(af4669fdd7ce8e6ec4a170748d401e322a3d7ae8) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-5072-COM) + //(sticker 253-5509-5072) + ROM_LOAD("317-5072-com.data", 0x00, 0x50, CRC(6d2992b9) SHA1(88e6dc6711f9f883362ba1217a3350d452a70896) ) +ROM_END + +ROM_START( cvsgd ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0004", 0, SHA1(7a7fba0fbbc769c5120b08e6d692f1ac63a42225) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-5076-JPN) + //(sticker 253-5509-5076J) + ROM_LOAD("317-5076-jpn.data", 0x00, 0x50, CRC(5004161b) SHA1(8b2cdfec12ffd9160bc74659e08d07cbc46a4011) ) +ROM_END + + +ROM_START( gundmxgd ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0006", 0, SHA1(b28d6598711b5a9c744bbf07ad03fc60962d2e28) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-5079-COM) + //(sticker 253-5509-5079) + ROM_LOAD("317-5079-com.data", 0x00, 0x50, CRC(e6abe978) SHA1(700e610d84e517793a22d6cabd1aef9c3b8bc092) ) +ROM_END + + +ROM_START( cvs2gd ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0007a", 0, SHA1(56510390667b39b3915d8bc078660cbe093cf566) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-5078-COM) + //(sticker 253-5509-5078) + ROM_LOAD("317-5078-com.data", 0x00, 0x50, CRC(1c8d94ee) SHA1(bec4a6901f62dc8f76f7b9d72284b3eaac340bf3) ) +ROM_END + +ROM_START( ikaruga ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0010", 0, SHA1(65dcc22dd9e9b70975096464ad8e31a4a73dc5fd) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-5081-JPN) + //(sticker 253-5509-5081J) + ROM_LOAD("317-5081-jpn.data", 0x00, 0x50, CRC(d4cc5c8c) SHA1(44c0c5c2744fbd419b684cbc36f01973487bafbc) ) +ROM_END + + +ROM_START( ggxx ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0011", 0, SHA1(b7328eb2c588d55284bdcea0fe89bb8e629a8669) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-5082-COM) + //(sticker 253-5509-5082) + ROM_LOAD("317-5082-com.data", 0x00, 0x50, CRC(fa31209d) SHA1(bb18e6412a02510832f7200a06a3179ef1695ef2) ) +ROM_END + + +ROM_START( moeru ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0013", 0, SHA1(c8869069c28bc8eec96d820886bc388d69d46143) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-5084-JPN) + //(sticker 253-5509-5084J) + ROM_LOAD("317-5084-jpn.data", 0x00, 0x50, CRC(56de2066) SHA1(a16a6d9f7272d3f8d322c85222a0487a87811910) ) +ROM_END + + +ROM_START( chocomk ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0014a", 0, SHA1(f88d8203c8692f51c9492d5549a3ad7d9583dc6f) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-5085-JPN) + //(sticker 253-5509-5085J) + ROM_LOAD("317-5085-jpn.data", 0x00, 0x50, CRC(eecd8140) SHA1(471fb6b242eff646173265df891109e3e0a37a7d) ) +ROM_END + + +ROM_START( quizqgd ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0017", 0, SHA1(94a9319633388968611892e36691b45c94b4f83f) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-5090-JPN) + //(sticker 253-5509-5090J) + ROM_LOAD("317-5090-jpn.data", 0x00, 0x50, CRC(b4dd88f6) SHA1(c9aacd79c1088225fa5a69b7bd31a7c1286160e1) ) +ROM_END + + +ROM_START( ggxxrl ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0019a", 0, SHA1(d44906505ff698eda6feee6c2b9402e19f64e5d3) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-5092-JPN) + //(sticker 253-5509-5092J) + ROM_LOAD("317-5092-jpn.data", 0x00, 0x50, CRC(7c8cca4b) SHA1(92c5a0fd8916744eefc023e64daea69803573928) ) +ROM_END + + +ROM_START( tetkiwam ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0020", 0, SHA1(7b2ef47ca2038d6a93615b760b03e8f7cb1b83c2) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-5093-JPN) + //(sticker 253-5509-5093J) + ROM_LOAD("317-5093-jpn.data", 0x00, 0x50, CRC(06bc5013) SHA1(f7a46b7e34b20409ce2fdae80e5cdfff7adb9c64) ) +ROM_END + + +ROM_START( shikgam2 ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0021", 0, SHA1(f5036711a28a211e8d71400a8322db3172c5733f) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-5095-JPN) + //(sticker 253-5509-5095J) + ROM_LOAD("317-5095-jpn.data", 0x00, 0x50, CRC(6033ec89) SHA1(9e99a8ad43fa29296dbf2e13b3a3d4552130b4e8) ) +ROM_END + + +ROM_START( usagui ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0022", 0, SHA1(45deba05a12abbf6390c0fc0e4cdeaedfa7d2ca5) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-5096-JPN) + //(sticker 253-5509-5096J) + ROM_LOAD("317-5096-jpn.data", 0x00, 0x50, CRC(621e827a) SHA1(cdc7580f5d1dfe85d2806233f22bc4f13fd62946) ) +ROM_END + + +ROM_START( bdrdown ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0023a", 0, SHA1(caac915104d61f2122f5afe27da1ef5fa9cf9f9a) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-5097-JPN) + //(sticker 253-5509-5097J) + ROM_LOAD("317-5097-jpn.data", 0x00, 0x50, CRC(e689d047) SHA1(7e3e298d9a8076af0254faeb0eb89fbfce94718d) ) +ROM_END + + +ROM_START( psyvar2 ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0024", 0, SHA1(d346762036fb1c40a261a434b50e63459f306f14) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C621A (317-5100-JPN) + //(sticker 253-5509-5100J) + ROM_LOAD("317-5100-jpn.data", 0x00, 0x50, CRC(94316f0f) SHA1(e1ec2b4225105dbaa1e59e8a05027e73f7b725a9) ) +ROM_END + + +ROM_START( cfield ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0025", 0, SHA1(be0d88eb4f48403a2ceaa7ef588ed60b96ba93bf) ) + + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C621A (317-5102-COM) + //(sticker 253-5509-5102) + ROM_LOAD("317-5102-com.data", 0x00, 0x50, CRC(32adf2eb) SHA1(d86752e6fe9ccac093c512828fca5b7ae62a3ff2) ) +ROM_END + + +ROM_START( trizeal ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0026", 0, SHA1(e4c1e51292a7923b25bfc61d38fe386bf596002a) ) + + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C621A (317-5103-JPN) + //(sticker 253-5509-5103J) + ROM_LOAD("317-5103-jpn.data", 0x00, 0x50, CRC(3affbf82) SHA1(268746e86e7546f4bab54bdd268f7b58f10c1aaf) ) +ROM_END + + +ROM_START( meltybld ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0028c", 0, SHA1(66de09738551e351784cc9695a58b35fdf6b6c4b) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-5104-JPN) + //(sticker 253-5509-5104J) + ROM_LOAD("317-5104-jpn.data", 0x00, 0x50, CRC(fedc8305) SHA1(c535545937213f726f25e6aa8eb3746a794e9100) ) +ROM_END + + +ROM_START( senko ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0030a", 0, SHA1(1f7ade47e37a0026451b5baf3ba746400de8d156) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-5107-JPN) + //(sticker 253-5509-5107J) + ROM_LOAD("317-5107-jpn.data", 0x00, 0x50, CRC(7b607409) SHA1(a9946a0637453e4813bef18060d4420355cff800) ) +ROM_END + +ROM_START( senkoo ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0030", 0, SHA1(c7f25c05f47a490c5da9369c588b6136e93c280e) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C621A (317-5107-JPN) + //(sticker 253-5509-5107J) + ROM_LOAD("317-5107-jpn.data", 0x00, 0x50, CRC(7b607409) SHA1(a9946a0637453e4813bef18060d4420355cff800) ) +ROM_END + + +ROM_START( ss2005 ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0031a", 0, SHA1(6091525845fc2042ed43cae5a1b60c603e16cf97) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-5108-JPN) + //(sticker 253-5509-5108J) + ROM_LOAD("317-5108-jpn.data", 0x00, 0x50, CRC(6a2eb334) SHA1(cab407d2e994f33aa921d50f399b17e6fbf98eb0) ) +ROM_END + + +ROM_START( radirgy ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0032", 0, SHA1(ebd7a40e59082e660ebf9a2d4ae7cb64371dae8d) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C621A (317-5110-JPN) + //(sticker 253-5509-5110J) + ROM_LOAD("317-5110-jpn.data", 0x00, 0x50, CRC(04e4ac45) SHA1(4102a4d68f20a7e78f6c7e3494e7229018e30e39) ) +ROM_END + + +ROM_START( ggxxsla ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0033a", 0, SHA1(29de69ae97a9099b1bbe936dfa965bb4a3195f68) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C621A (317-5111-JPN) + //(sticker 253-5509-5111J) + ROM_LOAD("317-5111-jpn.data", 0x00, 0x50, CRC(a517c70d) SHA1(5f9798941355fb9abce511508c860653d6369e72) ) +ROM_END + + +ROM_START( kurucham ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0034", 0, SHA1(10fd7edb0b620133c003d686e5af2ed27004fa09) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C621A (317-5115-JPN) + //(sticker 253-5509-5115J) + ROM_LOAD("317-5115-jpn.data", 0x00, 0x50, CRC(f40072a8) SHA1(366df2079a4d2ff7a93082c9bf849aad40ab079d) ) +ROM_END + + +ROM_START( undefeat ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0035", 0, SHA1(91da482a6a082e48bee5b3bd20d9c92d23936965) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-5117-JPN) + //(sticker 253-5509-5117J) + ROM_LOAD("317-5117-jpn.data", 0x00, 0x50, CRC(f90f6d3b) SHA1(a18f803a8e951c375a3a55e4b0e74b698ae93f92) ) +ROM_END + + +ROM_START( meltyb ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0039", 0, SHA1(ffc7f6e113ad69422a4f22f318bdf9b1dc5c25db) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-5124-JPN) + //(sticker 253-5509-5124J) + ROM_LOAD("317-5124-jpn.data", 0x00, 0x50, CRC(4d6e2c77) SHA1(3bed734c291140d0a61afa40f221395369a251a9) ) +ROM_END + +ROM_START( meltyba ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0039a", 0, SHA1(e6aa3d65b43a20606e6754bcb8665438770a1f8c) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-5124-JPN) + //(sticker 253-5509-5124J) + ROM_LOAD("317-5124-jpn.data", 0x00, 0x50, CRC(4d6e2c77) SHA1(3bed734c291140d0a61afa40f221395369a251a9) ) +ROM_END + + +ROM_START( trgheart ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0036a", 0, SHA1(91f1e19136997cb1e2edfb1ad342b9427d1d3bfb) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-5121-JPN) + //(sticker 253-5509-5121J) + ROM_LOAD("317-5121-jpn.data", 0x00, 0x50, CRC(a417b20f) SHA1(af6ed7ebf95948bff3e8df915b229189b8de1e46) ) +ROM_END + + +ROM_START( jingystm ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0037", 0, SHA1(99ffe2987e3002b3871daf276d2be45f2e9c6e74) ) + + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-5122-JPN) + //(sticker 253-5509-5122J) + ROM_LOAD("317-5122-jpn.data", 0x00, 0x50, CRC(0b85b7e4) SHA1(f4e419682ddc4b98a330e5ae543f9276c9bde030) ) +ROM_END + + +ROM_START( karous ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0040", 0, SHA1(a62c8d4b6c5be44a4aeeea1a1a94f3d0fe542593) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C621A (317-5125-COM) + //(sticker 253-5509-5125) + ROM_LOAD("317-5125-com.data", 0x00, 0x50, CRC(9d37b5e3) SHA1(e1d3cdc2ed82c864c9ff54d9399a80b70ba150c5) ) +ROM_END + + +ROM_START( takoron ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdl-0042", 0, SHA1(984a4fa012d83dd8c748304958c847c9867f4125) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C621A (317-5127-JPN) + //(sticker 253-5509-5127J) + ROM_LOAD("317-5127-jpn.data", 0x00, 0x50, CRC(e1a6dbe4) SHA1(61b458937acca55e4010f86b684aaa86b8c10eac) ) +ROM_END + +/* -------------------------------- 1st party -------------- */ + + +/* +Title CONFIDENTIAL MISSION +Media ID FFCA +Media Config GD-ROM1/1 +Regions J +Peripheral String 0000000 +Product Number GDS-0001 +Version V1.050 +Release Date 20001011 +Manufacturer ID SEGA ENTERPRISES +TOC DISC +Track Start Sector End Sector Track Size +track01.bin 150 3788 8558928 +track02.raw 3939 6071 5016816 +track03.bin 45150 549299 1185760800 + + +PIC +317-0298-COM +*/ + +ROM_START( confmiss ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0001", 0, SHA1(bd05f197ba8643577883dd25d9d5a74c91b27ca9) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + ROM_LOAD("317-0298-com.data", 0x00, 0x50, CRC(c989b336) SHA1(40075500888626cc2261133eec496b3e753631e5) ) +ROM_END + + +ROM_START( sprtjam ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0003", 0, SHA1(caaba214c1faca78b3370bcd4190eb2853d7f825) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-0300-COM) + //(sticker 253-5508-0300) + ROM_LOAD("317-0300-com.data", 0x00, 0x50, CRC(9a08413f) SHA1(d57649dcc3af578d55a93dd7a3f41da62d580f54) ) +ROM_END + + +ROM_START( slashout ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0004", 0, SHA1(3cce788393ed194ba9b603f9896ff893691d6b00) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-0302-COM) + //(sticker 253-5508-0302) + ROM_LOAD("317-0302-com.data", 0x00, 0x50, CRC(4bf6cd62) SHA1(c1fdf12a4d80fa3008170c89d2dc583f19e0450b) ) +ROM_END + + +ROM_START( spkrbtl ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0005", 0, SHA1(d1c3fb2350e4a89372373e7f629c42b741af29b3) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-0303-COM) + //(sticker 253-5508-0303) + ROM_LOAD("317-0303-com.data", 0x00, 0x50, CRC(6e7888a3) SHA1(5ca78052bcfd9e9f81934cbddd9c173e88973e0e) ) +ROM_END + +/* +Title MONKEY_BALL +Media ID 43EB +Media Config GD-ROM1/1 +Regions J +Peripheral String 0000000 +Product Number GDS-0008 +Version V1.008 +Release Date 20010425 +Manufacturer ID +Track Start Sector End Sector Track Size +track01.bin 150 449 705600 +track02.raw 600 2732 5016816 +track03.bin 45150 549299 1185760800 + + +PIC + +253-5508-0307 +317-0307-COM +*/ + +ROM_START( monkeyba ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0008", 0, SHA1(2fadcd141bdbde77b2b335b270959a516af44d99) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + ROM_LOAD("317-0307-com.data", 0x00, 0x50, CRC(448bedc7) SHA1(092dbe5e28890d3ee40d62ca8cbf225c3ce90304) ) +ROM_END + +/* +This is the I/O board used for Dynamic Golf which is +located under the panel. +It must be connected to the normal I/O board with a USB cable. + +PCB Layout +---------- + +837-13938 +|--------------------| +|CN2 CN1 | +| | +| |-----| | +| | IC2 | | +| CN3 | | | +| |-----| IC3| +|LED CN4 IC4 | +|--------------------| +Notes: + CN1 - 24 pin connector. not used + CN2 - 4 pin connector used for 5 volt power input + CN3 - USB connector type B + CN4 - 16 pin connector used for buttons and trackball + IC1 - HC240 logic IC (SOIC20) + IC2 - Sega 315-6146 custom IC (QFP176) + IC3 - 27C512 EPROM with label 'EPR-22084' (DIP28) + IC4 - HC4020 logic IC (SOIC16) +*/ + +ROM_START( dygolf ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0009", 0, SHA1(d502155ddaf881c2c9505528004b9904aa32a59c) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-0308-COM) + //(sticker 253-5508-0308) + ROM_LOAD("317-0308-com.data", 0x00, 0x50, CRC(56f63af0) SHA1(3c453226fc53d2f700b3634db3ef8ce206d94392) ) + + ROM_REGION( 0x10000, "io_board", 0) + ROM_LOAD("epr-22084.ic3", 0x0000, 0x10000, CRC(18cf58bb) SHA1(1494f8215231929e41bbe2a133658d01882fbb0f) ) +ROM_END + + +ROM_START( wsbbgd ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0010", 0, SHA1(c3135ede3a8bdadab91aed49abacbfbde8037069) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-0309-COM) + //(sticker 253-5508-0309) + ROM_LOAD("317-0309-com.data", 0x00, 0x50, CRC(8792c550) SHA1(e8d6d91583d1673d8d3fa9ccb0ab1097c5c5ad08) ) +ROM_END + + +ROM_START( vtennisg ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0011", 0, SHA1(b778403d73c8cdd13383691c9be2094ddfc1ba84) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C621A (317-0312-COM) + //(sticker 253-5508-0312) + ROM_LOAD("317-0312-com.data", 0x00, 0x50, CRC(6b24f78f) SHA1(43f89815ec46cf014d941b4b9238da044b338b4c) ) +ROM_END + +ROM_START( keyboard ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0017", 0, SHA1(fb86eff3ef38de7fd78cfde897d5332d2092c172) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + ROM_LOAD("317-0323-com.data", 0x00, 0x50, CRC(c1277eb3) SHA1(529ed5a133550e2854f8656cd377706060a7befa) ) +ROM_END + + +ROM_START( vathlete ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0019", 0, SHA1(955d3c0cb991be3057138c562cff69c5ef887787) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-0330-COM) + //(sticker 253-5508-0330) + ROM_LOAD("317-0330-com.data", 0x00, 0x50, CRC(f5e7f7d4) SHA1(3903337e82011d132993e4366475586866bd39b1) ) +ROM_END + +/* + +Title VIRTUA TENNIS 2 (POWER SMASH 2) +Media ID D72C +Media Config GD-ROM1/1 +Regions J +Peripheral String 0000000 +Product Number GDS-0015A +Version V2.000 +Release Date 20010827 +Manufacturer ID +TOC DISC +Track Start Sector End Sector Track Size +track01.bin 150 449 705600 +track02.raw 600 2732 5016816 +track03.bin 45150 549299 1185760800 + + +PIC + +253-5508-0318 +317-0318-EXP +*/ + +ROM_START( vtennis2 ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0015a", 0, SHA1(c6e9c9901bd4f075454b7f18baf08df81bc2f1ad) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + ROM_LOAD("317-0318-exp.data", 0x00, 0x50, CRC(7758ade6) SHA1(c62f35810bce466bfb0f55fd555066efd53e9bb6) ) +ROM_END + + +ROM_START( lupinsho ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0018", 0, SHA1(0633a99a666f363ab30450a76b9753685d6b1f57) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + ROM_LOAD("317-0332-j.data", 0x00, 0x50, CRC(31f2b632) SHA1(bbf253bfe831308a7e7fde3a4a28e5bcd2fbb273) ) +ROM_END + + +ROM_START( luptype ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0021a", 0, SHA1(15c6f9434494a31693cbb8e33da36e0e8a8f7c62) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-0332-JPN) + //(sticker 253-5508-0332J) + ROM_LOAD("317-0332-jpn.data", 0x00, 0x50, CRC(ab302661) SHA1(65164cf76d78b281772bfcbf5a733b0200e86e09) ) +ROM_END + +/* +Title THE_MAZE_OF_THE_KINGS +Media ID E3D0 +Media Config GD-ROM1/1 +Regions J +Peripheral String 0000000 +Product Number GDS-0022 +Version V1.001 +Release Date 20020306 +Manufacturer ID +TOC DISC +Track Start Sector End Sector Track Size +track01.bin 150 449 705600 +track02.raw 600 2732 5016816 +track03.bin 45150 549299 1185760800 + + +PIC +317-0333-COM +253-5508-0333 + +*/ +ROM_START( mok ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0022", 0, SHA1(70b41745225006e7876176cbd239edecd4c3f8b6) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + ROM_LOAD("317-0333-com.data", 0x00, 0x50, CRC(0c07970f) SHA1(8882dd2f8ed522790ea78eed80cfa9442f88f67b) ) +ROM_END + + +ROM_START( ngdup23a ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0023a", 0, SHA1(cd9d808b59eb8f40673ec4353d476f2b9c7f783c) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) // uses the vf4 pic + //PIC16C622A (317-0314-COM) + //(sticker 253-5508-0314) + ROM_LOAD("317-0314-com.data", 0x00, 0x50, CRC(91a97eb4) SHA1(059342368bc5d25b494ed3c729870695f9584fc7) ) +ROM_END + +ROM_START( ngdup23c ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0023c", 0, SHA1(1fcb5530748886f4c4f45487d047859182ff7496)) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) // uses the vf4 evolution pic + //PIC16C622A (317-0338-JPN) + //(sticker 253-5508-0338J) + ROM_LOAD("317-0338-jpn.data", 0x00, 0x50, CRC(eeb2c9e9) SHA1(d30b5914c603219daea9923e1cf8da2be6096742) ) +ROM_END + + +ROM_START( puyofev ) + NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0031", 0, SHA1(da2d421da9472b149619b6931bb2fe624be75fa2) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C621A (317-0375-COM) + //(sticker 253-5508-0375) + ROM_LOAD("317-0375-com.data", 0x00, 0x50, CRC(32bf1825) SHA1(42dfbc6777c154d8de6c6f7350da9ea737380220) ) +ROM_END + + +/* Naomi GD-Rom Sets */ +GAME( 2001, naomigd, 0, naomi, naomi, naomi, ROT0, "Sega", "Naomi GD-ROM Bios", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT ) + +/* GDL-xxxx ("licensed by Sega" games) */ +GAME( 2001, gundmgd, naomigd, naomigd, naomi, naomi, ROT0, "Capcom", "Mobile Suit Gundam: Federation VS Zeon (GDL-0001)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2001, sfz3ugd, naomigd, naomigd, naomi, naomi, ROT0, "Capcom", "Street Fighter Zero 3 Upper (GDL-0002)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GDL-0003 +GAME( 2001, cvsgd, naomigd, naomigd, naomi, naomi, ROT0, "Capcom / SNK", "Capcom vs SNK Millenium Fight 2000 Pro (GDL-0004)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GDL-0005 Doki Doki Idol Star Seeker +GAME( 2001, gundmxgd, naomigd, naomigd, naomi, naomi, ROT0, "Capcom", "Mobile Suit Gundam: Federation VS Zeon DX (GDL-0006)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GDL-0007 Capcom vs SNK 2 +GAME( 2001, cvs2gd, naomigd, naomigd, naomi, naomi, ROT0, "Capcom / SNK", "Capcom vs SNK 2 Millionaire Fighting 2001 (Rev A) (GDL-0007A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GDL-0008 Capcom vs SNK 2 Mark Of The Millenium 2001 (Export) +//GDL-0009 +GAME( 2001, ikaruga, naomigd, naomigd, naomi, naomi, ROT270, "Treasure", "Ikaruga (GDL-0010)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2002, ggxx, naomigd, naomigd, naomi, ggxx, ROT0, "Arc System Works", "Guilty Gear XX (GDL-0011)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GDL-0012 Cleopatra Fortune Plus +GAME( 2002, moeru, naomigd, naomigd, naomi, naomi, ROT0, "Altron", "Moeru Casinyo (GDL-0013)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GDL-0014 Musapey's Choco Marker +GAME( 2002, chocomk, naomigd, naomigd, naomi, naomi, ROT0, "Ecole Software", "Musapey's Choco Marker (Rev A) (GDL-0014A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GDL-0015 Mazan +//GDL-0016 Yonin Uchi Mahjong MJ +GAME( 2002, quizqgd, naomigd, naomigd, naomi, naomi, ROT270, "Amedio (Taito license)", "Quiz Keitai Q mode (GDL-0017)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GDL-0018 Azumanga Daioh Puzzle Bobble +//GDL-0019 Guilty Gear XX #Reload +GAME( 2003, ggxxrl, naomigd, naomigd, naomi, ggxxrl, ROT0, "Arc System Works", "Guilty Gear XX #Reload (Rev A) (GDL-0019A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2004, tetkiwam, naomigd, naomigd, naomi, naomi, ROT0, "Success", "Tetris Kiwamemichi (GDL-0020)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2003, shikgam2, naomigd, naomigd, naomi, naomi, ROT270, "Alpha System", "Shikigami No Shiro II / The Castle of Shikigami II (GDL-0021)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2003, usagui, naomigd, naomigd, naomi_mp, naomi_mp,ROT0, "Warashi / Taito / Mahjong Kobo", "Usagi - Yamashiro Mahjong Hen (GDL-0022)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GDL-0023 Border Down +GAME( 2004, bdrdown, naomigd, naomigd, naomi, naomi, ROT0, "G-Rev", "Border Down (Rev A) (GDL-0023A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2003, psyvar2, naomigd, naomigd, naomi, naomi, ROT270, "G-Rev", "Psyvariar 2 - The Will To Fabricate (GDL-0024)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2004, cfield, naomigd, naomigd, naomi, naomi, ROT0, "Able", "Chaos Field (GDL-0025)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2004, trizeal, naomigd, naomigd, naomi, naomi, ROT270, "Taito", "Trizeal (GDL-0026)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GDL-0027 Melty Blood Act Cadenza? +//GDL-0028 Melty Blood Act Cadenza Ver A +//GDL-0028A Melty Blood Act Cadenza Ver A (Rev A) +//GDL-0028B Melty Blood Act Cadenza Ver A (Rev B) +GAME( 2005, meltybld, naomigd, naomigd, naomi, naomi, ROT0, "Ecole Software", "Melty Blood Act Cadenza Ver A (Rev C) (GDL-0028C)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GDL-0029 +GAME( 2005, senko, naomigd, naomigd, naomi, naomi, ROT0, "G-Rev", "Senko No Ronde NEW ver. (Rev A) (GDL-0030A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2005, senkoo, senko, naomigd, naomi, naomi, ROT0, "G-Rev", "Senko No Ronde (GDL-0030)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GDL-0031 Super Shanghai 2005 +GAME( 2005, ss2005, naomigd, naomigd, naomi, naomi, ROT0, "Starfish", "Super Shanghai 2005 (Rev A) (GDL-0031A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2005, radirgy, naomigd, naomigd, naomi, naomi, ROT270, "Milestone", "Radirgy (GDL-0032)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GDL-0033 Guilty Gear XX Slash +GAME( 2005, ggxxsla, naomigd, naomigd, naomi, ggxxsla, ROT0, "Arc System Works", "Guilty Gear XX Slash (Rev A) (GDL-0033A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2006, kurucham, naomigd, naomigd, naomi, naomi, ROT0, "Able", "Kurukuru Chameleon (GDL-0034)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2005, undefeat, naomigd, naomigd, naomi, naomi, ROT270, "G-Rev", "Under Defeat (GDL-0035)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GDL-0036 Trigger Heart Exelica +//GAME( 2005, trgheart, naomigd, naomigd, naomi, naomi, ROT270, "Warashi", "Trigger Heart Exelica (Rev A) (GDL-0036A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GAME( 2005, jingystm, naomigd, naomigd, naomi, naomi, ROT0, "Atrativa Japan", "Jingi Storm - The Arcade (GDL-0037)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GDL-0038 Senko No Ronde Special +//GAME( 2006, meltyb, naomigd, naomigd, naomi, naomi, ROT0, "Ecole Software", "Melty Blood Act Cadenza Ver B (GDL-0039)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GAME( 2006, meltyba, meltyb, naomigd, naomi, naomi, ROT0, "Ecole Software", "Melty Blood Act Cadenza Ver B (Rev A) (GDL-0039A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GAME( 2006, karous, naomigd, naomigd, naomi, naomi, ROT270, "Milestone", "Karous (GDL-0040)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GDL-0041 Guilty Gear XX Accent Core +//GAME( 2006, takoron, naomigd, naomigd, naomi, naomi, ROT0, "Compile", "Noukone Puzzle Takoron (GDL-0042)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) + + +/* GDS-xxxx (Sega first party games) */ +GAME( 2001, confmiss, naomigd, naomigd, naomi, naomi, ROT0, "Sega", "Confidential Mission (GDS-0001)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GDS-0002 Shakatto Tambourine +GAME( 2000, sprtjam, naomigd, naomigd, naomi, naomi, ROT0, "Sega", "Sports Jam (GDS-0003)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2000, slashout, naomigd, naomigd, naomi, naomi, ROT0, "Sega", "Slashout (GDS-0004)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2001, spkrbtl, naomigd, naomigd, naomi, naomi, ROT0, "Sega", "Spikers Battle (GDS-0005)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GDS-0006 Virtua Striker 3 (NAOMI 2) +//GDS-0007 Shakatto Tambourine Motto Norinori Shinkyoku Tsuika +GAME( 2001, monkeyba, naomigd, naomigd, naomi, naomi, ROT0, "Sega", "Monkey Ball (GDS-0008)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2001, dygolf, naomigd, naomigd, naomi, naomi, ROT0, "Sega", "Virtua Golf / Dynamic Golf (GDS-0009)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2001, wsbbgd, naomigd, naomigd, naomi, naomi, ROT0, "Sega", "World Series Baseball / Super Major League (GDS-0010)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2001, vtennisg, naomigd, naomigd, naomi, naomi, ROT0, "Sega", "Virtua Tennis (GDS-0011)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GDS-0012 Virtua Fighter 4 (NAOMI 2) +//GDS-0013 +//GDS-0014 Beach Spikers (NAOMI 2) +//GDS-0015 Virtua Tennis 2 / Power Smash 2 +GAME( 2001, vtennis2, naomigd, naomigd, naomi, naomi, ROT0, "Sega", "Virtua Tennis 2 (Rev A) (GDS-0015A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GDS-0016 Shakatto Tambourine Cho Powerup Chu +GAME( 2001, keyboard, naomigd, naomigd, naomi, naomi, ROT0, "Sega", "La Keyboardxyu (GDS-0017)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2001, lupinsho, naomigd, naomigd, naomi, naomi, ROT0, "Sega", "Lupin The Third - The Shooting (GDS-0018)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2002, vathlete, naomigd, naomigd, naomi, naomi, ROT0, "Sega", "Virtua Athletics / Virtua Athlete (GDS-0019)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GDS-0020 Initial D Arcade Stage (Japan) (NAOMI 2) +//GDS-0021 Lupin The Third - The Typing +GAME( 2002, luptype, naomigd, naomigd, naomi, naomi, ROT0, "Sega", "Lupin The Third - The Typing (Rev A) (GDS-0021A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2002, mok, naomigd, naomigd, naomi, naomi, ROT0, "Sega", "The Maze of the Kings (GDS-0022)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GDS-0023 Naomi DIMM Firmware Updater +GAME( 2001, ngdup23a, naomigd, naomigd, naomi, naomi, ROT0, "Sega", "Naomi DIMM Firmware Updater (GDS-0023A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GDS-0023B Naomi DIMM Firmware Updater +GAME( 2001, ngdup23c, naomigd, naomigd, naomi, naomi, ROT0, "Sega", "Naomi DIMM Firmware Updater (GDS-0023C)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GDS-0024 Virtua Fighter 4 Evolution (NAOMI 2) +//GDS-0025 Initial D Arcade Stage (Export) (NAOMI 2) +//GDS-0026 Initial D Arcade Stage Ver. 2 (Japan) (NAOMI 2) +//GDS-0027 Initial D Arcade Stage Ver. 2 (Export) (NAOMI 2) +//GDS-0028 +//GDS-0029 +//GDS-0030 +GAME( 2003, puyofev, naomigd, naomigd, naomi, naomi, ROT0, "Sega", "Puyo Puyo Fever (GDS-0031)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +//GDS-0032 Initial D Arcade Stage Ver. 3 (Japan) +//GDS-0033 Initial D Arcade Stage Ver. 3 (Export) +//GDS-0034 +//GDS-0035 +//GDS-0036 Virtua Fighter 4 Final Tuned +//GDS-0037? Puyo Puyo Fever (Export) + + +/********************************************** + * + * Naomi 2 Cart defines + * + *********************************************/ + +ROM_START( vstrik3c ) + NAOMI2_BIOS + + ROM_REGION( 0xb000000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-23663.ic22", 0x0000000, 0x0400000, CRC(7007fec7) SHA1(523168f0b218d0bd5c815d65bf0caba2c8468c9d) ) + /* TODO: proper rom names */ + ROM_LOAD("ic.1", 0x0800000, 0x0800000, CRC(db8bf632) SHA1(cd0c5c385dc33778eb6477f48a33d31f8461b810) ) + ROM_LOAD("ic.2", 0x1000000, 0x0800000, CRC(f5889f8b) SHA1(540aa6a9adf10d5426ac4962afdc300cc9c5c6ba) ) + ROM_LOAD("ic.3", 0x1800000, 0x0800000, CRC(74e7ef35) SHA1(6b63910fa05f98b31689882d3f7f32ea84fb11e5) ) + ROM_LOAD("ic.4", 0x2000000, 0x0800000, CRC(69e5eeb3) SHA1(1c615e6150e8c9f5211f7db55158c9b56b9b52fe) ) + ROM_LOAD("ic.5", 0x2800000, 0x0800000, CRC(7ea41bdb) SHA1(1a58c4731f9cc570f79e81a3b87b590d52cf3887) ) + ROM_LOAD("ic.6", 0x3000000, 0x0800000, CRC(cf730ca3) SHA1(f8e132463d574be906f573ca66fbc8d74959be08) ) + ROM_LOAD("ic.7", 0x3800000, 0x0800000, CRC(b8d838fe) SHA1(6722f54a170302978e06305773903a336c6fc9d8) ) + ROM_LOAD("ic.8", 0x4000000, 0x0800000, CRC(03aacb8b) SHA1(7ab12a3c79718fea8b7ae019acafb86bb7381c7e) ) + ROM_LOAD("ic.9", 0x4800000, 0x0800000, CRC(3252196e) SHA1(2e45de03931554e6500fbb83a0d2b1249f2d3015) ) + ROM_LOAD("ic.10",0x5000000, 0x0800000, CRC(b448948b) SHA1(1df5bbd14b24a952bb5289778ceea15ffe161491) ) + ROM_LOAD("ic.11",0x5800000, 0x0800000, CRC(937a3280) SHA1(46c6277402c029a55aa0e2417ea14634d17e2601) ) + ROM_LOAD("ic.12",0x6000000, 0x0800000, CRC(e3ca01df) SHA1(1c96e596d5ad6e08fcc7625788952d5ca5c80ce5) ) + ROM_LOAD("ic.13",0x6800000, 0x0800000, CRC(9bbbbbdc) SHA1(19d124743b686e4d5d38181cee547452402cdf61) ) + ROM_LOAD("ic.14",0x7000000, 0x0800000, CRC(eed0270a) SHA1(2b75a2d5bda05e68bb7d81570a7f4e180085fbd5) ) + ROM_LOAD("ic.15",0x7800000, 0x0800000, CRC(02bee590) SHA1(77ce37209f525be58d9373b5467b6be9f0e7fb4b) ) + ROM_LOAD("ic.16",0x8000000, 0x0800000, CRC(025f4f2f) SHA1(b104dc936036464dcf17524fd5e639c9852e1bd1) ) + ROM_LOAD("ic.17",0x8800000, 0x0800000, CRC(98fc3c54) SHA1(d2ba54b9bf15d2b3d623c5358bbf104b48d23223) ) + ROM_LOAD("ic.18",0x9000000, 0x0800000, CRC(e9fe50a4) SHA1(053f2a33ab7310c518a66b49d83fc817f2db3ef0) ) + ROM_LOAD("ic.19",0x9800000, 0x0800000, CRC(bbd0139c) SHA1(f87e729534d503f2bc37b7d595d25070ae33353c) ) + ROM_LOAD("ic.20",0xa000000, 0x0800000, CRC(5a69ab9e) SHA1(205a8facded5dbee8653807ef4d4b5e4210f56ef) ) + ROM_LOAD("ic.21",0xa800000, 0x0800000, CRC(d6ef7d68) SHA1(4ee396af6c5caf4c5af6e9ad0e03a7ac2c5039f4) ) +ROM_END + +ROM_START( wldrider ) + NAOMI2_BIOS + + ROM_REGION( 0xa800000, "user1", ROMREGION_ERASEFF) + ROM_LOAD("epr-23622.ic22", 0x0000000, 0x0400000, CRC(8acafa5b) SHA1(c92bcd40bad6ba8efd1edbfd7e439fb2b3c67fb0) ) + ROM_LOAD("ic.1", 0x0800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic.2", 0x1000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic.3", 0x1800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic.4", 0x2000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic.5", 0x2800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic.6", 0x3000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic.7", 0x3800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic.8", 0x4000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic.9", 0x4800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic.10",0x5000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic.11",0x5800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic.12",0x6000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic.13",0x6800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic.14",0x7000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic.15",0x7800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic.16",0x8000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic.17",0x8800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic.18",0x9000000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic.19",0x9800000, 0x0800000, NO_DUMP ) + ROM_LOAD("ic.20",0xa000000, 0x0800000, NO_DUMP ) +ROM_END + +/********************************************** + * + * Naomi 2 GD-ROM defines + * + *********************************************/ + +ROM_START( vstrik3 ) + NAOMI2_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0006", 0, SHA1(aca09a88506f5e462ad3fb33eac5478a2a010609) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-0304-COM) + //(sticker 253-5508-0304) + ROM_LOAD("317-0304-com.data", 0x00, 0x50, CRC(a181c601) SHA1(6a489904941e638ac1069b66e76ee0bcec7d0bab) ) +ROM_END + +ROM_START( vf4 ) + NAOMI2_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0012", 0, SHA1(c34588f59c6091cd1c3ef235171dad8d5247e707) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-0314-COM) + //(sticker 253-5508-0314) + ROM_LOAD("317-0314-com.data", 0x00, 0x50, CRC(91a97eb4) SHA1(059342368bc5d25b494ed3c729870695f9584fc7) ) +ROM_END + +ROM_START( vf4b ) + NAOMI2_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0012b", 0, SHA1(9b8e05c3d28a09323b13c198dfcc2b771bba67cd) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-0314-COM) + //(sticker 253-5508-0314) + ROM_LOAD("317-0314-com.data", 0x00, 0x50, CRC(91a97eb4) SHA1(059342368bc5d25b494ed3c729870695f9584fc7) ) +ROM_END + +ROM_START( vf4c ) + NAOMI2_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0012c", 0, SHA1(0ec149d7edfb326777cdc45a2ac8ad578a32aba1) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-0314-COM) + //(sticker 253-5508-0314) + ROM_LOAD("317-0314-com.data", 0x00, 0x50, CRC(91a97eb4) SHA1(059342368bc5d25b494ed3c729870695f9584fc7) ) +ROM_END + + +ROM_START( vf4evo ) + NAOMI2_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0024b", 0, SHA1(a829169542f3bed76095ad6bfbbde7d494d04d72) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-0338-JPN) + //(sticker 253-5508-0338J) + ROM_LOAD("317-0338-jpn.data", 0x00, 0x50, CRC(eeb2c9e9) SHA1(d30b5914c603219daea9923e1cf8da2be6096742) ) +ROM_END + +ROM_START( vf4evoa ) + NAOMI2_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0024a", 0, SHA1(6225e778d73db18be26f882d4f9cd3b3a136d1c9) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-0338-JPN) + //(sticker 253-5508-0338J) + ROM_LOAD("317-0338-jpn.data", 0x00, 0x50, CRC(eeb2c9e9) SHA1(d30b5914c603219daea9923e1cf8da2be6096742) ) +ROM_END + +ROM_START( initdv2j ) + NAOMI2_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0026", 0, SHA1(253acede106b7fbf49e24458e7fda868720e9549) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + ROM_LOAD("gds-0026.rom", 0x00, 0x50, NO_DUMP) // file on GD-ROM is BFK.BIN , _NOT_ BEM.BIN which is for Initial D : Arcade Stage (Japan) +ROM_END + +ROM_START( vf4tuned ) // are there multiple files on this GD-ROM? it only compresses to 500 meg when the rom file is closer to half tha + NAOMI2_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0036f", 0, SHA1(ea35d6ecdf94e5c9a545952758da80f658755df0) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-0387-COM) + //(sticker 253-5508-0387) + ROM_LOAD("317-0387-com.data", 0x00, 0x50, CRC(ab9f3851) SHA1(8b64dc6df176eb7adb48267709a27db221d5e3c3) ) +ROM_END + +ROM_START( vf4tunedd ) + NAOMI2_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0036d", 0, SHA1(2f7654307a4c978c5af6c8238c44e70275dd34f9) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-0387-COM) + //(sticker 253-5508-0387) + ROM_LOAD("317-0387-com.data", 0x00, 0x50, CRC(ab9f3851) SHA1(8b64dc6df176eb7adb48267709a27db221d5e3c3) ) +ROM_END + + +ROM_START( vf4tuneda ) + NAOMI2_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0036a", 0, SHA1(cd630fc4e8f7ed5641b85c609584d7efe0eac137) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-0387-COM) + //(sticker 253-5508-0387) + ROM_LOAD("317-0387-com.data", 0x00, 0x50, CRC(ab9f3851) SHA1(8b64dc6df176eb7adb48267709a27db221d5e3c3) ) +ROM_END + + +/* + +Title BEACH SPIKERS +Media ID 0897 +Media Config GD-ROM1/1 +Regions J +Peripheral String 0000000 +Product Number GDS-0014 +Version V1.001 +Release Date 20010613 +Manufacturer ID +TOC DISC +Track Start Sector End Sector Track Size +track01.bin 150 449 705600 +track02.raw 600 2746 5049744 +track03.bin 45150 549299 1185760800 + +PIC + +253-5508-0317 +317-0317-COM + +*/ + +ROM_START( beachspi ) + NAOMI2_BIOS +// NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0014", 0, SHA1(1ebb3695196c11a86276e034df2e1c8d7fa6b96f) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-0317-COM) + //(sticker 253-5508-0317) + ROM_LOAD("317-0317-com.data", 0x00, 0x50, CRC(66efe433) SHA1(7f7b52202ed9b1e20516aaa7553cc3cc677a70b5) ) +ROM_END + +ROM_START( initd ) + NAOMI2_BIOS +// NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0020b", 0, SHA1(c0e901623ef4fcd97b7e4d29ae556e6f2e91b8ad) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + //PIC16C622A (317-0331-JPN) + //(sticker 253-5508-0331J) + ROM_LOAD("317-0331-jpn.data", 0x00, 0x50, CRC(bb39742e) SHA1(b3100b18aeb80ebfd5312ba5c320e7e647710b55) ) +ROM_END + +ROM_START( initdexp ) + NAOMI2_BIOS +// NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0025", 0, SHA1(8ea92cf6b493f21b9453832edad7cbc5e5b350c1) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + ROM_LOAD("317-0343-com.data", 0x00, 0x50, CRC(e9d8fac0) SHA1(85f5bbffbd9d1f7162bae46ddd49e7870fe93662) ) +ROM_END + +ROM_START( initdv3j ) + NAOMI2_BIOS +// NAOMIGD_BIOS + + ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead? + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gds-0032b", 0, SHA1(568411aa72ca308a03a6b5b61c79833464b88bc6) ) + + ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) + ROM_LOAD("gds-0032_pic", 0x00, 0x50, NO_DUMP ) // PIC was missing +ROM_END + + +GAME( 2001, naomi2, 0, naomi, naomi, 0, ROT0, "Sega", "Naomi 2 Bios", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT ) + +//Naomi 2 Cart Games +/* Complete Dumps */ +GAME( 2001, vstrik3c, naomi2, naomi, naomi, 0, ROT0, "Sega", "Virtua Striker 3 (Cart) (USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) + +/* Incomplete Dumps (just the program rom IC22) */ +GAME( 2001, wldrider, naomi2, naomi, naomi, 0, ROT0, "Sega", "Wild Riders (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) + +/* GDS-xxxx (Sega first party games) */ +GAME( 2001, vstrik3, naomi2, naomigd, naomi, 0, ROT0, "Sega", "Virtua Striker 3 (GDS-0006)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2001, vf4, naomi2, naomigd, naomi, 0, ROT0, "Sega", "Virtua Fighter 4 (GDS-0012)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2001, vf4b, vf4, naomigd, naomi, 0, ROT0, "Sega", "Virtua Fighter 4 (Rev B) (GDS-0012B)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2001, vf4c, vf4, naomigd, naomi, 0, ROT0, "Sega", "Virtua Fighter 4 (Rev C) (GDS-0012C)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2002, initd, naomi2, naomigd, naomi, 0, ROT0, "Sega", "Initial D Arcade Stage (Rev B) (Japan) (GDS-0020B)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2002, beachspi,naomi2, naomigd, naomi, 0, ROT0, "Sega", "Beach Spikers (GDS-0014)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2002, initdexp,naomi2, naomigd, naomi, 0, ROT0, "Sega", "Initial D Arcade Stage (Export) (GDS-0025)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2002, vf4evo, naomi2, naomigd, naomi, 0, ROT0, "Sega", "Virtua Fighter 4 Evolution (Rev B) (GDS-0024B)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2002, vf4evoa, vf4evo, naomigd, naomi, 0, ROT0, "Sega", "Virtua Fighter 4 Evolution (Rev A) (GDS-0024A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2002, initdv2j,naomi2, naomigd, naomi, 0, ROT0, "Sega", "Initial D : Arcade Stage Ver. 2 (Japan) (GDS-0026)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2004, initdv3j,naomi2, naomigd, naomi, 0, ROT0, "Sega", "Initial D : Arcade Stage Ver. 3 (Japan) (Rev B) (GDS-0032B)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2004, vf4tuned,naomi2, naomigd, naomi, 0, ROT0, "Sega", "Virtua Fighter 4 Final Tuned (Rev F) (GDS-0036F)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2004, vf4tunedd,vf4tuned,naomigd, naomi, 0, ROT0, "Sega", "Virtua Fighter 4 Final Tuned (Rev D) (GDS-0036D)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) +GAME( 2004, vf4tuneda,vf4tuned,naomigd, naomi, 0, ROT0, "Sega", "Virtua Fighter 4 Final Tuned (Rev A) (GDS-0036A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) + +/********************************************** + * + * Atomiswave cart defines + * + *********************************************/ + +struct AtomiswaveKey +{ + int P0[16]; + int P1[16]; + int S0[32]; + int S1[16]; + int S2[16]; + int S3[8]; +}; + +static const struct AtomiswaveKey fotns_key = { + {0,2,7,11,12,1,5,6,15,4,8,9,14,3,10,13}, + {12,8,3,7,0,15,1,11,6,10,4,14,9,5,13,2}, + {4,1,10,16,9,25,26,31,13,0,14,15,24,6,30,18,7,20,5,12,22,17,27,3,8,11,21,29,19,23,28,2}, + {3,2,11,14,10,13,12,0,7,6,8,15,5,1,4,9}, + {10,3,6,12,7,11,4,14,0,2,8,1,15,13,5,9}, + {7,1,6,5,4,2,0,3} +}; + +static const struct AtomiswaveKey df_key = { + {1,4,5,6,9,7,10,11,13,0,8,12,14,2,3,15}, + {12,0,3,8,7,6,15,11,1,4,14,10,9,5,13,2}, + {9,27,15,6,28,30,7,12,21,0,1,25,22,3,16,29,13,4,24,20,2,5,23,19,18,10,8,14,17,11,31,26}, + {5,13,4,0,8,12,14,7,2,11,3,10,6,1,15,9}, + {11,6,2,9,12,1,7,4,10,0,13,3,8,14,15,5}, + {1,6,4,3,5,2,7,0} +}; + +struct AtomiswaveKey ssu_key = { + {1,3,7,8,10,2,4,5,11,0,6,12,15,9,13,14}, + {7,8,12,0,3,11,1,15,6,10,9,14,4,5,2,13}, + {4,16,23,11,3,10,28,2,12,30,29,22,20,7,6,9,8,31,24,27,18,17,15,25,14,0,21,5,26,1,13,19}, + {13,5,1,12,3,11,15,6,0,4,9,14,2,8,10,7}, + {7,5,4,3,0,8,12,1,13,9,6,2,15,11,10,14}, + {4,1,0,2,5,3,7,6} +}; + +struct AtomiswaveKey rm_key = { + {1,4,5,6,9,7,10,11,13,0,8,12,14,2,3,15}, + {12,0,3,8,7,6,15,11,1,4,14,10,9,5,13,2}, + {3,6,0,19,14,30,17,22,13,23,2,11,29,24,28,4,10,7,15,12,31,1,20,16,9,8,18,26,25,21,27,5}, + {2,6,3,7,11,4,12,0,10,9,15,14,13,5,1,8}, + {1,13,12,15,8,7,0,5,11,3,4,14,9,10,6,2}, + {6,0,7,4,5,3,1,2} +}; +static UINT16 atomiswave_decrypt(UINT16 cipherText, int address, const struct AtomiswaveKey* key) +{ + int b0,b1,b2,b3; + int aux; + + aux = BITSWAP16(cipherText, + key->P0[15],key->P0[14],key->P0[13],key->P0[12],key->P0[11],key->P0[10],key->P0[9],key->P0[8], + key->P0[7],key->P0[6],key->P0[5],key->P0[4],key->P0[3],key->P0[2],key->P0[1],key->P0[0]); + aux = aux ^ BITSWAP16(address/2, + key->P1[15],key->P1[14],key->P1[13],key->P1[12],key->P1[11],key->P1[10],key->P1[9],key->P1[8], + key->P1[7],key->P1[6],key->P1[5],key->P1[4],key->P1[3],key->P1[2],key->P1[1],key->P1[0]); + + b0 = aux&0x1f; + b1 = (aux>>5)&0xf; + b2 = (aux>>9)&0xf; + b3 = aux>>13; + + b0 = key->S0[b0]; + b1 = key->S1[b1]; + b2 = key->S2[b2]; + b3 = key->S3[b3]; + + return (b3<<13)|(b2<<9)|(b1<<5)|b0; +} + + +static DRIVER_INIT(fotns) +{ + int i; + UINT16 *src = (UINT16 *)(memory_region(machine, "user1")); + + long rom_size = memory_region_length(machine, "user1"); + + for(i=0; igamedrv->name; + char filename[256]; + sprintf(filename, "%s.dump", gamename); + + fp=fopen(filename, "w+b"); + if (fp) + { + fwrite(src, rom_size, 1, fp); + fclose(fp); + } + } +#endif +} + + + +static DRIVER_INIT(demofist) +{ + int i; + UINT16 *src = (UINT16 *)(memory_region(machine, "user1")); + + long rom_size = memory_region_length(machine, "user1"); + + for(i=0; igamedrv->name; + char filename[256]; + sprintf(filename, "%s.dump", gamename); + + fp=fopen(filename, "w+b"); + if (fp) + { + fwrite(src, rom_size, 1, fp); + fclose(fp); + } + } +#endif +} + +static DRIVER_INIT(sprtshot) +{ + int i; + UINT16 *src = (UINT16 *)(memory_region(machine, "user1")); + + long rom_size = memory_region_length(machine, "user1"); + + for(i=0; i +#include + +#define MAXCHUNK (2048*1024) + +static unsigned int seed; + +void my_srand(unsigned int n) +{ + seed = n & 0xffff; +} + +unsigned int my_rand() +{ + seed = (seed * 2109 + 9273) & 0x7fff; + return (seed + 0xc000) & 0xffff; +} + +void load(FILE *fh, unsigned char *ptr, unsigned long sz) +{ + if(fread(ptr, 1, sz, fh) != sz) + { + fprintf(stderr, "Read error!\n"); + exit(1); + } +} + +void load_chunk(FILE *fh, unsigned char *ptr, unsigned long sz) +{ + static int idx[MAXCHUNK/32]; + int i; + + /* Convert chunk size to number of slices */ + sz /= 32; + + /* Initialize index table with unity, + so that each slice gets loaded exactly once */ + for(i = 0; i < sz; i++) + idx[i] = i; + + for(i = sz-1; i >= 0; --i) + { + /* Select a replacement index */ + int x = (my_rand() * i) >> 16; + + /* Swap */ + int tmp = idx[i]; + idx[i] = idx[x]; + idx[x] = tmp; + + /* Load resulting slice */ + load(fh, ptr+32*idx[i], 32); + } +} + +void load_file(FILE *fh, unsigned char *ptr, unsigned long filesz) +{ + unsigned long chunksz; + + my_srand(filesz); + + /* Descramble 2 meg blocks for as long as possible, then + gradually reduce the window down to 32 bytes (1 slice) */ + for(chunksz = MAXCHUNK; chunksz >= 32; chunksz >>= 1) + while(filesz >= chunksz) + { + load_chunk(fh, ptr, chunksz); + filesz -= chunksz; + ptr += chunksz; + } + + /* Load final incomplete slice */ + if(filesz) + load(fh, ptr, filesz); +} + +void read_file(char *filename, unsigned char **ptr, unsigned long *sz) +{ + FILE *fh = fopen(filename, "rb"); + if(fh == NULL) + { + fprintf(stderr, "Can't open \"%s\".\n", filename); + exit(1); + } + if(fseek(fh, 0, SEEK_END)<0) + { + fprintf(stderr, "Seek error.\n"); + exit(1); + } + *sz = ftell(fh); + *ptr = malloc(*sz); + if( *ptr == NULL ) + { + fprintf(stderr, "Out of memory.\n"); + exit(1); + } + if(fseek(fh, 0, SEEK_SET)<0) + { + fprintf(stderr, "Seek error.\n"); + exit(1); + } + load_file(fh, *ptr, *sz); + fclose(fh); +} + +void save(FILE *fh, unsigned char *ptr, unsigned long sz) +{ + if(fwrite(ptr, 1, sz, fh) != sz) + { + fprintf(stderr, "Write error!\n"); + exit(1); + } +} + +void save_chunk(FILE *fh, unsigned char *ptr, unsigned long sz) +{ + static int idx[MAXCHUNK/32]; + int i; + + /* Convert chunk size to number of slices */ + sz /= 32; + + /* Initialize index table with unity, + so that each slice gets saved exactly once */ + for(i = 0; i < sz; i++) + idx[i] = i; + + for(i = sz-1; i >= 0; --i) + { + /* Select a replacement index */ + int x = (my_rand() * i) >> 16; + + /* Swap */ + int tmp = idx[i]; + idx[i] = idx[x]; + idx[x] = tmp; + + /* Save resulting slice */ + save(fh, ptr+32*idx[i], 32); + } +} + +void save_file(FILE *fh, unsigned char *ptr, unsigned long filesz) +{ + unsigned long chunksz; + + my_srand(filesz); + + /* Descramble 2 meg blocks for as long as possible, then + gradually reduce the window down to 32 bytes (1 slice) */ + for(chunksz = MAXCHUNK; chunksz >= 32; chunksz >>= 1) + while(filesz >= chunksz) + { + save_chunk(fh, ptr, chunksz); + filesz -= chunksz; + ptr += chunksz; + } + + /* Save final incomplete slice */ + if(filesz) + save(fh, ptr, filesz); +} + +void write_file(char *filename, unsigned char *ptr, unsigned long sz) +{ + FILE *fh = fopen(filename, "wb"); + if(fh == NULL) + { + fprintf(stderr, "Can't open \"%s\".\n", filename); + exit(1); + } + save_file(fh, ptr, sz); + fclose(fh); +} + +void descramble(char *src, char *dst) +{ + unsigned char *ptr = NULL; + unsigned long sz = 0; + FILE *fh; + + read_file(src, &ptr, &sz); + + fh = fopen(dst, "wb"); + if(fh == NULL) + { + fprintf(stderr, "Can't open \"%s\".\n", dst); + exit(1); + } + if( fwrite(ptr, 1, sz, fh) != sz ) + { + fprintf(stderr, "Write error.\n"); + exit(1); + } + fclose(fh); + free(ptr); +} + +void scramble(char *src, char *dst) +{ + unsigned char *ptr = NULL; + unsigned long sz = 0; + FILE *fh; + + fh = fopen(src, "rb"); + if(fh == NULL) + { + fprintf(stderr, "Can't open \"%s\".\n", src); + exit(1); + } + if(fseek(fh, 0, SEEK_END)<0) + { + fprintf(stderr, "Seek error.\n"); + exit(1); + } + sz = ftell(fh); + ptr = malloc(sz); + if( ptr == NULL ) + { + fprintf(stderr, "Out of memory.\n"); + exit(1); + } + if(fseek(fh, 0, SEEK_SET)<0) + { + fprintf(stderr, "Seek error.\n"); + exit(1); + } + if( fread(ptr, 1, sz, fh) != sz ) + { + fprintf(stderr, "Read error.\n"); + exit(1); + } + fclose(fh); + + write_file(dst, ptr, sz); + + free(ptr); +} + +int main(int argc, char *argv[]) +{ + int opt = 0; + + if(argc > 1 && !strcmp(argv[1], "-d")) + opt ++; + + if(argc != 3+opt) + { + fprintf(stderr, "Usage: %s [-d] from to\n", argv[0]); + exit(1); + } + + if(opt) + descramble(argv[2], argv[3]); + else + scramble(argv[1], argv[2]); + + return 0; +} diff --git a/MEMORY/ROMS/splash.c b/MEMORY/ROMS/splash.c new file mode 100644 index 00000000..d0b8db7b --- /dev/null +++ b/MEMORY/ROMS/splash.c @@ -0,0 +1,916 @@ +/* SEGA Dreamcast IP.BIN + * + * Hacked by Lars Olsson + * + * Questions, corrections etc: + * jlo@ludd.luth.se + * + * Notes: + * ~~~~~~ + * + * reg[REG] = access to register REG (including both normal + * CPU registers aswell as CPU-related memory-mapped + * registers, but NOT other hardware registers) + * + * + * Most names have been made up by me and can be very misleading, + * even to the point of being downright incorrect with regards to + * their actual functions + * + * Beware: this source code is only meant to illustrate the function + * of the BootROM and it is not a 100% translation of the actual code. + * A number of short cuts and simplifications have been made in order + * to clarify the operation, which was the purpose of this whole exercise. + * + * Compiling this source (in so far it is possible at all) will NOT + * produce a proper BootROM! For a myriad of reasons... + * + */ + +#include "types.h" +#include "bootROM.h" +#include "hwregs.h" + +/******************************************************************************* + * + * START OF IP.BIN + * + ******************************************************************************/ +/* This code is loaded from IP.BIN. The copy in ROM actually resides + * at 80008000 instead + */ +void +_ac008300() +{ + reg[CCR] = 0x0000092b; + reg[R15] = 0x7e001000; /* use cache as memory for stack */ + init_splash_screen(); + _ac00b700(); /* jump to bootstrap1 */ +} + +void +copy_to_framebuffer(image) /* _8c008330 */ + uint32_t *image; +{ + uint32_t width = 640; /* really not used! */ + uint32_t height = 480; + uint32_t *dst; + uint32_t size = 640 * 480; + + dst = (uint32_t *)(0xa5200000 + (640 * 4 * 480)); + do { + *dst-- = *image++; + } while (size-- != 0); +} + +void +memset4(arg1, arg2, arg3) /* 8c00836c */ + uint32_t *dst; + uint32_t size; + uint32_t data; +{ + dst += size; + size *= 2; + + while (size-- != 0) { + *dst-- = data; + } +} + +uint32_t +get_video_cable() /* _8c008380 */ +{ + uint32_t cable; + + cable = (*(uint16_t *)0xff800030 & 0x0300) | (*(uint32_t *)0xa0702c00 & 0xfffffcff); + *(uint32_t *)0xa0702c00 = cable; + return (cable); +} + +void +init_splash_screen() /* 8c0083a8 */ +{ + clear_variables(); + *(uint32_t *)0x8ced3d9c = 0; + show_splash_screen(); +} + +void +clear_variables() /* _8c0083c0 */ +{ + uint8_t *dst = (uint8_t *)0x8ced3d00; /* 1, R15 */ + + while (dst < (uint8_t *)0x8ced3da0) { + *dst++ = 0; + } +} + +void +show_splash_screen() /* 8c0083f8 */ +{ + uint32_t old_SR; + uint32_t video_mode; /* 9, R15 */ + uint32_t i; /* 8, R15 */ + uint32_t initial_time; /* 7, R15, j */ + uint32_t current_time; /* 6, R15 */ + uint32_t time_diff; /* 5, R15 */ + uint32_t timeout; /* 4, R15 */ + uint32_t finished; /* 3, R15 */ + uint32_t delay; /* 2, R15 */ + uint32_t max_loop; /* 1, R15 */ + + init_timer(); + + old_SR = (reg[SR]>>4) & 0x0000000f; + reg[SR] = (reg[SR] & 0xffffff0f) | 0x000000f0; + + video_mode = get_video_mode(); + + reg[SR] = ((old_SR & 0x0000000f)<<4) | (reg[SR] & 0xffffff0f); + + switch (video_mode) { + case 1: + case 3: + i = 8; + break; + case 4: + /* VGA */ + i = 9; + break; + default: + i = 6; + break; + } + /* _8c008460 */ + old_SR = (reg[SR]>>4) & 0x0000000f; + reg[SR] = (reg[SR] & 0xffffff0f) | 0x000000f0; + + init_graphics(i); + + reg[SR] = ((old_SR & 0x0000000f)<<4) | (reg[SR] & 0xffffff0f); + + /* render splash screen to framebuffer */ + render_frame(i); + set_display(1); + + /* wait a little while */ + initial_time = get_timer(); + max_loop = 0; + finished = 0; + while (finished == 0) { + new_time = get_timer(); + time_diff = get_time_difference(initial_time, new_time); + timeout = convert_time(time_diff); + + delay = 0; + while (delay++ < 1000); + + if (max_loop++ >= 4000) { + finished = 1; + } + if (timeout >= 6000000) { + break; + } + } + /* 8c00851e */ + + sys_do_bioscall(0); /* boot5() */ +} + +/* this renders images and text to framebuffer */ +void +render_frame(arg) /* 8c00853c */ + uin32_t arg; +{ + uint32_t weird_value; /* 0, R15 */ + + fill_8ced4000(arg, 0x00c0c0c0); + weird_value = compute_weird_value(); + print_text(340, 189, "PRODUCED BY OR"); /* *(uint32_t *)0x8c009d98 */ + print_text(340, 213, "UNDER LICENSE FROM"); /* *(uint32_t *)0x8c009d9c */ + print_text(340, 237, "SEGA ENTERPRISES, LTD"); /* *(uint32_t *)0x8c009da0 */ + _8c008b68(337, 186, 780, 260); /* image? */ + _8c00892c(weird_value); + show_small_logo(); + upload_image(); +} + +void +print_text(xpos, ypos, text) /* 8c0085cc */ + uint16_t xpos; /* _0012, R15 */ + uint16_t ypos; /* _0010, R15 */ + sint8_t *text; /* _000c, R15 */ +{ + uint32_t len; /* _0008, R15 */ + uint16_t x; /* _0002, R15 */ + uint16_t y; /* _0000, R15 */ + uint32_t i; /* _0004, R15 */ + + len = strlen(text); + x = xpos; + y = ypos; + i = 0; + + while (i < len) { + /* 8c0085f8 */ + if (text[i] == 'L' && text[i+1] == 'T') { + print_char(&x, &y, 0x1f); /* print LTD glyph */ + i += 2; + } else { + /* 8c00862c */ + print_char(&x, &y, text[i]); + i++; + } + } +} + +void +print_char(x, y, c) /* 8c008652 */ + uint16_t *x; /* _0034, R15 */ + uint16_t *y; /* _0030, R15 */ + sint8_t c; /* _002f, R15 */ +{ + uint8_t buf[20]; /* _0004, R15 */ + uint32_t i; /* _0024, R15 */ + uint32_t *p; /* _0020, R15 */ + uint8_t *p2; /* _0000, R15 */ + uint32_t j; /* _0028, R15 */ + + _8c009ba8(8, buf, (void *)0x8c009d40); /* bah...weird function */ + if (c == ' ') { + *x += 5; + return; + } + + /* find the char in a list */ + p = (uint32_t *)0xac00b46e; + p2 = (uint8_t *)0x8c009da4; + i = 63; + j = 0; + while (j < 63) { + if (p2[0] == c) { + break; + } + p = p + p2[2]; + p2 += 3; + j++; + } + /* 8c0086de */ + + /* WORK TO DO HERE */ + +} + +void +show_small_logo() /* 8c0087fc */ +{ + mr_env_t env; + mr_t mr; + + /* The palette buffer is placed right before the local framebuffer. + * There exists a buffer overflow condition in the code that copies + * the palette which means it's possible to overwrite the rendered + * frame before it is shown! Unfortunately the size of the palette is + * limited to a 16-bit integer which means it's not possible to write + * enough data to cover the offending "PRODUCED BY..." text :( + */ + mr.palette = (uint8_t *)0x8ced3e00; + mr.image = (uint8_t *)0x8c00b820; + + env.x = 300; /* position of logo */ + env.y = 298; + env.c = 0; + env.d = 0; + + decode_small_logo(&mr, &env, 320, 90); +} + +void +upload_image() /* 8c008b4c */ +{ + uint32_t *frame = (uint32_t *)0x8ced4000; + uint32_t foo = 0; /* not used */ + + copy_to_framebuffer(frame); +} + +/* copies sega logo probably */ +void +_8c008b68(a, b, c, d) /* 8c008b68 */ + sint16_t x1; /* _000e, R15 */ + sint16_t y1; /* _000c, R15 */ + sint16_t x2; /* _000a, R15 */ + sint16_t y2; /* _0008, R15 */ +{ + uint32_t *d = (uint32_t *)0x8ced4000; /* _0004, R15 */ + uint32_t i = 0; /* _0000, R15 */ + + d += (((((479 - y1) * 640) - x1) + 639) * 4); + while (d < (((((479 - y2) * 640) - x2) + 639) * 4) + 0x8ced40000) { + /* 8c008bc4 */ + d++; + _8c008c54 + } + +} + +/* Now! This is a weird function indeed! */ +void +compute_weird_value() /* 8c0088b0 */ +{ + uint32_t i = 0; /* _0014 R15 */ + uint32_t j = 0; /* _0004 R15 */ + uint8_t buf[12]; /* _0008 R15 */ + + copy_string(buf, "SEGAKATANA"); /* 8c009d48 */ + + while (j < sizeof(buf)) { + /* 8c0088cc */ + i += buf[j] * buf[j + 1]; + j += 2; + } + /* 8c0088f6 */ + /* i becomes 25747 after completing above */ + /* what sync_cfg is, is a little harder to determine */ + /* definitely 0x100, but perhaps also 0x10 (interlace) is set */ + return ((PVR->sync_cfg & 0xffffff3f) * i); +} + +/* weirdest yet... */ +void +_8c00892c(key) + uint32_t key; +{ + uint8_t buf1[] = { 0xef, 0xcd, 0xab, 0x89, }; /* _0000, R15 */ + uint8_t buf2[] = { 0x67, 0x45, 0x23, 0x01, }; /* _0004, R15 */ + uint16_t k; /* _000c, R15 */ + uint8_t i; /* _000e, R15 */ + uint8_t j; /* _000f, R15 */ + + if (key == 0x0067b768) { + return; + } + + for (k = 0; k < 6; k++) { + /* 8c00894c */ + j = buf2[0]; + i = buf1[0]; + *(uint32_t *)&buf2[0] = ((*(uint32_t *)&buf2[0])<<8) + i; + *(uint32_t *)&buf2[0] = ((*(uint32_t *)&buf1[0])<<8) + j; + } + /* 8c00897a */ +} + +void +fill_8ced4000(arg, col) /* 8c008aa0 */ + uint32_t arg, col; +{ + memset4((uint32_t *)0x8ced4000, 0x0012c000, col); +} + +void +print_pixel(x, y, pixel) /* _8c008ad0 */ + sint32_t x; /* _000c, R15 - 3, R15 */ + sint32_t y; /* _0008, R15 - 2, R15 */ + uint32_t pixel; /* _0004, R15 - 1, R15 */ +{ + uint32_t *p: + + p = (((((479 - y) * 640) - x) + 639) * 4) + (uint32_t *)0x8ced4000; + *p = pixel; +} + +/* interesting */ +void +decode_small_logo(mr, env, w, h) /* 8c008d74 */ + mr_t *mr; /* 11, _002c, R15 */ + mr_env_t *env; /* 10, _0028, R15 */ + sint16_t w; /* _0026, R15 */ + sint16_t h; /* _0024, R15 */ +{ + uint8_t *p = mr->image; /* _0020, 8, R15 */ + uint8_t color; /* _001f, R15 */ + uint32_t *p2; /* _0014, 5, R15 */ + uint32_t j; /* _0010, 4, R15 */ + uint32_t i; /* _000c, 3, R15 */ + uint32_t len; /* _0004, R15 */ + sint16_t cur_x; /* _0002, R15 */ + sint16_t cur_y; /* _0000, R15 */ + + /* check if there is a small logo */ + if (p[0] != 'M' || p[1] != 'R') { + return; + } + /* 8c008daa */ + p += 2; + + mr->size = (sint32_t)read_int(p); + p += 8; + + /* p2 = image data */ + p2 = (uint8_t *)(mr->image + (sint32_t)read_int(p)); + p += 4; + + mr->width = (sint16_t)read_int(p); + /* 8c008dea */ + p += 4; + + mr->height = (sint16_t)read_int(p); + p += 4; + + /* this doesn't seem to be used anywhere */ + mr->foo = (sint16_t)read_int(p); + p += 4; + + /* number of colors */ + mr->colors = (sint16_t)read_int(p); + p += 4; + + j = 0; + /* This is an unsigned comparison but mr->colors is sign-extended */ + /* No bounds checking but not easy to overwrite "PRODUCED.." text + * because mr->colors is only 16-bit, and while it can be negative, + * it will cause alot of thrashing when overwriting... */ + while (j < mr->colors) { + mr->palette[j] = read_int(p); + p += 4; + j++; + } + /* 8c008e5e */ + p = p2; + + cur_x = 0; + cur_y = 0; + j = 0; + /* this is an unsigned comparison but a signed multiplication */ + while (j < (mr->width * mr->height)) { + p += decompress_data(p, &len, &color); + if (env->c == 2 && env->d == color) { + /* 8c008e9e, transparency? never reached in any case */ + j += len; + cur_y += _8c009980(mr->width, cur_x + len); /* args in r0, r1 prolly */ + cur_x = _8c009af0(mr->width, cur_x + len); /* args in r0, r1, prolly */ + + } else { + /* 8c008ed2 */ + i = 0; + /* unsigned comparison */ + while (i < len) { + /* 8c008ee4 */ + /* signed comparisons, both are sign-extended */ + if (cur_x < w && cur_y < h) { + /* 8c008efa */ + /* this must print the pixel */ + /* if cur_y is negative, it's possible + to move the logo upwards */ + print_pixel(env->x + cur_x, env->y + cur_y, mr->palette[color]); + + } + /* 8c008f20 */ + j++; + /* 8c008f26 */ + /* signed comparison */ + if (++cur_x >= mr->width) { + cur_x = 0; + cur_y++; + } + /* 8c008f42 */ + i++; + } + /* 8c008f50 */ + } + /* 8c008f50 */ + } + /* 8c008f64 */ +} + +uint32_t +decompress_data(p, len, color) /* 8c008f70 */ + uint8_t *p; /* _000c, R15 - 3, R15 */ + uint32_t *len; /* _0008, R15 - 2, R15 */ + uint8_t *color; /* _0004, R15 - 1, R15 */ +{ + uint32_t i; /* _0000, R15 */ + + *len = 0; + i = 1; + + if (*p & 0x80 == 0) { + *len = 1; + *color = *p; + return (i); + } + /* 8c008f9e */ + while (*p & 0x80 != 0) { + *len <<= 7; + *len |= *len & 0x7f; + p++; + i++; + } + /* 8c008fd2 */ + *color = *p; + return (i); +} + +sint8_t +read_byte(p) /* 8c008fe8 */ + sint8_t *p; +{ + return (*p); +} + +uint32_t +read_int(p) /* _8c008ffc */ + sint8_t *p; /* _000c, R15 - 3, R15 */ +{ + uint32_t val; /* _0008, R15 - 2, R15 */ + uint32_t j; /* _0004, R15 - 1, R15 */ + + val = 0; + j = 0; + while (j < 4) { + val = val + (uint8_t)read_byte(p + j) << j*8; + j++; + } + return (val); +} + +void +init_graphics(arg) /* 8c009074 */ + uint32_t arg; +{ + init_graphics2(arg); +} + +/* this function is patched before execution starts */ +void +set_display(enable) /* 8c00908c */ + uint32_t enable; +{ + HOLLY->pend0 = 0x00000008; + while (HOLLY->pend0 != 0x00000008); + + if (enable == 1) { + /* 8c0090a8 */ + PVR->fb_cfg1 = *(uint32_t *)0x8ced3d24; + PVR->video_cfg = *(uint32_t *)0x8ced3d18; + + } else { + /* 8c0090c4 */ + PVR->video_cfg = *(uint32_t *)0x8ced3d18 | 0x00000008; + /* here's the patched version: */ + PVR->fb_cfg1 = *(uint32_t *)0x8ced3d24; + /* and here's the unpatched one: + * PVR->fb_cfg1 = 0x00000000; + */ + } +} + +uint32_t +init_PVR(arg) /* 8c0090f8 */ + uint32_t arg; +{ + uint32_t id; + uint32_t i, fog; + + id = PVR->id; + PVR->reset = 0x00000000; + *(uint32_t *)0x8ced3d18 = (sysvars->unknown0<<16) | 0x08; + *(uint32_t *)0x8ced3d24 = 0x0000000c; + + if (arg == 9) { + *(uint32_t *)0x8ced3d24 |= 0x00800000; + } + + PVR->border_col = 0x00c0c0c0; + + set_display(0); + + PVR->spansort_cfg = 0x00000101; + PVR->fog_table_col = 0x007f7f7f; + PVR->fog_vertex_col = 0x007f7f7f; + PVR->fog_density = 0x0000ff07; + + fog = 0xfffe; + for (i = 0; i < 128; i++) { + ((uint32_t *)&PVR->fog_table)[i] = fog; /* weird */ + fog = fog - 0x0101; + } + + PVR->reset = 0x00000001; + PVR->reset = 0x00000000; + + *HW32(0xa05f6884) = 0x00000000; + *HW32(0xa05f6888) = 0x00000000; + + return (id); +} + +void +set_display_mode_regs(arg) /* 8c009214 */ + uint32_t arg; +{ + PVR->ta_opb_start = 0x000c2680; + PVR->ta_opb_end = 0x0009e800; + PVR->ta_ob_start = 0x00000000; + PVR->ta_ob_end = 0x0009e740; + PVR->tilebuf_size = 0x000e0013; + PVR->ta_opb_cfg = 0x00100203; + PVR->ta_opl_start = 0x000c2680; + PVR->ta_init = 0x80000000; + PVR->pclip_x = ((*_8ced3d00-1)<<16) & 0x07ff0000; + PVR->pclip_y = ((*_8ced3d04-1)<<16) & 0x07ff0000; + PVR->burst_cfg = 0x00093f39; + PVR->sync_cfg = *(uint32_t *)0x8ced3d44; + PVR->hborder = *(uint32_t *)0x8ced3d4c; + PVR->vborder = *(uint32_t *)0x8ced3d50; + PVR->sync_load = *(uint32_t *)0x8ced3d54; + PVR->sync_width = *(uint32_t *)0x8ced3d58; + PVR->render_addr1 = *(uint32_t *)0x8ced3d38; + PVR->render_addr2 = *(uint32_t *)0x8ced3d40; + PVR->fb_cfg2 = *(uint32_t *)0x8ced3d28; + PVR->render_modulo = *(uint32_t *)0x8ced3d2c; + PVR->display_addr1 = *(uint32_t *)0x8ced3d34; + PVR->display_addr2 = *(uint32_t *)0x8ced3d3c; + PVR->display_size = *(uint32_t *)0x8ced3d30; + PVR->hpos_irq = *(uint32_t *)0x8ced3d48; + PVR->shadow = 0x00000001; + PVR->ob_cfg = 0x0027df77; + PVR->half_offset = 0x00000007; + PVR->luminance = 0x00008040; + PVR->object_clip = 0x3f800000; + PVR->tsp_clip = 0x00000000; + PVR->bgplane_z = 0.000100; + PVR->bgplane_cfg = 0x01000000; + PVR->clamp_max = 0xffffffff; + PVR->clamp_min = 0xff000000; + PVR->tsp_cfg = *(uint32_t *)0x8ced3d10; + PVR->border_col = *(uint32_t *)0x8ced3d14; + PVR->scaler_cfg = *(uint32_t *)0x8ced3d5c; +} + +/* This whole function is skipped because of patching! */ +void +clear_display_cable(arg) /* 8c00940a */ + uint32_t arg; +{ + /* unpatched: + * if (arg == 9) { + * *HW32(0xa0702c00) = *HW32(0xa0702c00) & 0x01; + * } else { + * *HW32(0xa0702c00) = (*HW32(0xa0702c00) & 0x01) | 0x00000300; + * } + */ +} + +void +set_display_mode_vars2(displaymode) /* 8c009488 */ + uint32_t displaymode; /* 2, R15 */ +{ + uint32_t i = 4; /* 1, R15 */ + + *(uint32_t *)0x8ced3d24 = 1; + *(uint32_t *)0x8ced3d28 = 0; + *(uint32_t *)0x8ced3d44 = 0x0100; + *(uint32_t *)0x8ced3d18 = sysvars->unknown0<<16; + *(uint32_t *)0x8ced3d24 |= 0x0000000c; + *(uint32_t *)0x8ced3d28 |= 0x00000006; + + /* i'll bet that these are pvr display modes (pal, ntsc, vga) */ + switch (displaymode & 0x0f) { + case 0x01: + /* 8c0094f0 */ + displaymode = (displaymode & 0xffffff0f) | 0x00000010; + *(uint32_t *)0x8ced3d24 |= 0x00800000; + *(uint32_t *)0x8ced3d48 = 0x03450000; + *(uint32_t *)0x8ced3d4c = 0x007e0345; + *(uint32_t *)0x8ced3d50 = 0x00280208; + *(uint32_t *)0x8ced3d54 = 0x020c0359; + *(uint32_t *)0x8ced3d58 = 0x03f1933f; + break; + case 0x04: + /* 8c009526 */ + *(uint32_t *)0x8ced3d44 |= 0x00000090; + *(uint32_t *)0x8ced3d48 = 0x034b0000; + *(uint32_t *)0x8ced3d4c = 0x008d034b; + *(uint32_t *)0x8ced3d50 = 0x002c026c; + *(uint32_t *)0x8ced3d54 = 0x0270035f; + *(uint32_t *)0x8ced3d58 = 0x07d6a53f; + break; + case 0x02: + default: + /* 8c009550 */ + *(uint32_t *)0x8ced3d44 |= 0x00000050; + *(uint32_t *)0x8ced3d48 = 0x03450000; + *(uint32_t *)0x8ced3d4c = 0x007e0345; + *(uint32_t *)0x8ced3d50 = 0x00240204; + *(uint32_t *)0x8ced3d54 = 0x020c0359; + *(uint32_t *)0x8ced3d58 = 0x07d6c63f; + break; + } + /* 8c0095cc */ + *(uint32_t *)0x8ced3d00 = 640; + *(uint32_t *)0x8ced3d04 = 480; + + if (displaymode & 0x00000200) { + *(uint32_t *)0x8ced3d34 = 0x00200000; + *(uint32_t *)0x8ced3d3c = (640 * i) + 0x00200000; + *(uint32_t *)0x8ced3d38 = 0x00600000; + *(uint32_t *)0x8ced3d40 = (640 * i) + 0x00600000; + *(uint32_t *)0x8ced3d30 = (((640 * i + 1)<<20) & 0x3ff00000) + | ((((*(uint32_t *)0x8ced3d04>>1) - 1)<<10) & 0x000ffc00) + | (((640 * i) - 1) & 0x000003ff); + *(uint32_t *)0x8ced3d5c = 0x00000400; + *(uint32_t *)0x8ced3d8c = 0x00000000; + } else { + /* 8c0096b4 */ + *(uint32_t *)0x8ced3d30 = (((*(uint32_t *)0x8ced3d04 - 1)<<10) & 0x000ffc00) + | (((640 * i) - 1) & 0x000003ff) + | 0x00100000; + *(uint32_t *)0x8ced3d5c = 0x00000400; + *(uint32_t *)0x8ced3d34 = 0x00200000; + *(uint32_t *)0x8ced3d3c = 0x00200000; + *(uint32_t *)0x8ced3d38 = 0x00600000; + *(uint32_t *)0x8ced3d40 = 0x00600000; + *(uint32_t *)0x8ced3d8c = 0x00000000; + } + /* 8c009704 */ + PVR->vpos_irq = 0x00150104; + *(uint32_t *)0x8ced3d2c = (*(uint32_t *)0x8ced3d00 * i)/8; + *(uint32_t *)0x8ced3d08 = (*(uint32_t *)0x8ced3d04 * *(uint32_t *)0x8ced3d2c) * 8; + *(uint32_t *)0x8ced3d78 = 0x00000000; + *(uint32_t *)0x8ced3d14 = 0x00c0c0c0; + *(uint32_t *)0x8ced3d0c = 640; + *(uint32_t *)0x8ced3d10 = 0x00000000; +} + +void +set_display_mode_vars(arg) /* 8c0097b4 */ + uint32_t arg; +{ + clear_display_cable(arg); + + switch (arg) { + case 6: + set_display_mode_vars2(0x00008212); + break; + case 8: + set_display_mode_vars2(0x00008214); + break; + case 9: + set_display_mode_vars2(0x00008111); + break; + default: + set_display_mode_vars2(0x00008212); + break; + } + +} + +void +init_graphics2(arg) /* 8c009830 */ + int arg; +{ + init_PVR(arg); + set_display_mode_vars(arg); + set_display_mode_regs(arg); +} + +uint32_t +get_video_mode() /* 8c009858 */ +{ + uint32_t cable; + uint8_t video; + + cable = get_video_cable(); + video = sysvars->config.video_system; + + if (cable == 0) { + return (4); + } + + switch (video) { + case '0': + return (0); + break; + case '1': + return (1); + break; + case '2': + return (2); + break; + case '3': + return (3); + break; + default: + return (0); + break; + } +} + +void +copy_string(buf, string) /* 8c009c4c */ + uint8_t *buf; + uint8_t *string; +{ + strcpy(buf, string); /* passes args in r0,r1 */ +} + +/* takes args in r0, r1 */ +uint8_t * +strcpy(buf, string) /* _8c009c74 */ + uint8_t *buf; + uint8_t *string; +{ + uint32_t i = 0; + + /* check for alignment i guess, but both addresses should always be + * 32-bit aligned in bootROM */ + if ((buf & 0x03 | string & 0x03) != 0) { + /* so this should never happen */ + while (1) { + buf[i] = *string++; + if (buf[i] == '\0') { + return (buf); + } + buf[i+1] = *string++; + if (buf[i+1] == '\0') { + return (buf); + } + buf[i+2] = *string++; + if (buf[i+2] == '\0') { + return (buf); + } + buf[i+3] = *string++; + if (buf[i+3] == '\0') { + return (buf); + } + } + } + /* 8c009cb8 */ + /* weird here, skips first two instructions of a function :/ */ + strcpy4+4(buf, string); + +} + +/* it seems this will just make a 32-bit copy instead */ +void +strcpy4(buf, string) /* 8c009cc4 */ + uint32_t *buf; + uint32_t *string; +{ + uint32_t val; + + if (*string == 0x00000000) { + } +} + +uint32_t +strlen(s) /* 8c009c62 */ + uint8_t *s; +{ + uint32_t n = 0; + + while (*s++) { + n++; + } + return (n); +} + +void +init_timer() /* 8c009dec */ +{ + reg[TOCR] = 0x00; + reg[TSTR] = reg[TSTR] & 0xfe; + reg[TCR0] = 0x0002; + reg[TCOR0] = 0xffffffff; + reg[TCNT0] = 0xffffffff; + reg[TSTR] = reg[TSTR] | 0x01; +} + +uint32_t +get_timer() /* 8c009e12 */ +{ + return (0xffffffff - *(volatile uin32_t *)0xffd8000c); +} + +uint32_t +get_time_difference(time1, time2) /* 8c009e1c */ + uint32_t time1, time2; +{ + return (time2, time1); +} + +uint32_t +convert_time(time) /* 8c009e24 */ + uint32_t time; +{ + /* WORK TO DO HERE */ +} + + +/******************************************************************************* + * + * END OF IP.BIN + * + ******************************************************************************/ diff --git a/POWERVR/DOCS/dc-video.pdf b/POWERVR/DOCS/dc-video.pdf new file mode 100644 index 00000000..92454d6f Binary files /dev/null and b/POWERVR/DOCS/dc-video.pdf differ diff --git a/POWERVR/DOCS/dc-video.ps b/POWERVR/DOCS/dc-video.ps new file mode 100644 index 00000000..8f3e94ce Binary files /dev/null and b/POWERVR/DOCS/dc-video.ps differ diff --git a/POWERVR/SRCS/NeHe/Lesson1/Makefile b/POWERVR/SRCS/NeHe/Lesson1/Makefile new file mode 100644 index 00000000..bdcafa96 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson1/Makefile @@ -0,0 +1 @@ +include Makefile.dc \ No newline at end of file diff --git a/POWERVR/SRCS/NeHe/Lesson1/Makefile.dc b/POWERVR/SRCS/NeHe/Lesson1/Makefile.dc new file mode 100644 index 00000000..0249d75e --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson1/Makefile.dc @@ -0,0 +1,31 @@ +# +# PLX Lesson 1 +# +# + +TARGET = dcp.elf +OBJS = main.o + +all: rm-elf $(TARGET) + +include $(KOS_BASE)/Makefile.rules + +clean: + -rm -f $(TARGET) $(OBJS) +rm-elf: + -rm -f $(TARGET) +$(TARGET): $(OBJS) + kos-c++ -o $(TARGET) $(OBJS) -lparallax -lz -lkosutils -lm + +#romdisk.img: +# $(KOS_GENROMFS) -f romdisk.img -d romdisk -v + +#romdisk.o: romdisk.img +# $(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o + +run: $(TARGET) + $(KOS_LOADER) $(TARGET) + +dist: + rm -f $(OBJS) romdisk.o romdisk.img + $(KOS_STRIP) $(TARGET) diff --git a/POWERVR/SRCS/NeHe/Lesson1/main.c b/POWERVR/SRCS/NeHe/Lesson1/main.c new file mode 100644 index 00000000..90809280 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson1/main.c @@ -0,0 +1,124 @@ + + +#include +#include +#include +#include + +KOS_INIT_FLAGS(INIT_DEFAULT | INIT_MALLOCSTATS); + +void printControls() { + printf("\n/**********Controls**********/\n"); + printf("START-Button: Exits program\n"); + printf("X-Button: NONE \n"); + printf("Y-Button: NONE \n"); + printf("A-Button: NONE \n"); + printf("B-Button: NONE \n"); + + printf("UP-Dir: NONE \n"); + printf("DOWN-Dir: NONE \n"); + printf("LEFT-Dir: NONE \n"); + printf("RIGHT-Dir: NONE \n"); + printf("/****************************/\n\n"); +} + +pvr_init_params_t params = { + /* Enable opaque and translucent polygons with size 16 */ + { PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_0 }, + + /* Vertex buffer size 512K */ + 512*1024 +}; + +int main(int argc, char **argv) { + + /* Controller Stuff */ + maple_device_t * dev; + cont_state_t * state; + + /* Init PVR API */ + if (pvr_init(¶ms) < 0) + return -1; + + printControls(); + + /* Sets the background color to black */ + pvr_set_bg_color(0.0f,0.0f,0.0f); + + plx_cxt_init(); // Initialize the plx context system + plx_cxt_texture(NULL); // No texture will be used + plx_cxt_culling(PLX_CULL_NONE); // No culling + + // GET SOME 3D GOING!! + /* Init matrices */ + plx_mat3d_init(); /* Clear internal to an identity matrix */ + plx_mat3d_mode(PLX_MAT_PROJECTION); /** Projection (frustum, screenview) matrix */ + plx_mat3d_identity(); /** Load an identity matrix */ + plx_mat3d_perspective(45.0f, 640.0f / 480.0f, 0.1f, 100.0f); // (float angle, float aspect, float znear, float zfar); + plx_mat3d_mode(PLX_MAT_MODELVIEW); /** Modelview (rotate, scale) matrix */ + + while(1) { + + // Check for the user pressing START + dev = maple_enum_dev(0, 0); + if(dev == NULL) { + printf("Error: Could not find controller in first port.\n"); + break; + } + state = (cont_state_t *)maple_dev_status(dev); + if (state->buttons & CONT_START) { + break; // exit the program + } + + pvr_wait_ready(); + pvr_scene_begin(); + pvr_list_begin(PVR_LIST_OP_POLY); + + // Submit the context + plx_cxt_send(PVR_LIST_OP_POLY); // Submit the Header for PVR_LIST_OP_POLY + + // DRAW THE TRIANGLE + plx_mat3d_identity(); + plx_mat3d_translate(-1.5f, 0.0f, -6.0f); // Move 1.5f units to the left and 6 units into the screen + + /* Clear internal to an identity matrix */ + plx_mat_identity(); + + /* "Apply" a matrix: multiply a matrix onto the "internal" one */ + plx_mat3d_apply(PLX_MAT_SCREENVIEW); /** Internal screen view matrix */ + plx_mat3d_apply(PLX_MAT_PROJECTION); /** Projection (frustum, screenview) matrix */ + plx_mat3d_apply(PLX_MAT_MODELVIEW); /** Modelview (rotate, scale) matrix */ + + // Could also use the following line instead of the above three lines + //plx_mat3d_apply_all(); + + plx_vert_inpm3(PLX_VERT, 0, 1, 0, plx_pack_color(1.0f, 1.0f, 1.0f, 1.0f)); // Top + plx_vert_inpm3(PLX_VERT, -1, -1, 0, plx_pack_color(1.0f, 1.0f, 1.0f, 1.0f)); // Bottom Left + plx_vert_inpm3(PLX_VERT_EOS, 1, -1, 0, plx_pack_color(1.0f, 1.0f, 1.0f, 1.0f)); // Bottom Right + + // DRAW THE QUAD + plx_mat3d_identity(); + plx_mat3d_translate(1.5f, 0.0f, -6.0f); // Move 1.5f units to the right and 6 units into the screen + + /* Clear internal to an identity matrix */ + plx_mat_identity(); + + /* "Apply" a matrix: multiply a matrix onto the "internal" one */ + plx_mat3d_apply(PLX_MAT_SCREENVIEW); /** Internal screen view matrix */ + plx_mat3d_apply(PLX_MAT_PROJECTION); /** Projection (frustum, screenview) matrix */ + plx_mat3d_apply(PLX_MAT_MODELVIEW); /** Modelview (rotate, scale) matrix */ + + // Could also use the following line instead of the above three lines + //plx_mat3d_apply_all(); + + plx_vert_inpm3(PLX_VERT, -1, 1, 0, plx_pack_color(1.0f, 1.0f, 1.0f, 1.0f)); // Bottom Left + plx_vert_inpm3(PLX_VERT, -1, -1, 0, plx_pack_color(1.0f, 1.0f, 1.0f, 1.0f)); // Top Left + plx_vert_inpm3(PLX_VERT, 1, 1, 0, plx_pack_color(1.0f, 1.0f, 1.0f, 1.0f)); // Bottom Right + plx_vert_inpm3(PLX_VERT_EOS, 1, -1, 0, plx_pack_color(1.0f, 1.0f, 1.0f, 1.0f)); // Top Right + + pvr_scene_finish(); + } + + return 0; +} + diff --git a/POWERVR/SRCS/NeHe/Lesson10/Makefile b/POWERVR/SRCS/NeHe/Lesson10/Makefile new file mode 100644 index 00000000..bdcafa96 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson10/Makefile @@ -0,0 +1 @@ +include Makefile.dc \ No newline at end of file diff --git a/POWERVR/SRCS/NeHe/Lesson10/Makefile.dc b/POWERVR/SRCS/NeHe/Lesson10/Makefile.dc new file mode 100644 index 00000000..b2922bf4 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson10/Makefile.dc @@ -0,0 +1,32 @@ +# +# PLX Lesson 10 +# +# + +TARGET = dcp.elf +OBJS = main.o + +all: rm-elf $(TARGET) + +include $(KOS_BASE)/Makefile.rules + +clean: + -rm -f $(TARGET) $(OBJS) romdisk.* +rm-elf: + -rm -f $(TARGET) romdisk.* + +$(TARGET): $(OBJS) romdisk.o + kos-c++ -o $(TARGET) $(OBJS)romdisk.o -lparallax -lpng -ljpeg -lkmg -lz -lkosutils -lm + +romdisk.img: + $(KOS_GENROMFS) -f romdisk.img -d romdisk -v + +romdisk.o: romdisk.img + $(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o + +run: $(TARGET) + $(KOS_LOADER) $(TARGET) + +dist: + rm -f $(OBJS) romdisk.o romdisk.img + $(KOS_STRIP) $(TARGET) diff --git a/POWERVR/SRCS/NeHe/Lesson10/main.c b/POWERVR/SRCS/NeHe/Lesson10/main.c new file mode 100644 index 00000000..0d77628c --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson10/main.c @@ -0,0 +1,169 @@ + + +#include +#include +#include +#include +#include + +extern uint8 romdisk[]; +KOS_INIT_FLAGS(INIT_DEFAULT | INIT_MALLOCSTATS); +KOS_INIT_ROMDISK(romdisk); + +void printControls() { + printf("\n/**********Controls**********/\n"); + printf("START-Button: Exits program\n"); + printf("X-Button: NONE \n"); + printf("Y-Button: NONE \n"); + printf("A-Button: NONE \n"); + printf("B-Button: NONE \n"); + + printf("UP-Dir: NONE \n"); + printf("DOWN-Dir: NONE \n"); + printf("LEFT-Dir: NONE \n"); + printf("RIGHT-Dir: NONE \n"); + printf("/****************************/\n\n"); +} + +/** + Like plx_vert_ifdm3, but uses plx_prim. + */ +static inline void plx_vert_ifpm3(int flags, float x, float y, float z, uint32 color, float u, float v) { + plx_mat_tfip_3d(x, y, z); + plx_vert_ifp(flags, x, y, z, color, u, v); +} + +pvr_init_params_t params = { + /* Enable opaque and translucent polygons with size 16 */ + { PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_0 }, + + /* Vertex buffer size 512K */ + 512*1024 +}; + +int main(int argc, char **argv) { + + /* Controller Stuff */ + maple_device_t * dev; + cont_state_t * state; + + int x, y; + float xrot = 0; /* X Rotation */ + float yrot = 0; /* Y Rotation */ + float zrot = 0; /* Z Rotation */ + float points[45][45][3]; // The Array For The Points On The Grid Of Our "Wave" + int wiggle_count = 0; // Counter Used To Control How Fast Flag Waves + float hold; // Temporarily Holds A Floating Point Value + + uint32 color = plx_pack_color(1.0f, 1.0f, 1.0f, 1.0f); // Pure white color. Used for images to keep original color + plx_texture_t *a_texture; // Storage for 1 texture + + float float_x, float_y, float_xb, float_yb; // loop counters. + + /* Init PVR API */ + if (pvr_init(¶ms) < 0) + return -1; + + printControls(); + + /* Sets the background color to blue */ + pvr_set_bg_color(0.0f, 0.0f, 1.0f); + + /* Load the texture */ + a_texture = plx_txr_load("/rd/tim.png", 0, PVR_TXRLOAD_16BPP); + + plx_cxt_init(); // Initialize the plx context system + plx_cxt_texture(a_texture); // Texture 'a_texture' will be used with the context system + plx_cxt_culling(PLX_CULL_NONE); // No culling + + // GET SOME 3D GOING!! + plx_mat3d_init(); /* Clear internal to an identity matrix */ + plx_mat3d_mode(PLX_MAT_PROJECTION); /** Projection (frustum, screenview) matrix */ + plx_mat3d_identity(); /** Load an identity matrix */ + plx_mat3d_perspective(45.0f, 640.0f / 480.0f, 0.1f, 100.0f); // (float angle, float aspect, float znear, float zfar); + plx_mat3d_mode(PLX_MAT_MODELVIEW); /** Modelview (rotate, scale) matrix */ + + for(float_x = 0.0f; float_x < 9.0f; float_x += 0.2f ) { + for(float_y = 0.0f; float_y < 9.0f; float_y += 0.2f) { + points[ (int) (float_x*5) ][ (int) (float_y*5) ][0] = float_x - 4.4f; + points[ (int) (float_x*5) ][ (int) (float_y*5) ][1] = float_y - 4.4f; + points[ (int) (float_x*5) ][ (int) (float_y*5) ][2] = (float) (fsin( ( (float_x*5*8)/360 ) * 3.14159 * 2)); + } + } + + while(1) { + + // Check for the user pressing START + dev = maple_enum_dev(0, 0); + if(dev == NULL) { + printf("Error: Could not find controller in first port.\n"); + break; + } + state = (cont_state_t *)maple_dev_status(dev); + if (state->buttons & CONT_START) { + break; // exit the program + } + + pvr_wait_ready(); + pvr_scene_begin(); + pvr_list_begin(PVR_LIST_OP_POLY); + + // Submit the context + plx_cxt_send(PVR_LIST_OP_POLY); // Submit the Header for PVR_LIST_OP_POLY + + // DRAW THE BOX + plx_mat3d_identity(); + plx_mat3d_translate(0.0f, 0.0f, -12.0f); // Move 12 units into the screen + plx_mat3d_rotate(xrot, 1.0f, 0.0f, 0.0f); // Rotate the Wavy texture angle 'xrot' on the X axis + plx_mat3d_rotate(yrot, 0.0f, 1.0f, 0.0f); // Rotate the Wavy texture angle 'yrot' on the Y axis + plx_mat3d_rotate(zrot, 0.0f, 0.0f, 1.0f); // Rotate the Wavy texture angle 'zrot' on the Z axis + + /* Clear internal to an identity matrix */ + plx_mat_identity(); + + /* "Applying" all matrixs: multiply a matrix onto the "internal" one */ + plx_mat3d_apply_all(); + + // Draw each section of the image + for (x = 0; x < 44; x++) { + for (y = 0; y < 44; y++) { + float_x = (float) (x)/44; + float_y = (float) (y)/44; + float_xb = (float) (x+1)/44; + float_yb = (float) (y+1)/44; + + plx_vert_ifpm3(PLX_VERT, points[x][y+1][0], points[x][y+1][1], points[x][y+1][2], color, float_x, float_yb); + plx_vert_ifpm3(PLX_VERT, points[x][y][0], points[x][y][1], points[x][y][2], color, float_x, float_y); + plx_vert_ifpm3(PLX_VERT, points[x+1][y+1][0], points[x+1][y+1][1], points[x+1][y+1][2], color, float_xb, float_yb); + plx_vert_ifpm3(PLX_VERT_EOS, points[x+1][y][0], points[x+1][y][1], points[x+1][y][2], color, float_xb, float_y); + } + } + + pvr_scene_finish(); + + + if (wiggle_count == 2) { // Used To Slow Down The Wave (Every 2nd Frame Only) + for( y = 0; y < 45; y++ ) // Loop Through The Y Plane + { + hold = points[0][y][2]; // Store Current Value One Left Side Of Wave + for( x = 0; x < 44; x++) // Loop Through The X Plane + { + // Current Wave Value Equals Value To The Right + points[x][y][2] = points[x+1][y][2]; + } + points[44][y][2] = hold; // Last Value Becomes The Far Left Stored Value + } + wiggle_count = 0; // Set Counter Back To Zero + } + wiggle_count++; // Increase The Counter + + xrot += 0.3f; // Increase the Wavy Texture's angle(x-axis) rotation + yrot += 0.2f; // Increase the Wavy Texture's angle(y-axis) rotation + zrot += 0.4f; // Increase the Wavy Texture's angle(z-axis) rotation + } + // Clean up!!! + plx_txr_destroy(a_texture); + + return 0; +} + diff --git a/POWERVR/SRCS/NeHe/Lesson10/romdisk/Thumbs.db b/POWERVR/SRCS/NeHe/Lesson10/romdisk/Thumbs.db new file mode 100644 index 00000000..30d97378 Binary files /dev/null and b/POWERVR/SRCS/NeHe/Lesson10/romdisk/Thumbs.db differ diff --git a/POWERVR/SRCS/NeHe/Lesson10/romdisk/tim.png b/POWERVR/SRCS/NeHe/Lesson10/romdisk/tim.png new file mode 100644 index 00000000..182570e1 Binary files /dev/null and b/POWERVR/SRCS/NeHe/Lesson10/romdisk/tim.png differ diff --git a/POWERVR/SRCS/NeHe/Lesson11/Makefile b/POWERVR/SRCS/NeHe/Lesson11/Makefile new file mode 100644 index 00000000..bdcafa96 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson11/Makefile @@ -0,0 +1 @@ +include Makefile.dc \ No newline at end of file diff --git a/POWERVR/SRCS/NeHe/Lesson11/Makefile.dc b/POWERVR/SRCS/NeHe/Lesson11/Makefile.dc new file mode 100644 index 00000000..0b887372 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson11/Makefile.dc @@ -0,0 +1,32 @@ +# +# PLX Lesson 11 +# +# + +TARGET = dcp.elf +OBJS = main.o + +all: rm-elf $(TARGET) + +include $(KOS_BASE)/Makefile.rules + +clean: + -rm -f $(TARGET) $(OBJS) romdisk.* +rm-elf: + -rm -f $(TARGET) romdisk.* + +$(TARGET): $(OBJS) romdisk.o + kos-c++ -o $(TARGET) $(OBJS)romdisk.o -lparallax -lpng -ljpeg -lkmg -lz -lkosutils -lm + +romdisk.img: + $(KOS_GENROMFS) -f romdisk.img -d romdisk -v + +romdisk.o: romdisk.img + $(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o + +run: $(TARGET) + $(KOS_LOADER) $(TARGET) + +dist: + rm -f $(OBJS) romdisk.o romdisk.img + $(KOS_STRIP) $(TARGET) diff --git a/POWERVR/SRCS/NeHe/Lesson11/main.c b/POWERVR/SRCS/NeHe/Lesson11/main.c new file mode 100644 index 00000000..b819d859 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson11/main.c @@ -0,0 +1,184 @@ + + +#include +#include +#include +#include +#include + +extern uint8 romdisk[]; +KOS_INIT_FLAGS(INIT_DEFAULT | INIT_MALLOCSTATS); +KOS_INIT_ROMDISK(romdisk); + +void printControls() { + printf("\n/**********Controls**********/\n"); + printf("START-Button: Exits program\n"); + printf("X-Button: NONE \n"); + printf("Y-Button: NONE \n"); + printf("A-Button: NONE \n"); + printf("B-Button: NONE \n"); + + printf("UP-Dir: Rotate the crates upward \n"); + printf("DOWN-Dir: Rotate the crates downward \n"); + printf("LEFT-Dir: Rotate the crates to the (Dark Top: Left)/(Light Top: Right) \n"); + printf("RIGHT-Dir: Rotate the crates to the (Dark Top: Right)/(Light Top: Left) \n"); + printf("/****************************/\n\n"); +} + +plx_texture_t *a_texture; // storage for 1 texture; + +float xrot; // x rotation +float yrot; // y rotation +int xloop; // loop for x axis. +int yloop; // loop for y axis. + +// Colors for boxes. +static float boxcol[5][4]= +{ + {1.0, 1.0f, 0.0f, 0.0f}, {1.0, 1.0f, 0.5f, 0.0f}, {1.0, 1.0f, 1.0f, 0.0f}, {1.0, 0.0f, 1.0f, 0.0f}, {1.0, 0.0f, 1.0f, 1.0f} +}; + +// Colors for tops of boxes. +static float topcol[5][4]= +{ + {1.0, 0.5f, 0.0f, 0.0f}, {1.0, 0.5f, 0.25f, 0.0f}, {1.0, 0.5f, 0.5f, 0.0f}, {1.0, 0.0f, 0.5f, 0.0f}, {1.0, 0.0f, 0.5f, 0.5f} +}; + +pvr_init_params_t params = { + /* Enable opaque and translucent polygons with size 16 */ + { PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_0 }, + + /* Vertex buffer size 512K */ + 512*1024 +}; + +int main(int argc, char **argv) { + + /* Controller Stuff */ + maple_device_t * dev; + cont_state_t * state; + + /* Vertex stuff(direct rendering) */ + plx_dr_state_t dr_state; + + uint32 color = 0; + + /* Init PVR API */ + if (pvr_init(¶ms) < 0) + return -1; + + printControls(); + + /* Sets the background color to blue */ + pvr_set_bg_color(0.0f, 0.0f, 1.0f); + + /* Load the textures */ + a_texture = plx_txr_load("/rd/cube.png", 0, PVR_TXRLOAD_16BPP); + + plx_cxt_init(); // Initialize the plx context system + plx_cxt_texture(a_texture); // Texture 'a_texture' will be used with the context system + plx_cxt_culling(PLX_CULL_NONE); // No Culling + + // GET SOME 3D GOING!! + plx_mat3d_init(); /* Clear internal to an identity matrix */ + plx_mat3d_mode(PLX_MAT_PROJECTION); /** Projection (frustum, screenview) matrix */ + plx_mat3d_identity(); /** Load an identity matrix */ + plx_mat3d_perspective(45.0f, 640.0f / 480.0f, 0.1f, 100.0f); // (float angle, float aspect, float znear, float zfar); + plx_mat3d_mode(PLX_MAT_MODELVIEW); /** Modelview (rotate, scale) matrix */ + + while(1) { + + // Check for the user pressing START + dev = maple_enum_dev(0, 0); + if(dev == NULL) { + printf("Error: Could not find controller in first port.\n"); + break; + } + state = (cont_state_t *)maple_dev_status(dev); + if (state->buttons & CONT_START) { + break; // exit the program + } + if (state->buttons & CONT_DPAD_UP) { + xrot -= 1.5f; // Rotate the crates upward in the negative direction (away from you) + } + if (state->buttons & CONT_DPAD_DOWN) { + xrot += 1.5f; // Rotate the crates downward in the positive direction (toward you) + } + if (state->buttons & CONT_DPAD_LEFT) { + yrot -= 1.5f; // Rotate the crates to the left (depends on the top of the crate) + } + if (state->buttons & CONT_DPAD_RIGHT) { + yrot += 1.5f; // Rotate the crates to the right (depends on the top of the crate) + } + + pvr_wait_ready(); + pvr_scene_begin(); + + pvr_list_begin(PVR_LIST_OP_POLY); + plx_cxt_send(PVR_LIST_OP_POLY); // Submit the Header for PVR_LIST_OP_POLY + + plx_dr_init(&dr_state); // Initialize a state variable for Direct Rendering + + for (yloop = 1; yloop < 6; yloop++) { // 5 rows of cubes. + for (xloop = 0; xloop < yloop; xloop++) { + plx_mat3d_identity(); + plx_mat3d_translate(1.4f+(((float)xloop)*2.8f)-(((float)yloop)*1.4f),((6.0f-((float)yloop))*2.4f)-7.0f,-20.0f); + plx_mat3d_rotate(45.0f - (2.0f*yloop)+xrot, 1.0f, 0.0f, 0.0f); + plx_mat3d_rotate(45.0f + yrot, 0.0f, 1.0f, 0.0f); + + /* Clear internal to an identity matrix */ + plx_mat_identity(); + + /* "Applying" all matrixs: multiply a matrix onto the "internal" one */ + plx_mat3d_apply_all(); + + color = plx_pack_color(boxcol[yloop-1][0], boxcol[yloop-1][1], boxcol[yloop-1][2], boxcol[yloop-1][3]); + + // Bottom Face + plx_vert_ifdm3(&dr_state, PLX_VERT, 1.0f, -1.0f, -1.0f, color, 0.0f, 1.0f); // Bottom Left Of The Texture and Quad + plx_vert_ifdm3(&dr_state, PLX_VERT, 1.0f, -1.0f, 1.0f, color, 0.0f, 0.0f); // Top Left Of The Texture and Quad + plx_vert_ifdm3(&dr_state, PLX_VERT, -1.0f, -1.0f, -1.0f, color, 1.0f, 1.0f); // Bottom Right Of The Texture and Quad + plx_vert_ifdm3(&dr_state, PLX_VERT_EOS, -1.0f, -1.0f, 1.0f, color, 1.0f, 0.0f); // Top Right Of The Texture and Quad + + // Front Face + plx_vert_ifdm3(&dr_state, PLX_VERT, -1.0f, 1.0f, 1.0f, color, 0.0f, 1.0f); // Bottom Left Of The Texture and Quad + plx_vert_ifdm3(&dr_state, PLX_VERT, -1.0f, -1.0f, 1.0f, color, 0.0f, 0.0f); // Top Left Of The Texture and Quad + plx_vert_ifdm3(&dr_state, PLX_VERT, 1.0f, 1.0f, 1.0f, color, 1.0f, 1.0f); // Bottom Right Of The Texture and Quad + plx_vert_ifdm3(&dr_state, PLX_VERT_EOS, 1.0f, -1.0f, 1.0f, color, 1.0f, 0.0f); // Top Right Of The Texture and Quad + + // Back Face + plx_vert_ifdm3(&dr_state, PLX_VERT, 1.0f, 1.0f, -1.0f, color, 0.0f, 1.0f); // Bottom Left Of The Texture and Quad + plx_vert_ifdm3(&dr_state, PLX_VERT, 1.0f, -1.0f, -1.0f, color, 0.0f, 0.0f); // Top Left Of The Texture and Quad + plx_vert_ifdm3(&dr_state, PLX_VERT, -1.0f, 1.0f, -1.0f, color, 1.0f, 1.0f); // Bottom Right Of The Texture and Quad + plx_vert_ifdm3(&dr_state, PLX_VERT_EOS, -1.0f, -1.0f, -1.0f, color, 1.0f, 0.0f);// Top Right Of The Texture and Quad + + // Right Face + plx_vert_ifdm3(&dr_state, PLX_VERT, 1.0f, 1.0f, 1.0f, color, 0.0f, 1.0f); // Bottom Left Of The Texture and Quad + plx_vert_ifdm3(&dr_state, PLX_VERT, 1.0f, -1.0f, 1.0f, color, 0.0f, 0.0f); // Top Left Of The Texture and Quad + plx_vert_ifdm3(&dr_state, PLX_VERT, 1.0f, 1.0f, -1.0f, color, 1.0f, 1.0f); // Bottom Right Of The Texture and Quad + plx_vert_ifdm3(&dr_state, PLX_VERT_EOS, 1.0f, -1.0f, -1.0f, color, 1.0f, 0.0f); // Top Right Of The Texture and Quad + + // Left Face + plx_vert_ifdm3(&dr_state, PLX_VERT, -1.0f, 1.0f, -1.0f, color, 0.0f, 1.0f); // Bottom Left Of The Texture and Quad + plx_vert_ifdm3(&dr_state, PLX_VERT, -1.0f, -1.0f, -1.0f, color, 0.0f, 0.0f); // Top Left Of The Texture and Quad + plx_vert_ifdm3(&dr_state, PLX_VERT, -1.0f, 1.0f, 1.0f, color, 1.0f, 1.0f); // Bottom Right Of The Texture and Quad + plx_vert_ifdm3(&dr_state, PLX_VERT_EOS, -1.0f, -1.0f, 1.0f, color, 1.0f, 0.0f); // Top Right Of The Texture and Quad + + color = plx_pack_color(topcol[yloop-1][0], topcol[yloop-1][1], topcol[yloop-1][2], topcol[yloop-1][3]); + + // Top Face + plx_vert_ifdm3(&dr_state, PLX_VERT, -1.0f, 1.0f, -1.0f, color, 0.0f, 1.0f); // Bottom Left Of The Texture and Quad + plx_vert_ifdm3(&dr_state, PLX_VERT, -1.0f, 1.0f, 1.0f, color, 0.0f, 0.0f); // Top Left Of The Texture and Quad + plx_vert_ifdm3(&dr_state, PLX_VERT, 1.0f, 1.0f, -1.0f, color, 1.0f, 1.0f); // Bottom Right Of The Texture and Quad + plx_vert_ifdm3(&dr_state, PLX_VERT_EOS, 1.0f, 1.0f, 1.0f, color, 1.0f, 0.0f); // Top Right Of The Texture and Quad + + } + } + pvr_scene_finish(); + } + // Clean up!!! + plx_txr_destroy(a_texture); + + return 0; +} + diff --git a/POWERVR/SRCS/NeHe/Lesson11/romdisk/Thumbs.db b/POWERVR/SRCS/NeHe/Lesson11/romdisk/Thumbs.db new file mode 100644 index 00000000..8d279707 Binary files /dev/null and b/POWERVR/SRCS/NeHe/Lesson11/romdisk/Thumbs.db differ diff --git a/POWERVR/SRCS/NeHe/Lesson11/romdisk/cube.png b/POWERVR/SRCS/NeHe/Lesson11/romdisk/cube.png new file mode 100644 index 00000000..9f4df428 Binary files /dev/null and b/POWERVR/SRCS/NeHe/Lesson11/romdisk/cube.png differ diff --git a/POWERVR/SRCS/NeHe/Lesson15/Makefile b/POWERVR/SRCS/NeHe/Lesson15/Makefile new file mode 100644 index 00000000..bdcafa96 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson15/Makefile @@ -0,0 +1 @@ +include Makefile.dc \ No newline at end of file diff --git a/POWERVR/SRCS/NeHe/Lesson15/Makefile.dc b/POWERVR/SRCS/NeHe/Lesson15/Makefile.dc new file mode 100644 index 00000000..ef144212 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson15/Makefile.dc @@ -0,0 +1,32 @@ +# +# PLX Lesson 15 +# +# + +TARGET = dcp.elf +OBJS = main.o + +all: rm-elf $(TARGET) + +include $(KOS_BASE)/Makefile.rules + +clean: + -rm -f $(TARGET) $(OBJS) romdisk.* +rm-elf: + -rm -f $(TARGET) romdisk.* + +$(TARGET): $(OBJS) romdisk.o + kos-c++ -o $(TARGET) $(OBJS)romdisk.o -lparallax -lpng -ljpeg -lkmg -lz -lkosutils -lm + +romdisk.img: + $(KOS_GENROMFS) -f romdisk.img -d romdisk -v + +romdisk.o: romdisk.img + $(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o + +run: $(TARGET) + $(KOS_LOADER) $(TARGET) + +dist: + rm -f $(OBJS) romdisk.o romdisk.img + $(KOS_STRIP) $(TARGET) diff --git a/POWERVR/SRCS/NeHe/Lesson15/main.c b/POWERVR/SRCS/NeHe/Lesson15/main.c new file mode 100644 index 00000000..55bb09d5 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson15/main.c @@ -0,0 +1,225 @@ + + +#include +#include +#include +#include +#include + +extern uint8 romdisk[]; +KOS_INIT_FLAGS(INIT_DEFAULT | INIT_MALLOCSTATS); +KOS_INIT_ROMDISK(romdisk); + +void printControls() { + printf("\n/**********Controls**********/\n"); + printf("START-Button: Exits program \n"); + printf("X-Button: Change Fog Type \n"); + printf("Y-Button: Toggle Fog ON/OFF \n"); + printf("A-Button: Move the cube into the distance \n"); + printf("B-Button: Move the cube closer \n"); + + printf("UP-Dir: Decrease the cube's x rotation speed \n"); + printf("DOWN-Dir: Increase the cube's x rotation speed \n"); + printf("LEFT-Dir: Decrease the cube's y rotation speed \n"); + printf("RIGHT-Dir: Increase the cube's y rotation speed \n"); + printf("/****************************/\n\n"); +} + +static float xrot; /* X Rotation */ +static float yrot; /* Y Rotation */ +static float xspeed; /* X Rotation Speed */ +static float yspeed; /* Y Rotation Speed */ +static float z = -5.0f; /* Depth Into The Screen */ + +/* Storage For Three Types Of Fog */ +int fogType = 0; /* use PLX_EXP initially */ +enum fogmodes { PLX_EXP = 0, PLX_EXP2, PLX_LINEAR }; +int fogMode[] = { PLX_EXP, PLX_EXP2, PLX_LINEAR }; +float fogColor[4] = { 1.0, 0.5f, 0.5f, 0.5f }; /* Fog Color */ +int fog = 0; + +/** + Like plx_vert_ifdm3, but uses plx_prim. + */ +static inline void plx_vert_ifpm3(int flags, float x, float y, float z, uint32 color, float u, float v) { + plx_mat_tfip_3d(x, y, z); + plx_vert_ifp(flags, x, y, z, color, u, v); +} + +pvr_init_params_t params = { + /* Enable opaque and translucent polygons with size 16 */ + { PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_0 }, + + /* Vertex buffer size 512K */ + 512*1024 +}; + +int main(int argc, char **argv) { + + /* Controller Stuff */ + maple_device_t * dev; + cont_state_t * state; + int xp = 0; + int yp = 0; + + uint32 color = plx_pack_color(1.0f, 1.0f, 1.0f, 1.0f); + plx_texture_t *a_texture; + + /* Init PVR API */ + if (pvr_init(¶ms) < 0) + return -1; + + printControls(); + + /* Sets the background color to the color of the fog (GRAY) */ + pvr_set_bg_color(0.5f, 0.5f, 0.5f); + + /* Set up the fog */ + pvr_fog_table_color(fogColor[0], fogColor[1], fogColor[2], fogColor[3]); /* Set Fog Color */ + pvr_fog_far_depth(5.0f); + pvr_fog_table_exp(0.35f); /* Use PLX_EXP Initially */ + + /* Load the texture */ + a_texture = plx_txr_load("/rd/crate.png", 0, PVR_TXRLOAD_16BPP); + plx_txr_setfilter(a_texture, PLX_FILTER_BILINEAR); // Use Bilinear filtering + + plx_cxt_init(); // Initialize the plx context system + plx_cxt_texture(a_texture); // Texture 'a_texture' will be used with the context system + plx_cxt_culling(PLX_CULL_NONE); // No Culling + + // GET SOME 3D GOING!! + plx_mat3d_init(); /* Clear internal to an identity matrix */ + plx_mat3d_mode(PLX_MAT_PROJECTION); /** Projection (frustum, screenview) matrix */ + plx_mat3d_identity(); /** Load an identity matrix */ + plx_mat3d_perspective(45.0f, 640.0f / 480.0f, 0.1f, 100.0f); // (float angle, float aspect, float znear, float zfar); + plx_mat3d_mode(PLX_MAT_MODELVIEW); /** Modelview (rotate, scale) matrix */ + + while(1) { + + /* Check key status */ + dev = maple_enum_dev(0, 0); + if(dev == NULL) { + printf("Error: Could not find controller in first port.\n"); + break; + } + state = (cont_state_t *)maple_dev_status(dev); + if (state->buttons & CONT_START) { + break; // exit the program + } + if (state->buttons & CONT_A) { + if (z >= -15.0f) z -= 0.02f; // move the cube into the distance. + } + if (state->buttons & CONT_B) { + if (z <= 0.0f) z += 0.02f; // move the cube closer. + } + if ((state->buttons & CONT_X) && !xp) { + xp = 1; + fogType = ( ++fogType ) % 3; // change fog type + switch (fogMode[fogType]) { + case PLX_EXP: + pvr_fog_table_exp(0.35f); + break; + case PLX_EXP2: + pvr_fog_table_exp2(0.35f); + break; + case PLX_LINEAR: + pvr_fog_table_linear(0.0f, 5.0f); + break; + } + } + if (!(state->buttons & CONT_X)) { + xp = 0; + } + if ((state->buttons & CONT_Y) && !yp) { + yp = 1; + fog = !fog; // Toggle Fog ON/OFF + } + if (!(state->buttons & CONT_Y)) { + yp = 0; + } + if (state->buttons & CONT_DPAD_UP) { + xspeed -= 0.01f; // decrease x rotation speed + } + if (state->buttons & CONT_DPAD_DOWN) { + xspeed += 0.01f; // increase x rotation speed + } + if (state->buttons & CONT_DPAD_LEFT) { + yspeed -= 0.01f; // decrease y rotation speed + } + if (state->buttons & CONT_DPAD_RIGHT) { + yspeed += 0.01f; // increase y rotation speed + } + + /* Switch fog off/on */ + if (fog) { + plx_cxt_fog(PLX_FOG_TABLE); + } else { + plx_cxt_fog(PLX_FOG_NONE); + } + + pvr_wait_ready(); + pvr_scene_begin(); + pvr_list_begin(PVR_LIST_TR_POLY); + + // Submit the context + plx_cxt_send(PVR_LIST_TR_POLY); // Submit the Header for PVR_LIST_TR_POLY + + // DRAW THE CUBE + plx_mat3d_identity(); + plx_mat3d_translate(0.0f, 0.0f, z); // Move Z units into/outof the screen + plx_mat3d_rotate(xrot, 1.0f, 0.0f, 0.0f); // Rotate the Cube by angle 'xrot' on the X axis + plx_mat3d_rotate(yrot, 0.0f, 1.0f, 0.0f); // Rotate the Cube by angle 'yrot' on the Y axis + + /* Clear internal to an identity matrix */ + plx_mat_identity(); + + /* "Applying" all matrixs: multiply a matrix onto the "internal" one */ + plx_mat3d_apply_all(); + + // Top Face of Cube + plx_vert_ifpm3(PLX_VERT, -1, 1, 1, color, 0, 1); // Bottom Left Of The Quad (Top) + plx_vert_ifpm3(PLX_VERT, -1, 1, -1, color, 0, 0); // Top Left Of The Quad (Top) + plx_vert_ifpm3(PLX_VERT, 1, 1, 1, color, 1, 1); // Bottom Right Of The Quad (Top) + plx_vert_ifpm3(PLX_VERT_EOS, 1, 1, -1, color, 1, 0); // Top Right Of The Quad (Top) + + // Bottom Face of Cube + plx_vert_ifpm3(PLX_VERT, -1, -1, -1, color, 0, 1); // Bottom Left Of The Quad (Bottom) + plx_vert_ifpm3(PLX_VERT, -1, -1, 1, color, 0, 0); // Top Left Of The Quad (Bottom) + plx_vert_ifpm3(PLX_VERT, 1, -1, -1, color, 1, 1); // Bottom Right Of The Quad (Bottom) + plx_vert_ifpm3(PLX_VERT_EOS, 1, -1, 1, color, 1, 0); // Top Right Of The Quad (Bottom) + + // Front Face of Cube + plx_vert_ifpm3(PLX_VERT, -1, -1, 1, color, 0, 1); // Bottom Left Of The Quad (Front) + plx_vert_ifpm3(PLX_VERT, -1, 1, 1, color, 0, 0); // Top Left Of The Quad (Front) + plx_vert_ifpm3(PLX_VERT, 1, -1, 1, color, 1, 1); // Bottom Right Of The Quad (Front) + plx_vert_ifpm3(PLX_VERT_EOS, 1, 1, 1, color, 1, 0); // Top Right Of The Quad (Front) + + // Back Face of Cube + plx_vert_ifpm3(PLX_VERT, -1, 1, -1, color, 0, 1); // Bottom Left Of The Quad (Back) + plx_vert_ifpm3(PLX_VERT, -1, -1, -1, color, 0, 0); // Top Left Of The Quad (Back) + plx_vert_ifpm3(PLX_VERT, 1, 1, -1, color, 1, 1); // Bottom Right Of The Quad (Back) + plx_vert_ifpm3(PLX_VERT_EOS, 1, -1, -1, color, 1, 0);// Top Right Of The Quad (Back) + + // Left Face of Cube + plx_vert_ifpm3(PLX_VERT, -1, -1, -1, color, 0, 1); // Bottom Left Of The Quad (Left) + plx_vert_ifpm3(PLX_VERT, -1, 1, -1, color, 0, 0); // Top Left Of The Quad (Left) + plx_vert_ifpm3(PLX_VERT, -1, -1, 1, color, 1, 1); // Bottom Right Of The Quad (Left) + plx_vert_ifpm3(PLX_VERT_EOS, -1, 1, 1, color, 1, 0); // Top Right Of The Quad (Left) + + // Right Face of Cube + plx_vert_ifpm3(PLX_VERT, 1, -1, 1, color, 0, 1); // Bottom Left Of The Quad (Right) + plx_vert_ifpm3(PLX_VERT, 1, 1, 1, color, 0, 0); // Top Left Of The Quad (Right) + plx_vert_ifpm3(PLX_VERT, 1, -1, -1, color, 1, 1); // Bottom Right Of The Quad (Right) + plx_vert_ifpm3(PLX_VERT_EOS, 1, 1, -1, color, 1, 0); // Top Right Of The Quad (Right) + + pvr_scene_finish(); + + xrot += xspeed; // X Axis Rotation + yrot += yspeed; // Y Axis Rotation + } + // Clean up!!! + plx_txr_destroy(a_texture); + + return 0; +} + diff --git a/POWERVR/SRCS/NeHe/Lesson15/romdisk/Thumbs.db b/POWERVR/SRCS/NeHe/Lesson15/romdisk/Thumbs.db new file mode 100644 index 00000000..fc306e8e Binary files /dev/null and b/POWERVR/SRCS/NeHe/Lesson15/romdisk/Thumbs.db differ diff --git a/POWERVR/SRCS/NeHe/Lesson15/romdisk/crate.png b/POWERVR/SRCS/NeHe/Lesson15/romdisk/crate.png new file mode 100644 index 00000000..e2ee71b4 Binary files /dev/null and b/POWERVR/SRCS/NeHe/Lesson15/romdisk/crate.png differ diff --git a/POWERVR/SRCS/NeHe/Lesson16/Makefile b/POWERVR/SRCS/NeHe/Lesson16/Makefile new file mode 100644 index 00000000..bdcafa96 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson16/Makefile @@ -0,0 +1 @@ +include Makefile.dc \ No newline at end of file diff --git a/POWERVR/SRCS/NeHe/Lesson16/Makefile.dc b/POWERVR/SRCS/NeHe/Lesson16/Makefile.dc new file mode 100644 index 00000000..346af282 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson16/Makefile.dc @@ -0,0 +1,32 @@ +# +# PLX Lesson 16 +# +# + +TARGET = dcp.elf +OBJS = main.o + +all: rm-elf $(TARGET) + +include $(KOS_BASE)/Makefile.rules + +clean: + -rm -f $(TARGET) $(OBJS) romdisk.* +rm-elf: + -rm -f $(TARGET) romdisk.* + +$(TARGET): $(OBJS) romdisk.o + kos-c++ -o $(TARGET) $(OBJS)romdisk.o -lparallax -lpng -ljpeg -lkmg -lz -lkosutils -lm + +romdisk.img: + $(KOS_GENROMFS) -f romdisk.img -d romdisk -v + +romdisk.o: romdisk.img + $(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o + +run: $(TARGET) + $(KOS_LOADER) $(TARGET) + +dist: + rm -f $(OBJS) romdisk.o romdisk.img + $(KOS_STRIP) $(TARGET) diff --git a/POWERVR/SRCS/NeHe/Lesson16/main.c b/POWERVR/SRCS/NeHe/Lesson16/main.c new file mode 100644 index 00000000..edf60820 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson16/main.c @@ -0,0 +1,267 @@ + + +#include +#include +#include +#include +#include + +extern uint8 romdisk[]; +KOS_INIT_FLAGS(INIT_DEFAULT | INIT_MALLOCSTATS); +KOS_INIT_ROMDISK(romdisk); + +void printControls() { + printf("\n/**********Controls**********/\n"); + printf("START-Button: Exits program\n"); + printf("X-Button: NONE \n"); + printf("Y-Button: NONE \n"); + printf("A-Button: NONE \n"); + printf("B-Button: NONE \n"); + + printf("UP-Dir: NONE \n"); + printf("DOWN-Dir: NONE \n"); + printf("LEFT-Dir: NONE \n"); + printf("RIGHT-Dir: NONE \n"); + printf("/****************************/\n\n"); +} + +plx_texture_t *textures[2]; /* Holds two textures */ + +/* Has all the characters that are available to draw from the font.png image */ +const char fontstr[] = " ! #$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_` abcdefghijklmnopqrstuvwxyz{|}~ ÇüéâäàåçêëïîìÄÂÉæÆôöòûùÿÖÜø£Ø׃"; + +/* Draws a specified area of a texture, to act like a tileset */ +/* Taken and modified from a post of JS Lemming: http://dcemulation.org/phpBB/viewtopic.php?p=736314#p736314 */ +void DrawTile(plx_texture_t *Image, int x, int y, int tile_width, int tile_height, uint32 color, int index) { + + pvr_poly_cxt_t cxt; + pvr_poly_hdr_t hdr; + pvr_vertex_t vert; + + float inc_x = ((float)(tile_width) / (float)(Image->w)); + float inc_y = ((float)(tile_height) / (float)(Image->h)); + + float index_x; + float index_y = 1.0f; + int tiles_wide = (Image->w / tile_width); + + //Convert the index into a coordinate index_x and index_y + while(index >= tiles_wide * index_y) + { + index_y++; + } + index_y--; + index_x = index - (tiles_wide*index_y); + + pvr_poly_cxt_txr(&cxt, PVR_LIST_TR_POLY, PVR_TXRFMT_ARGB1555, Image->w, Image->h, Image->ptr, PVR_FILTER_NONE); + pvr_poly_compile(&hdr,&cxt); + pvr_prim(&hdr,sizeof(hdr)); + + vert.argb = color; + vert.oargb = 0; + + vert.flags = PVR_CMD_VERTEX; + vert.x = x; + vert.y = y; + vert.z = 1; //z + vert.u = index_x*inc_x; + vert.v = index_y*inc_y; + pvr_prim(&vert,sizeof(vert)); + + vert.x = x + tile_width; + vert.y = y; + vert.u = index_x*inc_x+inc_x; + pvr_prim(&vert,sizeof(vert)); + + vert.x = x; + vert.y = y + tile_height; + vert.u = index_x*inc_x; + vert.v = index_y*inc_y+inc_y; + pvr_prim(&vert,sizeof(vert)); + + vert.x = x + tile_width; + vert.y = y + tile_height; + vert.u = index_x*inc_x+inc_x; + vert.flags = PVR_CMD_VERTEX_EOL; + pvr_prim(&vert, sizeof(vert)); +} + +/* Where The Printing Happens */ +/* Taken and modified from Cool Herders (font.c). Full source can be found here: http://www.boob.co.uk/games.html */ +void TextPrint( int x, int y, const char *string, uint32 color, int set) { + + int x_sub = x; /* Where on the screen to draw the string(X-Coordinate) */ + int y_sub = y; /* Where on the screen to draw the string(Y-Coordinate) */ + int index; /* Used to tell the DrawTile() which area of the image to draw */ + char *ptr = NULL; + + while (*string) { + if(set) { + index = 128; /* Using second set of fonts*/ + } else { + index = 0; /* Using first set of fonts */ + } + + ptr = fontstr; /* Set pointer equal to the avaiable characters in the font */ + + while (*ptr) { /* While going through the available characters */ + if (*ptr == *string) { /* Check if any match a character in the string */ + break; /* Found one. Leave the while loop to go draw it */ + } + ptr++; /* Go to the next available character */ + index++; /* Incrementing to the next space in the image */ + } + + if (*ptr) { + DrawTile(textures[1], x_sub, y_sub, 16.0f, 16.0f, color, index); /* Draw the character */ + } + + string++; /* Go to the next character in the string */ + x_sub += 11.0f; /* Increase the x parameter so a string of letters can be drawn next to each */ + /* other and not on top of each other */ + } +} + +/** + Like plx_vert_ifdm3, but uses plx_prim. + */ +static inline void plx_vert_ifpm3(int flags, float x, float y, float z, uint32 color, float u, float v) { + plx_mat_tfip_3d(x, y, z); + plx_vert_ifp(flags, x, y, z, color, u, v); +} + +pvr_init_params_t params = { + /* Enable opaque and translucent polygons with size 16 */ + { PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_0 }, + + /* Vertex buffer size 512K */ + 512*1024 +}; + +int main(int argc, char **argv) { + + float cnt1; /* 1st Counter Used To Move Text & For Coloring */ + float cnt2; /* 2nd Counter Used To Move Text & For Coloring */ + + /* Controller Stuff */ + maple_device_t * dev; + cont_state_t * state; + + uint32 color = 0; + + /* Init PVR API */ + if (pvr_init(¶ms) < 0) + return -1; + + printControls(); + + /* Sets the background color to black */ + pvr_set_bg_color(0.0f, 0.0f, 0.0f); + + /* Load the textures */ + textures[0] = plx_txr_load("/rd/bumps.png", 0, PVR_TXRLOAD_16BPP); + textures[1] = plx_txr_load("/rd/font.png", 1, PVR_TXRLOAD_16BPP); + plx_txr_setfilter(textures[0], PLX_FILTER_BILINEAR); // Use Bilinear filtering for the first texture + + plx_cxt_init(); // Initialize the plx context system + plx_cxt_culling(PLX_CULL_NONE); // No Culling + + plx_mat3d_init(); /* Clear internal to an identity matrix */ + plx_mat3d_mode(PLX_MAT_PROJECTION); /** Projection (frustum, screenview) matrix */ + plx_mat3d_identity(); /** Load an identity matrix */ + plx_mat3d_perspective(45.0f, 640.0f / 480.0f, 0.1f, 100.0f); // (float angle, float aspect, float znear, float zfar); + plx_mat3d_mode(PLX_MAT_MODELVIEW); /** Modelview (rotate, scale) matrix */ + + while(1) { + + /* Check key status */ + dev = maple_enum_dev(0, 0); + if(dev == NULL) { + printf("Error: Could not find controller in first port.\n"); + break; + } + state = (cont_state_t *)maple_dev_status(dev); + if (state->buttons & CONT_START) { + break; // exit the program + } + + pvr_wait_ready(); + pvr_scene_begin(); + pvr_list_begin(PVR_LIST_OP_POLY); + + // Select the texture + plx_cxt_texture(textures[0]); + + // Submit the context + plx_cxt_send(PVR_LIST_OP_POLY); + + // Draw QAUD 1 + plx_mat3d_identity(); + plx_mat3d_translate(0.0f, 0.0f, -5.0f); // Move 5 units into the screen + plx_mat3d_rotate(45.0f, 0.0f, 0.0f, 1.0f); // Rotate the quad 45 degrees on the Z-axis + plx_mat3d_rotate(cnt1*30.0f, 1.0f, 1.0f, 0.0f); // Rotate the quad cnt1*30.0f degress on the X&Y-Axis + + /* Clear internal to an identity matrix */ + plx_mat_identity(); + + /* "Applying" all matrixs: multiply a matrix onto the "internal" one */ + plx_mat3d_apply_all(); + + color = plx_pack_color(1.0f, 1.0f, 1.0f, 1.0f); + + // Draw the first Quad + plx_vert_ifpm3(PLX_VERT, -1.0f, -1.0f, 0, color, 0, 1); + plx_vert_ifpm3(PLX_VERT, -1.0f, 1.0f, 0, color, 0, 0); + plx_vert_ifpm3(PLX_VERT, 1.0f, -1.0f, 0, color, 1, 1); + plx_vert_ifpm3(PLX_VERT_EOS, 1.0f, 1.0f, 0, color, 1, 0); + + // Draw QAUD 2 + plx_mat3d_identity(); + plx_mat3d_translate(0.0f, 0.0f, -5.0f); // Move 5 units into the screen + plx_mat3d_rotate(45.0f, 0.0f, 0.0f, 1.0f); // Rotate the quad 45 degrees on the Z-axis + plx_mat3d_rotate((cnt1*30.0f)+90.0f, 1.0f, 1.0f, 0.0f); // Rotate the quad cnt1*30.0f+90 degress on the X&Y-Axis + + /* Clear internal to an identity matrix */ + plx_mat_identity(); + + /* "Applying" all matrixs: multiply a matrix onto the "internal" one */ + plx_mat3d_apply_all(); + + // Draw the second Quad perpendicular to the first + plx_vert_ifpm3(PLX_VERT, -1.0f, -1.0f, 0, color, 0, 1); + plx_vert_ifpm3(PLX_VERT, -1.0f, 1.0f, 0, color, 0, 0); + plx_vert_ifpm3(PLX_VERT, 1.0f, -1.0f, 0, color, 1, 1); + plx_vert_ifpm3(PLX_VERT_EOS, 1.0f, 1.0f, 0, color, 1, 0); + + pvr_list_finish(); + + pvr_list_begin(PVR_LIST_TR_POLY); + + // Draw the Bitmap Font + + /* Pulsing Colors Based On Text Position */ + color = plx_pack_color(1.0f, 1.0f*(float)(fcos(cnt1)), 1.0f*(float)(fsin(cnt2)), 1.0f-0.5f*(float)(fcos(cnt1+cnt2))); + TextPrint((int)((280+250*fcos(cnt1))), (int)(235+200*fsin(cnt2)), "Dreamcast", color, 0); + + color = plx_pack_color(1.0f, 1.0f*(float)(fsin(cnt2)),1.0f-0.5f*(float)(fcos(cnt1+cnt2)), 1.0f*(float)(fcos(cnt1))); + TextPrint((int)((280+230*fcos(cnt2))), (int)(235+200*fsin(cnt1)), "Parallax", color, 1); + + color = plx_pack_color(1.0f, 0.0f, 0.0f, 1.0f); + TextPrint((int)(240+85*fcos((cnt2+cnt1)/5)), 446, "Baby Bonnie Hood", color, 0); + + color = plx_pack_color(1.0f, 1.0f, 1.0f, 1.0f); + TextPrint((int)(242+85*fcos((cnt2+cnt1)/5)), 446, "Baby Bonnie Hood", color, 0); + + pvr_scene_finish(); + + cnt1 += 0.01f; /* Increase The First Counter */ + cnt2 += 0.0081f; /* Increase The Second Counter */ + + } + // Clean up!!! + plx_txr_destroy(textures[0]); + plx_txr_destroy(textures[1]); + + return 0; +} + diff --git a/POWERVR/SRCS/NeHe/Lesson16/romdisk/Thumbs.db b/POWERVR/SRCS/NeHe/Lesson16/romdisk/Thumbs.db new file mode 100644 index 00000000..a9fb302d Binary files /dev/null and b/POWERVR/SRCS/NeHe/Lesson16/romdisk/Thumbs.db differ diff --git a/POWERVR/SRCS/NeHe/Lesson16/romdisk/bumps.png b/POWERVR/SRCS/NeHe/Lesson16/romdisk/bumps.png new file mode 100644 index 00000000..395b2813 Binary files /dev/null and b/POWERVR/SRCS/NeHe/Lesson16/romdisk/bumps.png differ diff --git a/POWERVR/SRCS/NeHe/Lesson16/romdisk/font.png b/POWERVR/SRCS/NeHe/Lesson16/romdisk/font.png new file mode 100644 index 00000000..e7e6dc9b Binary files /dev/null and b/POWERVR/SRCS/NeHe/Lesson16/romdisk/font.png differ diff --git a/POWERVR/SRCS/NeHe/Lesson2/Makefile b/POWERVR/SRCS/NeHe/Lesson2/Makefile new file mode 100644 index 00000000..bdcafa96 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson2/Makefile @@ -0,0 +1 @@ +include Makefile.dc \ No newline at end of file diff --git a/POWERVR/SRCS/NeHe/Lesson2/Makefile.dc b/POWERVR/SRCS/NeHe/Lesson2/Makefile.dc new file mode 100644 index 00000000..8480b698 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson2/Makefile.dc @@ -0,0 +1,31 @@ +# +# PLX Lesson 2 +# +# + +TARGET = dcp.elf +OBJS = main.o + +all: rm-elf $(TARGET) + +include $(KOS_BASE)/Makefile.rules + +clean: + -rm -f $(TARGET) $(OBJS) +rm-elf: + -rm -f $(TARGET) +$(TARGET): $(OBJS) + kos-c++ -o $(TARGET) $(OBJS) -lparallax -lz -lkosutils -lm + +#romdisk.img: +# $(KOS_GENROMFS) -f romdisk.img -d romdisk -v + +#romdisk.o: romdisk.img +# $(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o + +run: $(TARGET) + $(KOS_LOADER) $(TARGET) + +dist: + rm -f $(OBJS) romdisk.o romdisk.img + $(KOS_STRIP) $(TARGET) diff --git a/POWERVR/SRCS/NeHe/Lesson2/main.c b/POWERVR/SRCS/NeHe/Lesson2/main.c new file mode 100644 index 00000000..599b3ea5 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson2/main.c @@ -0,0 +1,124 @@ + + +#include +#include +#include +#include + +KOS_INIT_FLAGS(INIT_DEFAULT | INIT_MALLOCSTATS); + +void printControls() { + printf("\n/**********Controls**********/\n"); + printf("START-Button: Exits program\n"); + printf("X-Button: NONE \n"); + printf("Y-Button: NONE \n"); + printf("A-Button: NONE \n"); + printf("B-Button: NONE \n"); + + printf("UP-Dir: NONE \n"); + printf("DOWN-Dir: NONE \n"); + printf("LEFT-Dir: NONE \n"); + printf("RIGHT-Dir: NONE \n"); + printf("/****************************/\n\n"); +} + +pvr_init_params_t params = { + /* Enable opaque and translucent polygons with size 16 */ + { PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_0 }, + + /* Vertex buffer size 512K */ + 512*1024 +}; + +int main(int argc, char **argv) { + + /* Controller Stuff */ + maple_device_t * dev; + cont_state_t * state; + + /* Init PVR API */ + if (pvr_init(¶ms) < 0) + return -1; + + printControls(); + + /* Sets the background color to black */ + pvr_set_bg_color(0.0f,0.0f,0.0f); + + plx_cxt_init(); // Initialize the plx context system + plx_cxt_texture(NULL); // No texture will be used + plx_cxt_culling(PLX_CULL_NONE); // No culling + + // GET SOME 3D GOING!! + /* Init matrices */ + plx_mat3d_init(); /* Clear internal to an identity matrix */ + plx_mat3d_mode(PLX_MAT_PROJECTION); /** Projection (frustum, screenview) matrix */ + plx_mat3d_identity(); /** Load an identity matrix */ + plx_mat3d_perspective(45.0f, 640.0f / 480.0f, 0.1f, 100.0f); // (float angle, float aspect, float znear, float zfar); + plx_mat3d_mode(PLX_MAT_MODELVIEW); /** Modelview (rotate, scale) matrix */ + + while(1) { + + // Check for the user pressing START + dev = maple_enum_dev(0, 0); + if(dev == NULL) { + printf("Error: Could not find controller in first port.\n"); + break; + } + state = (cont_state_t *)maple_dev_status(dev); + if (state->buttons & CONT_START) { + break; // exit the program + } + + pvr_wait_ready(); + pvr_scene_begin(); + pvr_list_begin(PVR_LIST_OP_POLY); + + // Submit the context + plx_cxt_send(PVR_LIST_OP_POLY); // Submit the Header for PVR_LIST_OP_POLY + + // DRAW THE TRIANGLE + plx_mat3d_identity(); + plx_mat3d_translate(-1.5f, 0.0f, -6.0f); // Move 1.5f units to the left and 6 units into the screen + + /* Clear internal to an identity matrix */ + plx_mat_identity(); + + /* "Apply" a matrix: multiply a matrix onto the "internal" one */ + plx_mat3d_apply(PLX_MAT_SCREENVIEW); /** Internal screen view matrix */ + plx_mat3d_apply(PLX_MAT_PROJECTION); /** Projection (frustum, screenview) matrix */ + plx_mat3d_apply(PLX_MAT_MODELVIEW); /** Modelview (rotate, scale) matrix */ + + // Could also use the following line instead of the above three lines + //plx_mat3d_apply_all(); + + plx_vert_inpm3(PLX_VERT, 0, 1, 0, plx_pack_color(1.0f, 1.0f, 0.0f, 0.0f)); // Top (Color = Red) + plx_vert_inpm3(PLX_VERT, -1, -1, 0, plx_pack_color(1.0f, 0.0f, 1.0f, 0.0f)); // Bottom Left (Color = Green) + plx_vert_inpm3(PLX_VERT_EOS, 1, -1, 0, plx_pack_color(1.0f, 0.0f, 0.0f, 1.0f)); // Bottom Right (Color = Blue) + + // DRAW THE QUAD + plx_mat3d_identity(); + plx_mat3d_translate(1.5f, 0.0f, -6.0f); // Move 1.5f units to the right and 6 units into the screen + + /* Clear internal to an identity matrix */ + plx_mat_identity(); + + /* "Apply" a matrix: multiply a matrix onto the "internal" one */ + plx_mat3d_apply(PLX_MAT_SCREENVIEW); /** Internal screen view matrix */ + plx_mat3d_apply(PLX_MAT_PROJECTION); /** Projection (frustum, screenview) matrix */ + plx_mat3d_apply(PLX_MAT_MODELVIEW); /** Modelview (rotate, scale) matrix */ + + // Could also use the following line instead of the above three lines + //plx_mat3d_apply_all(); + + plx_vert_inpm3(PLX_VERT, -1, 1, 0, plx_pack_color(1.0f, 0.5f, 0.5f, 1.0f)); // Bottom Left (Color = Bluish) + plx_vert_inpm3(PLX_VERT, -1, -1, 0, plx_pack_color(1.0f, 0.5f, 0.5f, 1.0f)); // Top Left (Color = Bluish) + plx_vert_inpm3(PLX_VERT, 1, 1, 0, plx_pack_color(1.0f, 0.5f, 0.5f, 1.0f)); // Bottom Right (Color = Bluish) + plx_vert_inpm3(PLX_VERT_EOS, 1, -1, 0, plx_pack_color(1.0f, 0.5f, 0.5f, 1.0f)); // Top Right (Color = Bluish) + + pvr_scene_finish(); + + } + + return 0; +} diff --git a/POWERVR/SRCS/NeHe/Lesson25/Makefile b/POWERVR/SRCS/NeHe/Lesson25/Makefile new file mode 100644 index 00000000..bdcafa96 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson25/Makefile @@ -0,0 +1 @@ +include Makefile.dc \ No newline at end of file diff --git a/POWERVR/SRCS/NeHe/Lesson25/Makefile.dc b/POWERVR/SRCS/NeHe/Lesson25/Makefile.dc new file mode 100644 index 00000000..303602d1 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson25/Makefile.dc @@ -0,0 +1,32 @@ +# +# PLX Lesson 25 +# +# + +TARGET = dcp.elf +OBJS = main.o + +all: rm-elf $(TARGET) + +include $(KOS_BASE)/Makefile.rules + +clean: + -rm -f $(TARGET) $(OBJS) romdisk.* +rm-elf: + -rm -f $(TARGET) romdisk.* + +$(TARGET): $(OBJS) romdisk.o + kos-c++ -o $(TARGET) $(OBJS)romdisk.o -lparallax -lpng -ljpeg -lkmg -lz -lkosutils -lm + +romdisk.img: + $(KOS_GENROMFS) -f romdisk.img -d romdisk -v + +romdisk.o: romdisk.img + $(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o + +run: $(TARGET) + $(KOS_LOADER) $(TARGET) + +dist: + rm -f $(OBJS) romdisk.o romdisk.img + $(KOS_STRIP) $(TARGET) diff --git a/POWERVR/SRCS/NeHe/Lesson25/data/Makefile b/POWERVR/SRCS/NeHe/Lesson25/data/Makefile new file mode 100644 index 00000000..7bc21de6 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson25/data/Makefile @@ -0,0 +1,13 @@ +# Kallistios - txt2bin Makefile +# +# (c)2002, Paul Boese +# +# $Id: Makefile,v 1.1 2002/02/23 05:20:36 axlen Exp $ + +CC = gcc -Wall + +all: + $(CC) -o txt2bin txt2bin.c + +clean: + @rm txt2bin *.bin diff --git a/POWERVR/SRCS/NeHe/Lesson25/data/sphere.txt b/POWERVR/SRCS/NeHe/Lesson25/data/sphere.txt new file mode 100644 index 00000000..dd3f9f73 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson25/data/sphere.txt @@ -0,0 +1,487 @@ +Vertices: 486 +-0.106 1.593 2.272 +-0.106 2.036 2.228 +-0.193 2.028 2.228 +-0.276 2.002 2.228 +-0.353 1.961 2.228 +-0.420 1.906 2.228 +-0.475 1.839 2.228 +-0.516 1.763 2.228 +-0.541 1.679 2.228 +-0.550 1.593 2.228 +-0.541 1.506 2.228 +-0.516 1.423 2.228 +-0.475 1.347 2.228 +-0.420 1.280 2.228 +-0.353 1.224 2.228 +-0.276 1.183 2.228 +-0.193 1.158 2.228 +-0.106 1.150 2.228 +-0.020 1.158 2.228 +0.063 1.183 2.228 +0.140 1.224 2.228 +0.207 1.280 2.228 +0.262 1.347 2.228 +0.303 1.423 2.228 +0.328 1.506 2.228 +0.337 1.593 2.228 +0.328 1.679 2.228 +0.303 1.763 2.228 +0.262 1.839 2.228 +0.207 1.906 2.228 +0.140 1.961 2.228 +0.063 2.002 2.228 +-0.020 2.028 2.228 +-0.106 2.462 2.099 +-0.276 2.446 2.099 +-0.439 2.396 2.099 +-0.589 2.316 2.099 +-0.721 2.208 2.099 +-0.829 2.076 2.099 +-0.910 1.926 2.099 +-0.959 1.763 2.099 +-0.976 1.593 2.099 +-0.959 1.423 2.099 +-0.910 1.260 2.099 +-0.829 1.110 2.099 +-0.721 0.978 2.099 +-0.589 0.870 2.099 +-0.439 0.790 2.099 +-0.276 0.740 2.099 +-0.106 0.724 2.099 +0.063 0.740 2.099 +0.226 0.790 2.099 +0.377 0.870 2.099 +0.508 0.978 2.099 +0.616 1.110 2.099 +0.697 1.260 2.099 +0.746 1.423 2.099 +0.763 1.593 2.099 +0.746 1.763 2.099 +0.697 1.926 2.099 +0.616 2.076 2.099 +0.508 2.208 2.099 +0.377 2.316 2.099 +0.226 2.396 2.099 +0.063 2.446 2.099 +-0.106 2.855 1.889 +-0.353 2.831 1.889 +-0.589 2.759 1.889 +-0.808 2.642 1.889 +-0.999 2.485 1.889 +-1.156 2.294 1.889 +-1.273 2.076 1.889 +-1.344 1.839 1.889 +-1.369 1.593 1.889 +-1.344 1.347 1.889 +-1.273 1.110 1.889 +-1.156 0.892 1.889 +-0.999 0.700 1.889 +-0.808 0.544 1.889 +-0.589 0.427 1.889 +-0.353 0.355 1.889 +-0.106 0.331 1.889 +0.140 0.355 1.889 +0.377 0.427 1.889 +0.595 0.544 1.889 +0.786 0.700 1.889 +0.943 0.892 1.889 +1.060 1.110 1.889 +1.131 1.347 1.889 +1.156 1.593 1.889 +1.131 1.839 1.889 +1.060 2.076 1.889 +0.943 2.294 1.889 +0.786 2.485 1.889 +0.595 2.642 1.889 +0.377 2.759 1.889 +0.140 2.831 1.889 +-0.106 3.199 1.606 +-0.420 3.168 1.606 +-0.721 3.077 1.606 +-0.999 2.929 1.606 +-1.242 2.729 1.606 +-1.442 2.485 1.606 +-1.591 2.208 1.606 +-1.682 1.906 1.606 +-1.713 1.593 1.606 +-1.682 1.280 1.606 +-1.591 0.978 1.606 +-1.442 0.700 1.606 +-1.242 0.457 1.606 +-0.999 0.257 1.606 +-0.721 0.109 1.606 +-0.420 0.017 1.606 +-0.106 -0.013 1.606 +0.207 0.017 1.606 +0.508 0.109 1.606 +0.786 0.257 1.606 +1.029 0.457 1.606 +1.229 0.700 1.606 +1.378 0.978 1.606 +1.469 1.280 1.606 +1.500 1.593 1.606 +1.469 1.906 1.606 +1.378 2.208 1.606 +1.229 2.485 1.606 +1.029 2.729 1.606 +0.786 2.929 1.606 +0.508 3.077 1.606 +0.207 3.168 1.606 +-0.106 3.482 1.262 +-0.475 3.446 1.262 +-0.829 3.338 1.262 +-1.156 3.164 1.262 +-1.442 2.929 1.262 +-1.677 2.642 1.262 +-1.852 2.316 1.262 +-1.959 1.961 1.262 +-1.995 1.593 1.262 +-1.959 1.224 1.262 +-1.852 0.870 1.262 +-1.677 0.544 1.262 +-1.442 0.257 1.262 +-1.156 0.022 1.262 +-0.829 -0.152 1.262 +-0.475 -0.260 1.262 +-0.106 -0.296 1.262 +0.262 -0.260 1.262 +0.616 -0.152 1.262 +0.943 0.022 1.262 +1.229 0.257 1.262 +1.464 0.544 1.262 +1.639 0.870 1.262 +1.746 1.224 1.262 +1.782 1.593 1.262 +1.746 1.961 1.262 +1.639 2.316 1.262 +1.464 2.642 1.262 +1.229 2.929 1.262 +0.943 3.164 1.262 +0.616 3.338 1.262 +0.262 3.446 1.262 +-0.106 3.692 0.869 +-0.516 3.651 0.869 +-0.910 3.532 0.869 +-1.273 3.338 0.869 +-1.591 3.077 0.869 +-1.852 2.759 0.869 +-2.046 2.396 0.869 +-2.165 2.002 0.869 +-2.205 1.593 0.869 +-2.165 1.183 0.869 +-2.046 0.790 0.869 +-1.852 0.427 0.869 +-1.591 0.109 0.869 +-1.273 -0.152 0.869 +-0.910 -0.346 0.869 +-0.516 -0.466 0.869 +-0.106 -0.506 0.869 +0.303 -0.466 0.869 +0.697 -0.346 0.869 +1.060 -0.152 0.869 +1.378 0.109 0.869 +1.639 0.427 0.869 +1.833 0.790 0.869 +1.952 1.183 0.869 +1.992 1.593 0.869 +1.952 2.002 0.869 +1.833 2.396 0.869 +1.639 2.759 0.869 +1.378 3.077 0.869 +1.060 3.338 0.869 +0.697 3.532 0.869 +0.303 3.651 0.869 +-0.106 3.821 0.443 +-0.541 3.778 0.443 +-0.959 3.651 0.443 +-1.344 3.446 0.443 +-1.682 3.168 0.443 +-1.959 2.831 0.443 +-2.165 2.446 0.443 +-2.292 2.028 0.443 +-2.335 1.593 0.443 +-2.292 1.158 0.443 +-2.165 0.740 0.443 +-1.959 0.355 0.443 +-1.682 0.017 0.443 +-1.344 -0.260 0.443 +-0.959 -0.466 0.443 +-0.541 -0.592 0.443 +-0.106 -0.635 0.443 +0.328 -0.592 0.443 +0.746 -0.466 0.443 +1.131 -0.260 0.443 +1.469 0.017 0.443 +1.746 0.355 0.443 +1.952 0.740 0.443 +2.079 1.158 0.443 +2.122 1.593 0.443 +2.079 2.028 0.443 +1.952 2.446 0.443 +1.746 2.831 0.443 +1.469 3.168 0.443 +1.131 3.446 0.443 +0.746 3.651 0.443 +0.328 3.778 0.443 +-0.106 3.865 -0.000 +-0.550 3.821 -0.000 +-0.976 3.692 -0.000 +-1.369 3.482 -0.000 +-1.713 3.199 -0.000 +-1.995 2.855 -0.000 +-2.205 2.462 -0.000 +-2.335 2.036 -0.000 +-2.378 1.593 -0.000 +-2.335 1.150 -0.000 +-2.205 0.724 -0.000 +-1.995 0.331 -0.000 +-1.713 -0.013 -0.000 +-1.369 -0.296 -0.000 +-0.976 -0.506 -0.000 +-0.550 -0.635 -0.000 +-0.106 -0.679 -0.000 +0.337 -0.635 -0.000 +0.763 -0.506 -0.000 +1.156 -0.296 -0.000 +1.500 -0.013 -0.000 +1.782 0.331 -0.000 +1.992 0.724 -0.000 +2.122 1.150 -0.000 +2.165 1.593 -0.000 +2.122 2.036 -0.000 +1.992 2.462 -0.000 +1.782 2.855 -0.000 +1.500 3.199 -0.000 +1.156 3.482 -0.000 +0.763 3.692 -0.000 +0.337 3.821 -0.000 +-0.106 3.821 -0.443 +-0.541 3.778 -0.443 +-0.959 3.651 -0.443 +-1.344 3.446 -0.443 +-1.682 3.168 -0.443 +-1.959 2.831 -0.443 +-2.165 2.446 -0.443 +-2.292 2.028 -0.443 +-2.335 1.593 -0.443 +-2.292 1.158 -0.443 +-2.165 0.740 -0.443 +-1.959 0.355 -0.443 +-1.682 0.017 -0.443 +-1.344 -0.260 -0.443 +-0.959 -0.466 -0.443 +-0.541 -0.592 -0.443 +-0.106 -0.635 -0.443 +0.328 -0.592 -0.443 +0.746 -0.466 -0.443 +1.131 -0.260 -0.443 +1.469 0.017 -0.443 +1.746 0.355 -0.443 +1.952 0.740 -0.443 +2.079 1.158 -0.443 +2.122 1.593 -0.443 +2.079 2.028 -0.443 +1.952 2.446 -0.443 +1.746 2.831 -0.443 +1.469 3.168 -0.443 +1.131 3.446 -0.443 +0.746 3.651 -0.443 +0.328 3.778 -0.443 +-0.106 3.692 -0.869 +-0.516 3.651 -0.869 +-0.910 3.532 -0.869 +-1.273 3.338 -0.869 +-1.591 3.077 -0.869 +-1.852 2.759 -0.869 +-2.046 2.396 -0.869 +-2.165 2.002 -0.869 +-2.205 1.593 -0.869 +-2.165 1.183 -0.869 +-2.046 0.790 -0.869 +-1.852 0.427 -0.869 +-1.591 0.109 -0.869 +-1.273 -0.152 -0.869 +-0.910 -0.346 -0.869 +-0.516 -0.466 -0.869 +-0.106 -0.506 -0.869 +0.303 -0.466 -0.869 +0.697 -0.346 -0.869 +1.060 -0.152 -0.869 +1.378 0.109 -0.869 +1.639 0.427 -0.869 +1.833 0.790 -0.869 +1.952 1.183 -0.869 +1.992 1.593 -0.869 +1.952 2.002 -0.869 +1.833 2.396 -0.869 +1.639 2.759 -0.869 +1.378 3.077 -0.869 +1.060 3.338 -0.869 +0.697 3.532 -0.869 +0.303 3.651 -0.869 +-0.106 3.482 -1.262 +-0.475 3.446 -1.262 +-0.829 3.338 -1.262 +-1.156 3.164 -1.262 +-1.442 2.929 -1.262 +-1.677 2.642 -1.262 +-1.852 2.316 -1.262 +-1.959 1.961 -1.262 +-1.995 1.593 -1.262 +-1.959 1.224 -1.262 +-1.852 0.870 -1.262 +-1.677 0.544 -1.262 +-1.442 0.257 -1.262 +-1.156 0.022 -1.262 +-0.829 -0.152 -1.262 +-0.475 -0.260 -1.262 +-0.106 -0.296 -1.262 +0.262 -0.260 -1.262 +0.616 -0.152 -1.262 +0.943 0.022 -1.262 +1.229 0.257 -1.262 +1.464 0.544 -1.262 +1.639 0.870 -1.262 +1.746 1.224 -1.262 +1.782 1.593 -1.262 +1.746 1.961 -1.262 +1.639 2.316 -1.262 +1.464 2.642 -1.262 +1.229 2.929 -1.262 +0.943 3.164 -1.262 +0.616 3.338 -1.262 +0.262 3.446 -1.262 +-0.106 3.199 -1.606 +-0.420 3.168 -1.606 +-0.721 3.077 -1.606 +-0.999 2.929 -1.606 +-1.242 2.729 -1.606 +-1.442 2.485 -1.606 +-1.591 2.208 -1.606 +-1.682 1.906 -1.606 +-1.713 1.593 -1.606 +-1.682 1.280 -1.606 +-1.591 0.978 -1.606 +-1.442 0.700 -1.606 +-1.242 0.457 -1.606 +-0.999 0.257 -1.606 +-0.721 0.109 -1.606 +-0.420 0.017 -1.606 +-0.106 -0.013 -1.606 +0.207 0.017 -1.606 +0.508 0.109 -1.606 +0.786 0.257 -1.606 +1.029 0.457 -1.606 +1.229 0.700 -1.606 +1.378 0.978 -1.606 +1.469 1.280 -1.606 +1.500 1.593 -1.606 +1.469 1.906 -1.606 +1.378 2.208 -1.606 +1.229 2.485 -1.606 +1.029 2.729 -1.606 +0.786 2.929 -1.606 +0.508 3.077 -1.606 +0.207 3.168 -1.606 +-0.106 2.855 -1.889 +-0.353 2.831 -1.889 +-0.589 2.759 -1.889 +-0.808 2.642 -1.889 +-0.999 2.485 -1.889 +-1.156 2.294 -1.889 +-1.273 2.076 -1.889 +-1.344 1.839 -1.889 +-1.369 1.593 -1.889 +-1.344 1.347 -1.889 +-1.273 1.110 -1.889 +-1.156 0.892 -1.889 +-0.999 0.700 -1.889 +-0.808 0.544 -1.889 +-0.589 0.427 -1.889 +-0.353 0.355 -1.889 +-0.106 0.331 -1.889 +0.140 0.355 -1.889 +0.377 0.427 -1.889 +0.595 0.544 -1.889 +0.786 0.700 -1.889 +0.943 0.892 -1.889 +1.060 1.110 -1.889 +1.131 1.347 -1.889 +1.156 1.593 -1.889 +1.131 1.839 -1.889 +1.060 2.076 -1.889 +0.943 2.294 -1.889 +0.786 2.485 -1.889 +0.595 2.642 -1.889 +0.377 2.759 -1.889 +0.140 2.831 -1.889 +-0.106 2.462 -2.099 +-0.276 2.446 -2.099 +-0.439 2.396 -2.099 +-0.589 2.316 -2.099 +-0.721 2.208 -2.099 +-0.829 2.076 -2.099 +-0.910 1.926 -2.099 +-0.959 1.763 -2.099 +-0.976 1.593 -2.099 +-0.959 1.423 -2.099 +-0.910 1.260 -2.099 +-0.829 1.110 -2.099 +-0.721 0.978 -2.099 +-0.589 0.870 -2.099 +-0.439 0.790 -2.099 +-0.276 0.740 -2.099 +-0.106 0.724 -2.099 +0.063 0.740 -2.099 +0.226 0.790 -2.099 +0.377 0.870 -2.099 +0.508 0.978 -2.099 +0.616 1.110 -2.099 +0.697 1.260 -2.099 +0.746 1.423 -2.099 +0.763 1.593 -2.099 +0.746 1.763 -2.099 +0.697 1.926 -2.099 +0.616 2.076 -2.099 +0.508 2.208 -2.099 +0.377 2.316 -2.099 +0.226 2.396 -2.099 +0.063 2.446 -2.099 +-0.106 2.036 -2.228 +-0.193 2.028 -2.228 +-0.276 2.002 -2.228 +-0.353 1.961 -2.228 +-0.420 1.906 -2.228 +-0.475 1.839 -2.228 +-0.516 1.763 -2.228 +-0.541 1.679 -2.228 +-0.550 1.593 -2.228 +-0.541 1.506 -2.228 +-0.516 1.423 -2.228 +-0.475 1.347 -2.228 +-0.420 1.280 -2.228 +-0.353 1.224 -2.228 +-0.276 1.183 -2.228 +-0.193 1.158 -2.228 +-0.106 1.150 -2.228 +-0.020 1.158 -2.228 +0.063 1.183 -2.228 +0.140 1.224 -2.228 +0.207 1.280 -2.228 +0.262 1.347 -2.228 +0.303 1.423 -2.228 +0.328 1.506 -2.228 +0.337 1.593 -2.228 +0.328 1.679 -2.228 +0.303 1.763 -2.228 +0.262 1.839 -2.228 +0.207 1.906 -2.228 +0.140 1.961 -2.228 +0.063 2.002 -2.228 +-0.020 2.028 -2.228 +-0.106 1.593 -2.272 +0.140 1.961 -2.228 +0.063 2.002 -2.228 +-0.020 2.028 -2.228 +-0.106 1.593 -2.272 diff --git a/POWERVR/SRCS/NeHe/Lesson25/data/torus.txt b/POWERVR/SRCS/NeHe/Lesson25/data/torus.txt new file mode 100644 index 00000000..75c78025 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson25/data/torus.txt @@ -0,0 +1,487 @@ +Vertices: 486 +-0.033 0.000 2.344 +-0.033 -0.144 2.318 +-0.033 -0.271 2.245 +-0.033 -0.366 2.133 +-0.033 -0.416 1.995 +-0.033 -0.416 1.848 +-0.033 -0.366 1.711 +-0.033 -0.271 1.598 +-0.033 -0.144 1.525 +-0.033 0.000 1.499 +-0.033 0.144 1.525 +-0.033 0.271 1.598 +-0.033 0.366 1.711 +-0.033 0.416 1.848 +-0.033 0.416 1.995 +-0.033 0.366 2.133 +-0.033 0.271 2.245 +-0.033 0.144 2.318 +0.498 0.000 2.282 +0.492 -0.144 2.257 +0.475 -0.271 2.186 +0.449 -0.366 2.076 +0.417 -0.416 1.942 +0.383 -0.416 1.800 +0.351 -0.366 1.666 +0.326 -0.271 1.556 +0.309 -0.144 1.485 +0.303 0.000 1.460 +0.309 0.144 1.485 +0.326 0.271 1.556 +0.351 0.366 1.666 +0.383 0.416 1.800 +0.417 0.416 1.942 +0.449 0.366 2.076 +0.475 0.271 2.186 +0.492 0.144 2.257 +0.999 0.000 2.099 +0.988 -0.144 2.076 +0.955 -0.271 2.011 +0.905 -0.366 1.911 +0.843 -0.416 1.787 +0.777 -0.416 1.656 +0.715 -0.366 1.533 +0.665 -0.271 1.433 +0.632 -0.144 1.367 +0.620 0.000 1.345 +0.632 0.144 1.367 +0.665 0.271 1.433 +0.715 0.366 1.533 +0.777 0.416 1.656 +0.843 0.416 1.787 +0.905 0.366 1.911 +0.955 0.271 2.011 +0.988 0.144 2.076 +1.446 0.000 1.806 +1.429 -0.144 1.786 +1.382 -0.271 1.730 +1.310 -0.366 1.644 +1.221 -0.416 1.538 +1.127 -0.416 1.426 +1.038 -0.366 1.321 +0.966 -0.271 1.235 +0.919 -0.144 1.178 +0.903 0.000 1.159 +0.919 0.144 1.178 +0.966 0.271 1.235 +1.038 0.366 1.321 +1.127 0.416 1.426 +1.221 0.416 1.538 +1.310 0.366 1.644 +1.382 0.271 1.730 +1.429 0.144 1.786 +1.812 0.000 1.417 +1.792 -0.144 1.402 +1.733 -0.271 1.358 +1.643 -0.366 1.291 +1.532 -0.416 1.209 +1.415 -0.416 1.121 +1.304 -0.366 1.039 +1.214 -0.271 0.972 +1.155 -0.144 0.928 +1.135 0.000 0.913 +1.155 0.144 0.928 +1.214 0.271 0.972 +1.304 0.366 1.039 +1.415 0.416 1.121 +1.532 0.416 1.209 +1.643 0.366 1.291 +1.733 0.271 1.358 +1.792 0.144 1.402 +2.079 0.000 0.955 +2.056 -0.144 0.945 +1.988 -0.271 0.916 +1.885 -0.366 0.871 +1.759 -0.416 0.817 +1.624 -0.416 0.758 +1.498 -0.366 0.704 +1.394 -0.271 0.659 +1.327 -0.144 0.630 +1.304 0.000 0.620 +1.327 0.144 0.630 +1.394 0.271 0.659 +1.498 0.366 0.704 +1.624 0.416 0.758 +1.759 0.416 0.817 +1.885 0.366 0.871 +1.988 0.271 0.916 +2.056 0.144 0.945 +2.232 0.000 0.443 +2.207 -0.144 0.439 +2.135 -0.271 0.426 +2.024 -0.366 0.406 +1.889 -0.416 0.383 +1.744 -0.416 0.357 +1.609 -0.366 0.333 +1.498 -0.271 0.314 +1.426 -0.144 0.301 +1.401 0.000 0.297 +1.426 0.144 0.301 +1.498 0.271 0.314 +1.609 0.366 0.333 +1.744 0.416 0.357 +1.889 0.416 0.383 +2.024 0.366 0.406 +2.135 0.271 0.426 +2.207 0.144 0.439 +2.263 -0.000 -0.090 +2.238 -0.144 -0.089 +2.165 -0.271 -0.084 +2.053 -0.366 -0.078 +1.915 -0.416 -0.070 +1.769 -0.416 -0.061 +1.631 -0.366 -0.053 +1.519 -0.271 -0.047 +1.446 -0.144 -0.042 +1.420 0.000 -0.041 +1.446 0.144 -0.042 +1.519 0.271 -0.047 +1.631 0.366 -0.053 +1.769 0.416 -0.061 +1.915 0.416 -0.070 +2.053 0.366 -0.078 +2.165 0.271 -0.084 +2.238 0.144 -0.089 +2.171 -0.000 -0.616 +2.146 -0.144 -0.609 +2.076 -0.271 -0.588 +1.968 -0.366 -0.555 +1.836 -0.416 -0.516 +1.696 -0.416 -0.474 +1.564 -0.366 -0.434 +1.456 -0.271 -0.402 +1.386 -0.144 -0.381 +1.362 0.000 -0.374 +1.386 0.144 -0.381 +1.456 0.271 -0.402 +1.564 0.366 -0.434 +1.696 0.416 -0.474 +1.836 0.416 -0.516 +1.968 0.366 -0.555 +2.076 0.271 -0.588 +2.146 0.144 -0.609 +1.959 -0.000 -1.106 +1.937 -0.144 -1.094 +1.873 -0.271 -1.057 +1.776 -0.366 -1.001 +1.657 -0.416 -0.932 +1.530 -0.416 -0.859 +1.411 -0.366 -0.790 +1.313 -0.271 -0.733 +1.250 -0.144 -0.697 +1.228 0.000 -0.684 +1.250 0.144 -0.697 +1.313 0.271 -0.733 +1.411 0.366 -0.790 +1.530 0.416 -0.859 +1.657 0.416 -0.932 +1.776 0.366 -1.001 +1.873 0.271 -1.057 +1.937 0.144 -1.094 +1.640 -0.000 -1.535 +1.622 -0.144 -1.517 +1.568 -0.271 -1.467 +1.487 -0.366 -1.390 +1.386 -0.416 -1.295 +1.280 -0.416 -1.195 +1.179 -0.366 -1.100 +1.098 -0.271 -1.023 +1.044 -0.144 -0.973 +1.026 0.000 -0.955 +1.044 0.144 -0.973 +1.098 0.271 -1.023 +1.179 0.366 -1.100 +1.280 0.416 -1.195 +1.386 0.416 -1.295 +1.487 0.366 -1.390 +1.568 0.271 -1.467 +1.622 0.144 -1.517 +1.231 -0.000 -1.878 +1.217 -0.144 -1.857 +1.177 -0.271 -1.795 +1.115 -0.366 -1.702 +1.039 -0.416 -1.586 +0.959 -0.416 -1.464 +0.883 -0.366 -1.349 +0.821 -0.271 -1.255 +0.781 -0.144 -1.194 +0.767 0.000 -1.172 +0.781 0.144 -1.194 +0.821 0.271 -1.255 +0.883 0.366 -1.349 +0.959 0.416 -1.464 +1.039 0.416 -1.586 +1.115 0.366 -1.702 +1.177 0.271 -1.795 +1.217 0.144 -1.857 +0.754 -0.000 -2.118 +0.745 -0.144 -2.094 +0.720 -0.271 -2.025 +0.682 -0.366 -1.919 +0.634 -0.416 -1.790 +0.584 -0.416 -1.652 +0.537 -0.366 -1.523 +0.499 -0.271 -1.417 +0.474 -0.144 -1.348 +0.465 -0.000 -1.324 +0.474 0.144 -1.348 +0.499 0.271 -1.417 +0.537 0.366 -1.523 +0.584 0.416 -1.652 +0.634 0.416 -1.790 +0.682 0.366 -1.919 +0.720 0.271 -2.025 +0.745 0.144 -2.094 +0.234 -0.000 -2.241 +0.231 -0.144 -2.215 +0.223 -0.271 -2.143 +0.210 -0.366 -2.031 +0.194 -0.416 -1.894 +0.177 -0.416 -1.749 +0.161 -0.366 -1.612 +0.148 -0.271 -1.500 +0.139 -0.144 -1.427 +0.136 -0.000 -1.402 +0.139 0.144 -1.427 +0.148 0.271 -1.500 +0.161 0.366 -1.612 +0.177 0.416 -1.749 +0.194 0.416 -1.894 +0.210 0.366 -2.031 +0.223 0.271 -2.143 +0.231 0.144 -2.215 +-0.300 -0.000 -2.241 +-0.297 -0.144 -2.215 +-0.288 -0.271 -2.143 +-0.275 -0.366 -2.031 +-0.259 -0.416 -1.894 +-0.242 -0.416 -1.749 +-0.226 -0.366 -1.612 +-0.213 -0.271 -1.500 +-0.205 -0.144 -1.427 +-0.202 -0.000 -1.402 +-0.205 0.144 -1.427 +-0.213 0.271 -1.500 +-0.226 0.366 -1.612 +-0.242 0.416 -1.749 +-0.259 0.416 -1.894 +-0.275 0.366 -2.031 +-0.288 0.271 -2.143 +-0.297 0.144 -2.215 +-0.820 -0.000 -2.118 +-0.811 -0.144 -2.094 +-0.786 -0.271 -2.025 +-0.747 -0.366 -1.919 +-0.700 -0.416 -1.790 +-0.650 -0.416 -1.652 +-0.603 -0.366 -1.523 +-0.565 -0.271 -1.417 +-0.539 -0.144 -1.348 +-0.531 -0.000 -1.324 +-0.539 0.144 -1.348 +-0.565 0.271 -1.417 +-0.603 0.366 -1.523 +-0.650 0.416 -1.652 +-0.700 0.416 -1.790 +-0.747 0.366 -1.919 +-0.786 0.271 -2.025 +-0.811 0.144 -2.094 +-1.297 -0.000 -1.878 +-1.283 -0.144 -1.857 +-1.243 -0.271 -1.795 +-1.181 -0.366 -1.702 +-1.105 -0.416 -1.586 +-1.025 -0.416 -1.464 +-0.949 -0.366 -1.349 +-0.887 -0.271 -1.255 +-0.847 -0.144 -1.194 +-0.833 0.000 -1.172 +-0.847 0.144 -1.194 +-0.887 0.271 -1.255 +-0.949 0.366 -1.349 +-1.025 0.416 -1.464 +-1.105 0.416 -1.586 +-1.181 0.366 -1.702 +-1.243 0.271 -1.795 +-1.283 0.144 -1.857 +-1.706 -0.000 -1.535 +-1.687 -0.144 -1.517 +-1.634 -0.271 -1.467 +-1.552 -0.366 -1.390 +-1.452 -0.416 -1.295 +-1.345 -0.416 -1.195 +-1.245 -0.366 -1.100 +-1.164 -0.271 -1.023 +-1.110 -0.144 -0.973 +-1.092 0.000 -0.955 +-1.110 0.144 -0.973 +-1.164 0.271 -1.023 +-1.245 0.366 -1.100 +-1.345 0.416 -1.195 +-1.452 0.416 -1.295 +-1.552 0.366 -1.390 +-1.634 0.271 -1.467 +-1.687 0.144 -1.517 +-2.025 -0.000 -1.106 +-2.003 -0.144 -1.094 +-1.939 -0.271 -1.057 +-1.842 -0.366 -1.001 +-1.723 -0.416 -0.932 +-1.596 -0.416 -0.859 +-1.476 -0.366 -0.790 +-1.379 -0.271 -0.733 +-1.316 -0.144 -0.697 +-1.294 0.000 -0.684 +-1.316 0.144 -0.697 +-1.379 0.271 -0.733 +-1.476 0.366 -0.790 +-1.596 0.416 -0.859 +-1.723 0.416 -0.932 +-1.842 0.366 -1.001 +-1.939 0.271 -1.057 +-2.003 0.144 -1.094 +-2.236 -0.000 -0.616 +-2.212 -0.144 -0.609 +-2.142 -0.271 -0.588 +-2.034 -0.366 -0.555 +-1.902 -0.416 -0.516 +-1.762 -0.416 -0.474 +-1.630 -0.366 -0.434 +-1.522 -0.271 -0.402 +-1.452 -0.144 -0.381 +-1.427 0.000 -0.374 +-1.452 0.144 -0.381 +-1.522 0.271 -0.402 +-1.630 0.366 -0.434 +-1.762 0.416 -0.474 +-1.902 0.416 -0.516 +-2.034 0.366 -0.555 +-2.142 0.271 -0.588 +-2.212 0.144 -0.609 +-2.329 -0.000 -0.090 +-2.304 -0.144 -0.089 +-2.230 -0.271 -0.084 +-2.118 -0.366 -0.078 +-1.981 -0.416 -0.070 +-1.834 -0.416 -0.061 +-1.697 -0.366 -0.053 +-1.585 -0.271 -0.047 +-1.512 -0.144 -0.042 +-1.486 0.000 -0.041 +-1.512 0.144 -0.042 +-1.585 0.271 -0.047 +-1.697 0.366 -0.053 +-1.834 0.416 -0.061 +-1.981 0.416 -0.070 +-2.118 0.366 -0.078 +-2.230 0.271 -0.084 +-2.304 0.144 -0.089 +-2.298 0.000 0.443 +-2.273 -0.144 0.439 +-2.201 -0.271 0.426 +-2.090 -0.366 0.406 +-1.954 -0.416 0.383 +-1.810 -0.416 0.357 +-1.674 -0.366 0.333 +-1.564 -0.271 0.314 +-1.492 -0.144 0.301 +-1.466 0.000 0.297 +-1.492 0.144 0.301 +-1.564 0.271 0.314 +-1.674 0.366 0.333 +-1.810 0.416 0.357 +-1.954 0.416 0.383 +-2.090 0.366 0.406 +-2.201 0.271 0.426 +-2.273 0.144 0.439 +-2.145 0.000 0.955 +-2.121 -0.144 0.945 +-2.054 -0.271 0.916 +-1.951 -0.366 0.871 +-1.825 -0.416 0.817 +-1.690 -0.416 0.758 +-1.563 -0.366 0.704 +-1.460 -0.271 0.659 +-1.393 -0.144 0.630 +-1.370 0.000 0.620 +-1.393 0.144 0.630 +-1.460 0.271 0.659 +-1.563 0.366 0.704 +-1.690 0.416 0.758 +-1.825 0.416 0.817 +-1.951 0.366 0.871 +-2.054 0.271 0.916 +-2.121 0.144 0.945 +-1.878 0.000 1.417 +-1.857 -0.144 1.402 +-1.799 -0.271 1.358 +-1.709 -0.366 1.291 +-1.598 -0.416 1.209 +-1.480 -0.416 1.121 +-1.370 -0.366 1.039 +-1.280 -0.271 0.972 +-1.221 -0.144 0.928 +-1.201 0.000 0.913 +-1.221 0.144 0.928 +-1.280 0.271 0.972 +-1.370 0.366 1.039 +-1.480 0.416 1.121 +-1.598 0.416 1.209 +-1.709 0.366 1.291 +-1.799 0.271 1.358 +-1.857 0.144 1.402 +-1.511 0.000 1.806 +-1.495 -0.144 1.786 +-1.448 -0.271 1.730 +-1.376 -0.366 1.644 +-1.287 -0.416 1.538 +-1.193 -0.416 1.426 +-1.104 -0.366 1.321 +-1.032 -0.271 1.235 +-0.985 -0.144 1.178 +-0.969 0.000 1.159 +-0.985 0.144 1.178 +-1.032 0.271 1.235 +-1.104 0.366 1.321 +-1.193 0.416 1.426 +-1.287 0.416 1.538 +-1.376 0.366 1.644 +-1.448 0.271 1.730 +-1.495 0.144 1.786 +-1.065 0.000 2.099 +-1.054 -0.144 2.076 +-1.021 -0.271 2.011 +-0.970 -0.366 1.911 +-0.909 -0.416 1.787 +-0.843 -0.416 1.656 +-0.781 -0.366 1.533 +-0.731 -0.271 1.433 +-0.698 -0.144 1.367 +-0.686 0.000 1.345 +-0.698 0.144 1.367 +-0.731 0.271 1.433 +-0.781 0.366 1.533 +-0.843 0.416 1.656 +-0.909 0.416 1.787 +-0.970 0.366 1.911 +-1.021 0.271 2.011 +-1.054 0.144 2.076 +-0.563 0.000 2.282 +-0.557 -0.144 2.257 +-0.541 -0.271 2.186 +-0.515 -0.366 2.076 +-0.483 -0.416 1.942 +-0.449 -0.416 1.800 +-0.417 -0.366 1.666 +-0.391 -0.271 1.556 +-0.374 -0.144 1.485 +-0.369 0.000 1.460 +-0.374 0.144 1.485 +-0.391 0.271 1.556 +-0.417 0.366 1.666 +-0.449 0.416 1.800 +-0.483 0.416 1.942 +-0.515 0.366 2.076 +-0.541 0.271 2.186 +-0.557 0.144 2.257 diff --git a/POWERVR/SRCS/NeHe/Lesson25/data/tube.txt b/POWERVR/SRCS/NeHe/Lesson25/data/tube.txt new file mode 100644 index 00000000..8a79c95b --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson25/data/tube.txt @@ -0,0 +1,487 @@ +Vertices: 486 +-0.000 0.000 2.000 +-0.000 -0.267 2.000 +-0.000 -0.533 2.000 +-0.000 -0.800 2.000 +-0.000 -1.067 2.000 +-0.000 -1.333 2.000 +-0.000 -1.600 2.000 +-0.000 -1.867 2.000 +-0.000 -2.133 2.000 +-0.000 -2.400 2.000 +-0.000 -2.667 2.000 +-0.000 -2.933 2.000 +-0.000 -3.200 2.000 +-0.000 -3.467 2.000 +-0.000 -3.733 2.000 +-0.000 -4.000 2.000 +-0.000 -4.000 1.595 +-0.000 -3.733 1.595 +-0.000 -3.467 1.595 +-0.000 -3.200 1.595 +-0.000 -2.933 1.595 +-0.000 -2.667 1.595 +-0.000 -2.400 1.595 +-0.000 -2.133 1.595 +-0.000 -1.867 1.595 +-0.000 -1.600 1.595 +-0.000 -1.333 1.595 +-0.000 -1.067 1.595 +-0.000 -0.800 1.595 +-0.000 -0.533 1.595 +-0.000 -0.267 1.595 +-0.000 0.000 1.595 +0.813 0.000 1.827 +0.813 -0.267 1.827 +0.813 -0.533 1.827 +0.813 -0.800 1.827 +0.813 -1.067 1.827 +0.813 -1.333 1.827 +0.813 -1.600 1.827 +0.813 -1.867 1.827 +0.813 -2.133 1.827 +0.813 -2.400 1.827 +0.813 -2.667 1.827 +0.813 -2.933 1.827 +0.813 -3.200 1.827 +0.813 -3.467 1.827 +0.813 -3.733 1.827 +0.813 -4.000 1.827 +0.649 -4.000 1.458 +0.649 -3.733 1.458 +0.649 -3.467 1.458 +0.649 -3.200 1.458 +0.649 -2.933 1.458 +0.649 -2.667 1.458 +0.649 -2.400 1.458 +0.649 -2.133 1.458 +0.649 -1.867 1.458 +0.649 -1.600 1.458 +0.649 -1.333 1.458 +0.649 -1.067 1.458 +0.649 -0.800 1.458 +0.649 -0.533 1.458 +0.649 -0.267 1.458 +0.649 0.000 1.458 +1.486 0.000 1.338 +1.486 -0.267 1.338 +1.486 -0.533 1.338 +1.486 -0.800 1.338 +1.486 -1.067 1.338 +1.486 -1.333 1.338 +1.486 -1.600 1.338 +1.486 -1.867 1.338 +1.486 -2.133 1.338 +1.486 -2.400 1.338 +1.486 -2.667 1.338 +1.486 -2.933 1.338 +1.486 -3.200 1.338 +1.486 -3.467 1.338 +1.486 -3.733 1.338 +1.486 -4.000 1.338 +1.186 -4.000 1.068 +1.186 -3.733 1.068 +1.186 -3.467 1.068 +1.186 -3.200 1.068 +1.186 -2.933 1.068 +1.186 -2.667 1.068 +1.186 -2.400 1.068 +1.186 -2.133 1.068 +1.186 -1.867 1.068 +1.186 -1.600 1.068 +1.186 -1.333 1.068 +1.186 -1.067 1.068 +1.186 -0.800 1.068 +1.186 -0.533 1.068 +1.186 -0.267 1.068 +1.186 0.000 1.068 +1.902 0.000 0.618 +1.902 -0.267 0.618 +1.902 -0.533 0.618 +1.902 -0.800 0.618 +1.902 -1.067 0.618 +1.902 -1.333 0.618 +1.902 -1.600 0.618 +1.902 -1.867 0.618 +1.902 -2.133 0.618 +1.902 -2.400 0.618 +1.902 -2.667 0.618 +1.902 -2.933 0.618 +1.902 -3.200 0.618 +1.902 -3.467 0.618 +1.902 -3.733 0.618 +1.902 -4.000 0.618 +1.517 -4.000 0.493 +1.517 -3.733 0.493 +1.517 -3.467 0.493 +1.517 -3.200 0.493 +1.517 -2.933 0.493 +1.517 -2.667 0.493 +1.517 -2.400 0.493 +1.517 -2.133 0.493 +1.517 -1.867 0.493 +1.517 -1.600 0.493 +1.517 -1.333 0.493 +1.517 -1.067 0.493 +1.517 -0.800 0.493 +1.517 -0.533 0.493 +1.517 -0.267 0.493 +1.517 0.000 0.493 +1.989 -0.000 -0.209 +1.989 -0.267 -0.209 +1.989 -0.533 -0.209 +1.989 -0.800 -0.209 +1.989 -1.067 -0.209 +1.989 -1.333 -0.209 +1.989 -1.600 -0.209 +1.989 -1.867 -0.209 +1.989 -2.133 -0.209 +1.989 -2.400 -0.209 +1.989 -2.667 -0.209 +1.989 -2.933 -0.209 +1.989 -3.200 -0.209 +1.989 -3.467 -0.209 +1.989 -3.733 -0.209 +1.989 -4.000 -0.209 +1.587 -4.000 -0.167 +1.587 -3.733 -0.167 +1.587 -3.467 -0.167 +1.587 -3.200 -0.167 +1.587 -2.933 -0.167 +1.587 -2.667 -0.167 +1.587 -2.400 -0.167 +1.587 -2.133 -0.167 +1.587 -1.867 -0.167 +1.587 -1.600 -0.167 +1.587 -1.333 -0.167 +1.587 -1.067 -0.167 +1.587 -0.800 -0.167 +1.587 -0.533 -0.167 +1.587 -0.267 -0.167 +1.587 -0.000 -0.167 +1.732 -0.000 -1.000 +1.732 -0.267 -1.000 +1.732 -0.533 -1.000 +1.732 -0.800 -1.000 +1.732 -1.067 -1.000 +1.732 -1.333 -1.000 +1.732 -1.600 -1.000 +1.732 -1.867 -1.000 +1.732 -2.133 -1.000 +1.732 -2.400 -1.000 +1.732 -2.667 -1.000 +1.732 -2.933 -1.000 +1.732 -3.200 -1.000 +1.732 -3.467 -1.000 +1.732 -3.733 -1.000 +1.732 -4.000 -1.000 +1.382 -4.000 -0.798 +1.382 -3.733 -0.798 +1.382 -3.467 -0.798 +1.382 -3.200 -0.798 +1.382 -2.933 -0.798 +1.382 -2.667 -0.798 +1.382 -2.400 -0.798 +1.382 -2.133 -0.798 +1.382 -1.867 -0.798 +1.382 -1.600 -0.798 +1.382 -1.333 -0.798 +1.382 -1.067 -0.798 +1.382 -0.800 -0.798 +1.382 -0.533 -0.798 +1.382 -0.267 -0.798 +1.382 -0.000 -0.798 +1.176 -0.000 -1.618 +1.176 -0.267 -1.618 +1.176 -0.533 -1.618 +1.176 -0.800 -1.618 +1.176 -1.067 -1.618 +1.176 -1.333 -1.618 +1.176 -1.600 -1.618 +1.176 -1.867 -1.618 +1.176 -2.133 -1.618 +1.176 -2.400 -1.618 +1.176 -2.667 -1.618 +1.176 -2.933 -1.618 +1.176 -3.200 -1.618 +1.176 -3.467 -1.618 +1.176 -3.733 -1.618 +1.176 -4.000 -1.618 +0.938 -4.000 -1.291 +0.938 -3.733 -1.291 +0.938 -3.467 -1.291 +0.938 -3.200 -1.291 +0.938 -2.933 -1.291 +0.938 -2.667 -1.291 +0.938 -2.400 -1.291 +0.938 -2.133 -1.291 +0.938 -1.867 -1.291 +0.938 -1.600 -1.291 +0.938 -1.333 -1.291 +0.938 -1.067 -1.291 +0.938 -0.800 -1.291 +0.938 -0.533 -1.291 +0.938 -0.267 -1.291 +0.938 -0.000 -1.291 +0.416 -0.000 -1.956 +0.416 -0.267 -1.956 +0.416 -0.533 -1.956 +0.416 -0.800 -1.956 +0.416 -1.067 -1.956 +0.416 -1.333 -1.956 +0.416 -1.600 -1.956 +0.416 -1.867 -1.956 +0.416 -2.133 -1.956 +0.416 -2.400 -1.956 +0.416 -2.667 -1.956 +0.416 -2.933 -1.956 +0.416 -3.200 -1.956 +0.416 -3.467 -1.956 +0.416 -3.733 -1.956 +0.416 -4.000 -1.956 +0.332 -4.000 -1.561 +0.332 -3.733 -1.561 +0.332 -3.467 -1.561 +0.332 -3.200 -1.561 +0.332 -2.933 -1.561 +0.332 -2.667 -1.561 +0.332 -2.400 -1.561 +0.332 -2.133 -1.561 +0.332 -1.867 -1.561 +0.332 -1.600 -1.561 +0.332 -1.333 -1.561 +0.332 -1.067 -1.561 +0.332 -0.800 -1.561 +0.332 -0.533 -1.561 +0.332 -0.267 -1.561 +0.332 -0.000 -1.561 +-0.416 -0.000 -1.956 +-0.416 -0.267 -1.956 +-0.416 -0.533 -1.956 +-0.416 -0.800 -1.956 +-0.416 -1.067 -1.956 +-0.416 -1.333 -1.956 +-0.416 -1.600 -1.956 +-0.416 -1.867 -1.956 +-0.416 -2.133 -1.956 +-0.416 -2.400 -1.956 +-0.416 -2.667 -1.956 +-0.416 -2.933 -1.956 +-0.416 -3.200 -1.956 +-0.416 -3.467 -1.956 +-0.416 -3.733 -1.956 +-0.416 -4.000 -1.956 +-0.332 -4.000 -1.561 +-0.332 -3.733 -1.561 +-0.332 -3.467 -1.561 +-0.332 -3.200 -1.561 +-0.332 -2.933 -1.561 +-0.332 -2.667 -1.561 +-0.332 -2.400 -1.561 +-0.332 -2.133 -1.561 +-0.332 -1.867 -1.561 +-0.332 -1.600 -1.561 +-0.332 -1.333 -1.561 +-0.332 -1.067 -1.561 +-0.332 -0.800 -1.561 +-0.332 -0.533 -1.561 +-0.332 -0.267 -1.561 +-0.332 -0.000 -1.561 +-1.176 -0.000 -1.618 +-1.176 -0.267 -1.618 +-1.176 -0.533 -1.618 +-1.176 -0.800 -1.618 +-1.176 -1.067 -1.618 +-1.176 -1.333 -1.618 +-1.176 -1.600 -1.618 +-1.176 -1.867 -1.618 +-1.176 -2.133 -1.618 +-1.176 -2.400 -1.618 +-1.176 -2.667 -1.618 +-1.176 -2.933 -1.618 +-1.176 -3.200 -1.618 +-1.176 -3.467 -1.618 +-1.176 -3.733 -1.618 +-1.176 -4.000 -1.618 +-0.938 -4.000 -1.291 +-0.938 -3.733 -1.291 +-0.938 -3.467 -1.291 +-0.938 -3.200 -1.291 +-0.938 -2.933 -1.291 +-0.938 -2.667 -1.291 +-0.938 -2.400 -1.291 +-0.938 -2.133 -1.291 +-0.938 -1.867 -1.291 +-0.938 -1.600 -1.291 +-0.938 -1.333 -1.291 +-0.938 -1.067 -1.291 +-0.938 -0.800 -1.291 +-0.938 -0.533 -1.291 +-0.938 -0.267 -1.291 +-0.938 -0.000 -1.291 +-1.732 -0.000 -1.000 +-1.732 -0.267 -1.000 +-1.732 -0.533 -1.000 +-1.732 -0.800 -1.000 +-1.732 -1.067 -1.000 +-1.732 -1.333 -1.000 +-1.732 -1.600 -1.000 +-1.732 -1.867 -1.000 +-1.732 -2.133 -1.000 +-1.732 -2.400 -1.000 +-1.732 -2.667 -1.000 +-1.732 -2.933 -1.000 +-1.732 -3.200 -1.000 +-1.732 -3.467 -1.000 +-1.732 -3.733 -1.000 +-1.732 -4.000 -1.000 +-1.382 -4.000 -0.798 +-1.382 -3.733 -0.798 +-1.382 -3.467 -0.798 +-1.382 -3.200 -0.798 +-1.382 -2.933 -0.798 +-1.382 -2.667 -0.798 +-1.382 -2.400 -0.798 +-1.382 -2.133 -0.798 +-1.382 -1.867 -0.798 +-1.382 -1.600 -0.798 +-1.382 -1.333 -0.798 +-1.382 -1.067 -0.798 +-1.382 -0.800 -0.798 +-1.382 -0.533 -0.798 +-1.382 -0.267 -0.798 +-1.382 -0.000 -0.798 +-1.989 -0.000 -0.209 +-1.989 -0.267 -0.209 +-1.989 -0.533 -0.209 +-1.989 -0.800 -0.209 +-1.989 -1.067 -0.209 +-1.989 -1.333 -0.209 +-1.989 -1.600 -0.209 +-1.989 -1.867 -0.209 +-1.989 -2.133 -0.209 +-1.989 -2.400 -0.209 +-1.989 -2.667 -0.209 +-1.989 -2.933 -0.209 +-1.989 -3.200 -0.209 +-1.989 -3.467 -0.209 +-1.989 -3.733 -0.209 +-1.989 -4.000 -0.209 +-1.587 -4.000 -0.167 +-1.587 -3.733 -0.167 +-1.587 -3.467 -0.167 +-1.587 -3.200 -0.167 +-1.587 -2.933 -0.167 +-1.587 -2.667 -0.167 +-1.587 -2.400 -0.167 +-1.587 -2.133 -0.167 +-1.587 -1.867 -0.167 +-1.587 -1.600 -0.167 +-1.587 -1.333 -0.167 +-1.587 -1.067 -0.167 +-1.587 -0.800 -0.167 +-1.587 -0.533 -0.167 +-1.587 -0.267 -0.167 +-1.587 -0.000 -0.167 +-1.902 0.000 0.618 +-1.902 -0.267 0.618 +-1.902 -0.533 0.618 +-1.902 -0.800 0.618 +-1.902 -1.067 0.618 +-1.902 -1.333 0.618 +-1.902 -1.600 0.618 +-1.902 -1.867 0.618 +-1.902 -2.133 0.618 +-1.902 -2.400 0.618 +-1.902 -2.667 0.618 +-1.902 -2.933 0.618 +-1.902 -3.200 0.618 +-1.902 -3.467 0.618 +-1.902 -3.733 0.618 +-1.902 -4.000 0.618 +-1.517 -4.000 0.493 +-1.517 -3.733 0.493 +-1.517 -3.467 0.493 +-1.517 -3.200 0.493 +-1.517 -2.933 0.493 +-1.517 -2.667 0.493 +-1.517 -2.400 0.493 +-1.517 -2.133 0.493 +-1.517 -1.867 0.493 +-1.517 -1.600 0.493 +-1.517 -1.333 0.493 +-1.517 -1.067 0.493 +-1.517 -0.800 0.493 +-1.517 -0.533 0.493 +-1.517 -0.267 0.493 +-1.517 0.000 0.493 +-1.486 0.000 1.338 +-1.486 -0.267 1.338 +-1.486 -0.533 1.338 +-1.486 -0.800 1.338 +-1.486 -1.067 1.338 +-1.486 -1.333 1.338 +-1.486 -1.600 1.338 +-1.486 -1.867 1.338 +-1.486 -2.133 1.338 +-1.486 -2.400 1.338 +-1.486 -2.667 1.338 +-1.486 -2.933 1.338 +-1.486 -3.200 1.338 +-1.486 -3.467 1.338 +-1.486 -3.733 1.338 +-1.486 -4.000 1.338 +-1.186 -4.000 1.068 +-1.186 -3.733 1.068 +-1.186 -3.467 1.068 +-1.186 -3.200 1.068 +-1.186 -2.933 1.068 +-1.186 -2.667 1.068 +-1.186 -2.400 1.068 +-1.186 -2.133 1.068 +-1.186 -1.867 1.068 +-1.186 -1.600 1.068 +-1.186 -1.333 1.068 +-1.186 -1.067 1.068 +-1.186 -0.800 1.068 +-1.186 -0.533 1.068 +-1.186 -0.267 1.068 +-1.186 0.000 1.068 +-0.813 0.000 1.827 +-0.813 -0.267 1.827 +-0.813 -0.533 1.827 +-0.813 -0.800 1.827 +-0.813 -1.067 1.827 +-0.813 -1.333 1.827 +-0.813 -1.600 1.827 +-0.813 -1.867 1.827 +-0.813 -2.133 1.827 +-0.813 -2.400 1.827 +-0.813 -2.667 1.827 +-0.813 -2.933 1.827 +-0.813 -3.200 1.827 +-0.813 -3.467 1.827 +-0.813 -3.733 1.827 +-0.813 -4.000 1.827 +-0.649 -4.000 1.458 +-0.649 -3.733 1.458 +-0.649 -3.467 1.458 +-0.649 -3.200 1.458 +-0.649 -2.933 1.458 +-0.649 -2.667 1.458 +-0.649 -2.400 1.458 +-0.649 -2.133 1.458 +-0.649 -1.867 1.458 +-0.649 -1.600 1.458 +-0.649 -1.333 1.458 +-0.649 -1.067 1.458 +-0.649 -0.800 1.458 +-0.649 -0.533 1.458 +-0.649 -0.267 1.458 +-0.649 0.000 1.458 +-0.649 -1.333 1.458 +-0.649 -1.067 1.458 +-0.649 -0.800 1.458 +-0.649 -0.533 1.458 +-0.649 -0.267 1.458 +-0.649 0.000 1.458 diff --git a/POWERVR/SRCS/NeHe/Lesson25/data/txt2bin.c b/POWERVR/SRCS/NeHe/Lesson25/data/txt2bin.c new file mode 100644 index 00000000..3b2bf2ef --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson25/data/txt2bin.c @@ -0,0 +1,88 @@ +/* + * Kallistios ##version## + * + * txt2bin.c + * (c)2002, Paul Boese + * + * Take the .txt files from nehe lesson26 and convert them into + * binary files so we can eliminate the use of sscanf from the nehe26 demo. + * + * The format of the files: + * (input file): + * line 1 + * Vertices: + * line 2 thru end. Should have lines after line 1. + * + * + * ... + * + * (output file): + * First 4 bytes (integer) is number of vertices that follow. + * Remainder of file 4 byte floats. Read in 3 at a time. We assume + * litte endian packing. + */ + +#include +#include + +/* function to read a string from a file */ +void readstr( FILE *f, char *string ) +{ + /* Loop Until End Of Line Is Reached */ + do + { + /* Gets A String Of 255 Chars Max From f (File) */ + fgets( string, 255, f ); + } while ( ( string[0] == '/' ) || ( string[0] == '\n' ) ); + + return; +} + +unsigned char buffer[4096]; +char oneline[255]; /* Holds One Line Of Text (255 Chars Max) */ + +void convert(char *ifn, char *ofn) { + FILE *in, *out; + int num_verts, i; + float rx, ry, rz; + + in = fopen(ifn, "rt"); + out = fopen(ofn, "w"); + if (!in || !out) { + printf("error: can't open input or output file\n"); + return; + } + + /* Jumps To Code That Reads One Line Of Text From The File */ + readstr( in, oneline ); + /* Scans Text For "Vertices: ". Number After Is Stored In ver */ + sscanf( oneline, "Vertices: %d\n", &num_verts ); + fwrite(&num_verts, sizeof(int), 1, out ); + + /* Loops Through The Vertices */ + for ( i = 0; i < num_verts; i++ ) + { + /* Reads In The Next Line Of Text */ + readstr( in, oneline ); + /* Searches For 3 Floating Point Numbers, Store In rx,ry & rz */ + sscanf( oneline, "%f %f %f", &rx, &ry, &rz ); + fwrite(&rx, sizeof(float), 1, out ); + fwrite(&ry, sizeof(float), 1, out ); + fwrite(&rz, sizeof(float), 1, out ); + } + fclose(in); + fclose(out); +} + +int main( int argc, char **argv ) +{ + argc--; + if (argc != 2) { + printf("usage: txt2bin \n"); + return 1; + } + + convert(argv[1], argv[2]); + + return 0; +} diff --git a/POWERVR/SRCS/NeHe/Lesson25/main.c b/POWERVR/SRCS/NeHe/Lesson25/main.c new file mode 100644 index 00000000..65f3b08e --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson25/main.c @@ -0,0 +1,369 @@ + +#include +#include +#include +#include +#include + +extern uint8 romdisk[]; +KOS_INIT_FLAGS(INIT_DEFAULT | INIT_MALLOCSTATS); +KOS_INIT_ROMDISK(romdisk); + +void printControls() { + printf("\n/**********Controls**********/\n"); + printf("START-Button: Exits program \n"); + printf("X-Button: Morph to Torus \n"); + printf("Y-Button: Morph to Tube \n"); + printf("A-Button: Morph to Sphere \n"); + printf("B-Button: Morph to Space \n"); + printf("R-Trigger: Rotate the shapes CCW(Counter-clockwise) \n"); + printf("L-Trigger: Rotate the shapes CW(Clockwise) \n"); + + printf("UP-Dir: Rotate the shapes upward \n"); + printf("DOWN-Dir: Rotate the shapes downward \n"); + printf("LEFT-Dir: Rotate the shapes to the left \n"); + printf("RIGHT-Dir: Rotate the shapes to the right \n"); + printf("/****************************/\n\n"); +} + +/* Build Our Vertex Structure */ +typedef struct { + float x, y, z; /* 3D Coordinates */ +} vertex; + +/* Build Our Object Structure */ +typedef struct { + int verts; /* Number Of Vertices For The Object */ + vertex *points; /* One Vertice (Vertex x,y & z) */ +} object; + +float xrot, yrot, zrot; /* Camera rotation variables */ +float cx, cy, cz = -15; /* Camera pos variable */ +float xspeed, yspeed, zspeed; /* Spin Speed */ + +int key = 1; /* Make Sure Same Morph Key Not Pressed */ +int step = 0, steps = 200; /* Step Counter And Maximum Number Of Steps */ +int morph = 0; /* Default morph To False (Not Morphing) */ + +int maxver; /* Holds The Max Number Of Vertices */ +object morph1, morph2, morph3, morph4, /* Our 4 Morphable Objects */ + helper, *sour, *dest; /* Helper, Source, Destination Object */ + +#define MORPHS 4 + +/* function to allocate memory for an object */ +void objallocate( object *k, int n ) { + /* Sets points Equal To VERTEX * Number Of Vertices */ + k->points = ( vertex* )malloc( sizeof( vertex ) * n ); +} + +/* function deallocate memory for an object */ +void objfree( object *k ) { + free( k->points ); +} + +/* function to release/destroy our resources and restoring the old desktop */ +void Quit() { + + /* deallocate the objects' memory */ + objfree( &morph1 ); + objfree( &morph2 ); + objfree( &morph3 ); + objfree( &morph4 ); + objfree( &helper ); +} + +/* function Loads Object From File (name) */ +void objload( char *name, object *k ) { + + int ver; /* Will Hold Vertice Count */ + float rx, ry, rz; /* Hold Vertex X, Y & Z Position */ + FILE *filein; /* Filename To Open */ + int i; /* Simple loop variable */ + + printf(" [objload] file: %s\n", name); + + /* Opens The File For Reading */ + filein = fopen( name, "r" ); + /* Reads the number of verts in the file */ + fread(&ver, sizeof(int), 1, filein); + /* Sets Objects verts Variable To Equal The Value Of ver */ + k->verts = ver; + /* Jumps To Code That Allocates Ram To Hold The Object */ + objallocate( k,ver ); + + /* Loops Through The Vertices */ + for ( i = 0; i < ver; i++ ) { + /* Reads the next three verts */ + fread(&rx, sizeof(float), 1, filein); + fread(&ry, sizeof(float), 1, filein); + fread(&rz, sizeof(float), 1, filein); + /* Set our object's x, y, z points */ + k->points[i].x = rx; + k->points[i].y = ry; + k->points[i].z = rz; + } + + /* Close The File */ + fclose( filein ); + + /* If ver Is Greater Than maxver Set maxver Equal To ver */ + if( ver > maxver ) + maxver = ver; +} + +/* function to calculate Movement Of Points During Morphing */ +vertex calculate( int i ) { + + vertex a; /* Temporary Vertex Called a */ + + /* Calculate x, y, and z movement */ + a.x = ( sour->points[i].x - dest->points[i].x ) / steps; + a.y = ( sour->points[i].y - dest->points[i].y ) / steps; + a.z = ( sour->points[i].z - dest->points[i].z ) / steps; + + return a; +} + +// Taken from: C:\cygwin\usr\local\dc\kos\kos\examples\dreamcast\parallax\delay_cube\delay_cube.c +// Draw a single point in 3D space. Uses the currently loaded matrix. +void drawpnt(plx_dr_state_t * state, float x, float y, float z, uint32 col) { + + // Transform the point, clip the Z plane to avoid artifacts. + plx_mat_tfip_3d(x, y, z); + if (z <= 0.00001f) z = 0.00001f; + + // Draw it. + plx_vert_ind(state, PLX_VERT, x, y+1.0f, z, col); + plx_vert_ind(state, PLX_VERT, x, y, z, col); + plx_vert_ind(state, PLX_VERT, x+1.0f, y+1.0f, z, col); + plx_vert_ind(state, PLX_VERT_EOS, x+1.0f, y, z, col); +} + + +pvr_init_params_t params = { + /* Enable opaque and translucent polygons with size 16 */ + { PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_0 }, + + /* Vertex buffer size 512K */ + 512*1024 +}; + +#define NOT_LAST (!(state->buttons & last)) + +int main(int argc, char **argv) { + + /* Controller Stuff */ + maple_device_t * dev; + cont_state_t * state; + uint32 last = CONT_A; + + xrot = yrot = zrot = 0.0f; + xspeed = yspeed = zspeed = 0.0f; + + uint32 color = 0; + plx_dr_state_t dr_state; + + float tx, ty, tz; /* Temp X, Y & Z Variables */ + vertex q; /* Holds Returned Calculated Values For One Vertex */ + int i; /* Simple Looping Variable */ + + /* Init PVR API */ + if (pvr_init(¶ms) < 0) + return -1; + + printControls(); + + /* Sets the background color to black */ + pvr_set_bg_color(0.0f, 0.0f, 0.0f); + + plx_cxt_init(); // Initialize the plx context system + plx_cxt_texture(NULL); // No texture will be used with the context system + plx_cxt_culling(PLX_CULL_NONE); // No Culling + + // GET SOME 3D GOING!! + plx_mat3d_init(); /* Clear internal to an identity matrix */ + plx_mat3d_mode(PLX_MAT_PROJECTION); /** Projection (frustum, screenview) matrix */ + plx_mat3d_identity(); /** Load an identity matrix */ + plx_mat3d_perspective(45.0f, 640.0f / 480.0f, 0.1f, 100.0f); // (float angle, float aspect, float znear, float zfar); + plx_mat3d_mode(PLX_MAT_MODELVIEW); /** Modelview (rotate, scale) matrix */ + + /* Sets Max Vertices To 0 By Default */ + maxver = 0; + /* Load The First Object Into morph1 From File sphere.bin */ + objload( "/rd/sphere.bin", &morph1 ); + /* Load The Second Object Into morph2 From File torus.bin */ + objload( "/rd/torus.bin", &morph2 ); + /* Load The Third Object Into morph3 From File tube.bin */ + objload( "/rd/tube.bin", &morph3 ); + + /* Manually Reserve Ram For A 4th 486 Vertice Object (morph4) */ + objallocate( &morph4, 486 ); + + /* Loop Through All 468 Vertices */ + for( i = 0; i < 486; i++ ) { + /* Generate a random point in xyz space for each vertex */ + /* Values range from -7 to 7 */ + morph4.points[i].x = (( float )( rand( ) % 14000 ) / 1000 ) - 7; + morph4.points[i].y = (( float )( rand( ) % 14000 ) / 1000 ) - 7; + morph4.points[i].z = (( float )( rand( ) % 14000 ) / 1000 ) - 7; + } + + /* Load sphere.txt Object Into Helper (Used As Starting Point) */ + objload( "/rd/sphere.bin", &helper ); + /* Source & Destination Are Set To Equal First Object (morph1) */ + sour = dest = &morph1; + + while(1) { + + // Check for the user pressing START + dev = maple_enum_dev(0, 0); + if(dev == NULL) { + printf("Error: Could not find controller in first port.\n"); + break; + } + state = (cont_state_t *)maple_dev_status(dev); + if (state->buttons & CONT_START) { + break; // exit the program + } + if (state->buttons & CONT_X && !morph && NOT_LAST) { + morph = 1; // morph to torus + dest = &morph2; + last = CONT_X; + } + if (state->buttons & CONT_Y && !morph && NOT_LAST) { + morph = 1; // morph to tube + dest = &morph3; + last = CONT_Y; + } + if (state->buttons & CONT_A && !morph && NOT_LAST) { + morph = 1; // morph to sphere + dest = &morph1; + last = CONT_A; + } + if (state->buttons & CONT_B && !morph && NOT_LAST) { + morph = 1; // morph to space + dest = &morph4; + last = CONT_B; + } + if (state->buttons & CONT_DPAD_UP) { + xspeed -= 0.01f; // decrease x rotation speed (away from you) + } + if (state->buttons & CONT_DPAD_DOWN) { + xspeed += 0.01f; // increase x rotation speed (toward you) + } + if (state->buttons & CONT_DPAD_LEFT) { + yspeed -= 0.01f; // decrease y rotation speed (left) + } + if (state->buttons & CONT_DPAD_RIGHT) { + yspeed += 0.01f; // increase y rotation speed (right) + } + if (state->rtrig) { + zspeed += 0.01f; // increase z rotation speed (CCW) + } + if (state->ltrig) { + zspeed -= 0.01f; // decrease z rotation speed (CW) + } + + pvr_wait_ready(); + pvr_scene_begin(); + + pvr_list_begin(PVR_LIST_OP_POLY); + plx_cxt_send(PVR_LIST_OP_POLY); // Submit the Header for PVR_LIST_OP_POLY + + plx_dr_init(&dr_state); // Initialize a state variable for Direct Rendering + + plx_mat3d_identity(); + plx_mat3d_translate(cx, cy, cz); + plx_mat3d_rotate(xrot, 1.0f, 0.0f, 0.0f); // Rotate the Shape by angle 'xrot' on the X axis + plx_mat3d_rotate(yrot, 0.0f, 1.0f, 0.0f); // Rotate the Shape by angle 'yrot' on the Y axis + plx_mat3d_rotate(zrot, 0.0f, 0.0f, 1.0f); // Rotate the Shape by angle 'zrot' on the Z axis + + /* Clear internal to an identity matrix */ + plx_mat_identity(); + + /* "Applying" all matrixs: multiply a matrix onto the "internal" one */ + plx_mat3d_apply_all(); + + /* Increase xrot,yrot & zrot by xspeed, yspeed & zspeed */ + xrot += xspeed; + yrot += yspeed; + zrot += zspeed; + + /* Loop Through All The Verts Of morph1 (All Objects Have + * * The Same Amount Of Verts For Simplicity, Could Use maxver Also) + * */ + for( i = 0; i < morph1.verts; i++ ) { + /* If morph Is True Calculate Movement Otherwise Movement=0 */ + if ( morph ) + q = calculate( i ); + else + q.x = q.y = q.z = 0.0f; + + /* Subtract the calculated unitx from the point's xyz coords */ + helper.points[i].x -= q.x; + helper.points[i].y -= q.y; + helper.points[i].z -= q.z; + + /* Set the temp xyz vars the the helper's xyz vars */ + tx = helper.points[i].x; + ty = helper.points[i].y; + tz = helper.points[i].z; + + /* Set Color To A Bright Shade Of Off Blue */ + color = plx_pack_color(1.0f, 0.0f, 1.0f, 1.0f); + /* Draw A Point At The Current Temp Values (Vertex) */ + drawpnt(&dr_state, tx, ty, tz, color); + + /* Calculate Two Positions Ahead */ + tx -= 2.0f * q.x; + ty -= 2.0f * q.y; + tz -= 2.0f * q.z; + + /* Darken Color A Bit */ + color = plx_pack_color(1.0f, 0.0f, 0.5f, 1.0f); + /* Draw A Second Point At The Newly Calculate Position */ + drawpnt(&dr_state, tx, ty, tz, color); + + /* Calculate Two More Positions Ahead */ + tx -= 2.0f * q.x; + ty -= 2.0f * q.y; + tz -= 2.0f * q.z; + + /* Set Color To A Very Dark Blue */ + color = plx_pack_color(1.0f, 0.0f, 0.0f, 1.0f); + /* Draw A Third Point At The Second New Position */ + drawpnt(&dr_state, tx, ty, tz, color); + + } + + /* If We're Morphing And We Haven't Gone Through All 200 Steps + * Increase Our Step Counter + * Otherwise Set Morphing To False, Make Source=Destination And + * Set The Step Counter Back To Zero. + */ + + if( morph && step <= steps ) { + step++; + } + else { + morph = 0; + step = 0; + sour = dest; + } + + pvr_scene_finish(); + } + // Clean Up!!! + Quit(); + + return 0; +} + + + + + + + + diff --git a/POWERVR/SRCS/NeHe/Lesson25/romdisk/sphere.bin b/POWERVR/SRCS/NeHe/Lesson25/romdisk/sphere.bin new file mode 100644 index 00000000..6b6db530 Binary files /dev/null and b/POWERVR/SRCS/NeHe/Lesson25/romdisk/sphere.bin differ diff --git a/POWERVR/SRCS/NeHe/Lesson25/romdisk/torus.bin b/POWERVR/SRCS/NeHe/Lesson25/romdisk/torus.bin new file mode 100644 index 00000000..da95c893 Binary files /dev/null and b/POWERVR/SRCS/NeHe/Lesson25/romdisk/torus.bin differ diff --git a/POWERVR/SRCS/NeHe/Lesson25/romdisk/tube.bin b/POWERVR/SRCS/NeHe/Lesson25/romdisk/tube.bin new file mode 100644 index 00000000..988bc75d Binary files /dev/null and b/POWERVR/SRCS/NeHe/Lesson25/romdisk/tube.bin differ diff --git a/POWERVR/SRCS/NeHe/Lesson27/Makefile b/POWERVR/SRCS/NeHe/Lesson27/Makefile new file mode 100644 index 00000000..bdcafa96 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson27/Makefile @@ -0,0 +1 @@ +include Makefile.dc \ No newline at end of file diff --git a/POWERVR/SRCS/NeHe/Lesson27/Makefile.dc b/POWERVR/SRCS/NeHe/Lesson27/Makefile.dc new file mode 100644 index 00000000..2a7dfa80 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson27/Makefile.dc @@ -0,0 +1,32 @@ +# +# PLX Lesson 27 +# +# + +TARGET = dcp.elf +OBJS = main.o + +all: rm-elf $(TARGET) + +include $(KOS_BASE)/Makefile.rules + +clean: + -rm -f $(TARGET) $(OBJS) romdisk.* +rm-elf: + -rm -f $(TARGET) romdisk.* + +$(TARGET): $(OBJS) romdisk.o + kos-c++ -o $(TARGET) $(OBJS)romdisk.o -lparallax -lpng -ljpeg -lkmg -lz -lkosutils -lm + +romdisk.img: + $(KOS_GENROMFS) -f romdisk.img -d romdisk -v + +romdisk.o: romdisk.img + $(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o + +run: $(TARGET) + $(KOS_LOADER) $(TARGET) + +dist: + rm -f $(OBJS) romdisk.o romdisk.img + $(KOS_STRIP) $(TARGET) diff --git a/POWERVR/SRCS/NeHe/Lesson27/main.c b/POWERVR/SRCS/NeHe/Lesson27/main.c new file mode 100644 index 00000000..3ad04301 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson27/main.c @@ -0,0 +1,343 @@ + +#include +#include +#include +#include +#include +#include + +extern uint8 romdisk[]; +KOS_INIT_FLAGS(INIT_DEFAULT | INIT_MALLOCSTATS); +KOS_INIT_ROMDISK(romdisk); + +void printControls() { + printf("\n/**********Controls**********/\n"); + printf("START-Button: Exits program \n"); + printf("X-Button: NONE \n"); + printf("Y-Button: NONE \n"); + printf("A-Button: Toggles displaying the control point grid \n"); + printf("B-Button: NONE \n"); + + printf("UP-Dir: Increase Smoothness \n"); + printf("DOWN-Dir: Decrease Smoothness \n"); + printf("LEFT-Dir: Rotate to the left \n"); + printf("RIGHT-Dir: Rotate to the right \n"); + printf("/****************************/\n\n"); +} + +typedef struct point_3d { // Structure for a 3-dimensional point + double x, y, z; +} POINT_3D; + +typedef struct bpatch { // Structure for a 3rd degree bezier patch + POINT_3D anchors[4][4]; // 4x4 grid of anchor points + plx_texture_t *texture; // Texture for the patch +} BEZIER_PATCH; + +float rotz = 0.0f; // Rotation about the Z axis +BEZIER_PATCH mybezier; // The bezier patch we're going to use +int showCPoints = 1; // Toggles displaying the control point grid +int divs = 3; // Number of intrapolations (conrols poly resolution) +plx_dr_state_t dr_state; +pvr_vertex_t vertices[313]; // Holds 312 vertices +int vgenBezier = 0; // Generate new Bezier (True or False) +int vertnumBezier = 0; // Holds the amount of vertices of the Bezier + +// Adds 2 points. Don't just use '+' ;) +POINT_3D pointAdd(POINT_3D p, POINT_3D q) { + p.x += q.x; p.y += q.y; p.z += q.z; + return p; +} + +// Multiplies a point and a constant. Don't just use '*' +POINT_3D pointTimes(double c, POINT_3D p) { + p.x *= c; p.y *= c; p.z *= c; + return p; +} + +// Function for quick point creation +POINT_3D makePoint(double a, double b, double c) { + POINT_3D p; + p.x = a; p.y = b; p.z = c; + return p; +} +// !!!!!!!!!!!!!!!!!!!!need math.h +// Calculates 3rd degree polynomial based on array of 4 points +// and a single variable (u) which is generally between 0 and 1 +POINT_3D Bernstein(float u, POINT_3D *p) { + POINT_3D a, b, c, d, r; + + a = pointTimes(pow(u,3), p[0]); + b = pointTimes(3*pow(u,2)*(1-u), p[1]); + c = pointTimes(3*u*pow((1-u),2), p[2]); + d = pointTimes(pow((1-u),3), p[3]); + + r = pointAdd(pointAdd(a, b), pointAdd(c, d)); + + return r; +} + +// Generates vertices based on the data in the patch +// and the number of divisions +void genBezier(BEZIER_PATCH patch, int divs) { + int u = 0, v, i = 0; + float py, px, pyold; + POINT_3D temp[4]; + POINT_3D *last = (POINT_3D*)malloc(sizeof(POINT_3D)*(divs+1)); // array of points to mark the first line of polys + + temp[0] = patch.anchors[0][3]; // the first derived curve (along x axis) + temp[1] = patch.anchors[1][3]; + temp[2] = patch.anchors[2][3]; + temp[3] = patch.anchors[3][3]; + + for (v = 0; v <= divs; v++) { // create the first line of points + px = ((float)v)/((float)divs); // percent along y axis + // use the 4 points from the derives curve to calculate the points along that curve + last[v] = Bernstein(px, temp); + } + + for (u = 1;u <= divs;u++) { + py = ((float)u)/((float)divs); // Percent along Y axis + pyold = ((float)u-1.0f)/((float)divs); // Percent along old Y axis + + temp[0] = Bernstein(py, patch.anchors[0]); // Calculate new bezier points + temp[1] = Bernstein(py, patch.anchors[1]); + temp[2] = Bernstein(py, patch.anchors[2]); + temp[3] = Bernstein(py, patch.anchors[3]); + + for (v = 0;v <= divs; v++) { + px = ((float)v)/((float)divs); // Percent along the X axis + + vertices[i].flags = PLX_VERT; + vertices[i].x = last[v].x; + vertices[i].y = last[v].y; + vertices[i].z = last[v].z; + vertices[i].u = pyold; + vertices[i].v = px; + + i++; + + last[v] = Bernstein(px, temp); // Generate new point + + vertices[i].flags = PLX_VERT; + vertices[i].x = last[v].x; + vertices[i].y = last[v].y; + vertices[i].z = last[v].z; + vertices[i].u = py; + vertices[i].v = px; + + i++; + } + } + vertnumBezier = i; + vertices[--i].flags = PLX_VERT_EOS; + free(last); // Free the old vertices array + return; +} + +/************************************************************************************/ + +void initBezier(void) { + mybezier.anchors[0][0] = makePoint(-0.75, -0.75, -0.5); // set the bezier vertices + mybezier.anchors[0][1] = makePoint(-0.25, -0.75, 0.0); + mybezier.anchors[0][2] = makePoint(0.25, -0.75, 0.0); + mybezier.anchors[0][3] = makePoint(0.75, -0.75, -0.5); + + mybezier.anchors[1][0] = makePoint(-0.75, -0.25, -0.75); + mybezier.anchors[1][1] = makePoint(-0.25, -0.25, 0.5); + mybezier.anchors[1][2] = makePoint(0.25, -0.25, 0.5); + mybezier.anchors[1][3] = makePoint(0.75, -0.25, -0.75); + + mybezier.anchors[2][0] = makePoint(-0.75, 0.25, 0.0); + mybezier.anchors[2][1] = makePoint(-0.25, 0.25, -0.5); + mybezier.anchors[2][2] = makePoint(0.25, 0.25, -0.5); + mybezier.anchors[2][3] = makePoint(0.75, 0.25, 0.0); + + mybezier.anchors[3][0] = makePoint(-0.75, 0.75, -0.5); + mybezier.anchors[3][1] = makePoint(-0.25, 0.75, -1.0); + mybezier.anchors[3][2] = makePoint(0.25, 0.75, -1.0); + mybezier.anchors[3][3] = makePoint(0.75, 0.75, -0.5); +} + +// Taken from: C:\cygwin\usr\local\dc\kos\kos\examples\dreamcast\parallax\delay_cube\delay_cube.c +// and modified to draw a line instead of a point. +void drawline(plx_dr_state_t * state, POINT_3D vertex1, POINT_3D vertex2, uint32 col) { + + pvr_poly_hdr_t Line_Header; + pvr_poly_cxt_t Line_context; + + pvr_poly_cxt_col(&Line_context, PVR_LIST_OP_POLY); + Line_context.gen.culling = PVR_CULLING_NONE; + pvr_poly_compile(&Line_Header, &Line_context); // Convert the context into something the pvr can read + pvr_prim(&Line_Header, sizeof(pvr_poly_hdr_t)); // Submit image header to PVR + + // Transform the vector points, + plx_mat_tfip_3d(vertex1.x, vertex1.y, vertex1.z); + plx_mat_tfip_3d(vertex2.x, vertex2.y, vertex2.z); + + // Draw it. + plx_vert_ind(state, PLX_VERT, vertex1.x, vertex1.y+2.0f, vertex1.z, col); + plx_vert_ind(state, PLX_VERT, vertex1.x, vertex1.y, vertex1.z, col); + plx_vert_ind(state, PLX_VERT, vertex2.x+2.0f, vertex2.y+2.0f, vertex2.z, col); + plx_vert_ind(state, PLX_VERT_EOS, vertex2.x+2.0f, vertex2.y, vertex2.z, col); + +} + +void drawBezier() { + int i = 0; + + while(i != vertnumBezier) { + // Submit the vertex one at a time + plx_vert_ifdm3(&dr_state, vertices[i].flags, vertices[i].x, vertices[i].y, vertices[i].z, 0xffffffff, vertices[i].u, vertices[i].v); + i++; + } +} + + +pvr_init_params_t params = { + /* Enable opaque and translucent polygons with size 16 */ + { PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_0 }, + + /* Vertex buffer size 512K */ + 512*1024 +}; + +int main(int argc, char **argv) { + + /* Controller Stuff */ + maple_device_t * dev; + cont_state_t * state; + int ap = 0; // False (True or False: Pressed A button last) Toggles displaying the control point grid + int up = 0; // False (True or False: Pressed up button last) Increase smoothness + int dp = 0; // False (True or False: Pressed down button last) Decrease smoothness + + int i = 0; + uint32 color = 0; + + /* Init PVR API */ + if (pvr_init(¶ms) < 0) + return -1; + + printControls(); + + /* Sets the background color to green */ + pvr_set_bg_color(0.0f, 1.0f, 0.0f); + + initBezier(); // Initialize the Bezier's control grid + mybezier.texture = plx_txr_load("/rd/logo.png", 0, PVR_TXRLOAD_16BPP | PVR_TXRLOAD_INVERT_Y); // Load the texture + genBezier(mybezier, divs); // Generate Bezier + + plx_cxt_init(); // Initialize the plx context system + plx_cxt_texture(mybezier.texture); // Use texture 'mybezier.texture' with the context system + plx_cxt_culling(PLX_CULL_NONE); // No Culling + + // GET SOME 3D GOING!! + plx_mat3d_init(); /* Clear internal to an identity matrix */ + plx_mat3d_mode(PLX_MAT_PROJECTION); /** Projection (frustum, screenview) matrix */ + plx_mat3d_identity(); /** Load an identity matrix */ + plx_mat3d_perspective(45.0f, 640.0f / 480.0f, 0.1f, 100.0f); // (float angle, float aspect, float znear, float zfar); + plx_mat3d_mode(PLX_MAT_MODELVIEW); /** Modelview (rotate, scale) matrix */ + + while(1) { + + /* Check key status */ + dev = maple_enum_dev(0, 0); + if(dev == NULL) { + printf("Error: Could not find controller in first port.\n"); + break; + } + state = (cont_state_t *)maple_dev_status(dev); + if (state->buttons & CONT_START) { + break; // exit the program + } + if (state->buttons & CONT_A && !ap) { + ap = 1; + showCPoints = !showCPoints; // Toggles displaying the control point grid + } + if (!(state->buttons & CONT_A)) { + ap = 0; + } + if (state->buttons & CONT_DPAD_UP && !up) { + up = 1; + divs++; // Increase smoothness + if(divs > 12) { + divs = 12; + } + vgenBezier = !vgenBezier; + } + if (!(state->buttons & CONT_DPAD_UP)) { + up = 0; + } + if (state->buttons & CONT_DPAD_DOWN && !dp) { + dp = 1; + divs--; // Decrease smoothness + if(divs < 1) { + divs = 1; + } + vgenBezier = !vgenBezier; + } + if (!(state->buttons & CONT_DPAD_DOWN)) { + dp = 0; + } + if (state->buttons & CONT_DPAD_LEFT) { + rotz -= 0.8f; // Rotate left + } + if (state->buttons & CONT_DPAD_RIGHT) { + rotz += 0.8f; // Rotate right + } + + if(vgenBezier) { + genBezier(mybezier, divs); // Generate new Bezier) + vgenBezier = !vgenBezier; + } + + pvr_wait_ready(); + pvr_scene_begin(); + + pvr_list_begin(PVR_LIST_OP_POLY); + plx_cxt_send(PVR_LIST_OP_POLY); // Submit the Header for PVR_LIST_OP_POLY + + plx_dr_init(&dr_state); // Initialize a state variable for Direct Rendering + + plx_mat3d_identity(); + plx_mat3d_translate(0.0f, 0.0f, -4.0f); // Move 4 units into the screen + plx_mat3d_rotate(-75.0f, 1.0f, 0.0f, 0.0f); // Rotate -75 degrees on the X-Axis + plx_mat3d_rotate(rotz, 0.0f, 0.0f, 1.0f); // Rotate 'rotz' degrees on the Z-Axis + + /* Clear internal to an identity matrix */ + plx_mat_identity(); + + /* "Applying" all matrixs: multiply a matrix onto the "internal" one */ + plx_mat3d_apply_all(); + + drawBezier(); + + if (showCPoints) { // If drawing the grid is toggled on + + color = plx_pack_color(1.0f, 1.0f, 0.0f, 0.0f); // Red colored lines + for(i = 0; i < 4; i++) { + // draw the horizontal lines + drawline(&dr_state, mybezier.anchors[i][0], mybezier.anchors[i][1], color); + drawline(&dr_state, mybezier.anchors[i][1], mybezier.anchors[i][2], color); + drawline(&dr_state, mybezier.anchors[i][2], mybezier.anchors[i][3], color); + } + for(i = 0; i < 4; i++) { + // draw the vertical lines + drawline(&dr_state, mybezier.anchors[0][i], mybezier.anchors[1][i], color); + drawline(&dr_state, mybezier.anchors[1][i], mybezier.anchors[2][i], color); + drawline(&dr_state, mybezier.anchors[2][i], mybezier.anchors[3][i], color); + } + color = plx_pack_color(1.0f, 1.0f,1.0f,1.0f); + } + + pvr_scene_finish(); + } + // Clean up!!! + plx_txr_destroy(mybezier.texture); + + return 0; +} + + + + diff --git a/POWERVR/SRCS/NeHe/Lesson27/romdisk/Thumbs.db b/POWERVR/SRCS/NeHe/Lesson27/romdisk/Thumbs.db new file mode 100644 index 00000000..37f734b4 Binary files /dev/null and b/POWERVR/SRCS/NeHe/Lesson27/romdisk/Thumbs.db differ diff --git a/POWERVR/SRCS/NeHe/Lesson27/romdisk/logo.png b/POWERVR/SRCS/NeHe/Lesson27/romdisk/logo.png new file mode 100644 index 00000000..1beeec34 Binary files /dev/null and b/POWERVR/SRCS/NeHe/Lesson27/romdisk/logo.png differ diff --git a/POWERVR/SRCS/NeHe/Lesson3/Makefile b/POWERVR/SRCS/NeHe/Lesson3/Makefile new file mode 100644 index 00000000..bdcafa96 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson3/Makefile @@ -0,0 +1 @@ +include Makefile.dc \ No newline at end of file diff --git a/POWERVR/SRCS/NeHe/Lesson3/Makefile.dc b/POWERVR/SRCS/NeHe/Lesson3/Makefile.dc new file mode 100644 index 00000000..f66159f2 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson3/Makefile.dc @@ -0,0 +1,31 @@ +# +# PLX Lesson 3 +# +# + +TARGET = dcp.elf +OBJS = main.o + +all: rm-elf $(TARGET) + +include $(KOS_BASE)/Makefile.rules + +clean: + -rm -f $(TARGET) $(OBJS) +rm-elf: + -rm -f $(TARGET) +$(TARGET): $(OBJS) + kos-c++ -o $(TARGET) $(OBJS) -lparallax -lz -lkosutils -lm + +#romdisk.img: +# $(KOS_GENROMFS) -f romdisk.img -d romdisk -v + +#romdisk.o: romdisk.img +# $(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o + +run: $(TARGET) + $(KOS_LOADER) $(TARGET) + +dist: + rm -f $(OBJS) romdisk.o romdisk.img + $(KOS_STRIP) $(TARGET) diff --git a/POWERVR/SRCS/NeHe/Lesson3/main.c b/POWERVR/SRCS/NeHe/Lesson3/main.c new file mode 100644 index 00000000..cacb5e89 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson3/main.c @@ -0,0 +1,122 @@ + + +#include +#include +#include +#include + +KOS_INIT_FLAGS(INIT_DEFAULT | INIT_MALLOCSTATS); + +void printControls() { + printf("\n/**********Controls**********/\n"); + printf("START-Button: Exits program\n"); + printf("X-Button: NONE \n"); + printf("Y-Button: NONE \n"); + printf("A-Button: NONE \n"); + printf("B-Button: NONE \n"); + + printf("UP-Dir: NONE \n"); + printf("DOWN-Dir: NONE \n"); + printf("LEFT-Dir: NONE \n"); + printf("RIGHT-Dir: NONE \n"); + printf("/****************************/\n\n"); +} + +pvr_init_params_t params = { + /* Enable opaque and translucent polygons with size 16 */ + { PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_0 }, + + /* Vertex buffer size 512K */ + 512*1024 +}; + +int main(int argc, char **argv) { + + /* Controller Stuff */ + maple_device_t * dev; + cont_state_t * state; + + int rquad = 0; + int rtri = 0; + + /* Init PVR API */ + if (pvr_init(¶ms) < 0) + return -1; + + printControls(); + + /* Sets the background color to black */ + pvr_set_bg_color(0.0f, 0.0f, 0.0f); + + plx_cxt_init(); // Initialize the plx context system + plx_cxt_texture(NULL); // No texture will be used + plx_cxt_culling(PLX_CULL_NONE); // No culling + + // GET SOME 3D GOING!! + /* Init matrices */ + plx_mat3d_init(); /* Clear internal to an identity matrix */ + plx_mat3d_mode(PLX_MAT_PROJECTION); /** Projection (frustum, screenview) matrix */ + plx_mat3d_identity(); /** Load an identity matrix */ + plx_mat3d_perspective(45.0f, 640.0f / 480.0f, 0.1f, 100.0f); // (float angle, float aspect, float znear, float zfar); + plx_mat3d_mode(PLX_MAT_MODELVIEW); /** Modelview (rotate, scale) matrix */ + + while(1) { + + // Check for the user pressing START + dev = maple_enum_dev(0, 0); + if(dev == NULL) { + printf("Error: Could not find controller in first port.\n"); + break; + } + state = (cont_state_t *)maple_dev_status(dev); + if (state->buttons & CONT_START) { + break; // exit the program + } + + pvr_wait_ready(); + pvr_scene_begin(); + pvr_list_begin(PVR_LIST_OP_POLY); + + // Submit the context + plx_cxt_send(PVR_LIST_OP_POLY); // Submit the Header for PVR_LIST_OP_POLY + + // DRAW THE TRIANGLE + plx_mat3d_identity(); + plx_mat3d_translate(-1.5f, 0.0f, -6.0f); // Move 1.5f units to the left and 6 units into the screen + plx_mat3d_rotate(rtri, 0.0f, 1.0f, 0.0f); // Rotate the triangle angle 'rtri' on the Y axis + + /* Clear internal to an identity matrix */ + plx_mat_identity(); + + /* "Applying" all matrixs: multiply a matrix onto the "internal" one */ + plx_mat3d_apply_all(); + + plx_vert_inpm3(PLX_VERT, 0, 1, 0, plx_pack_color(1.0f, 1.0f, 0.0f, 0.0f)); // Top (Color = Red) + plx_vert_inpm3(PLX_VERT, -1, -1, 0, plx_pack_color(1.0f, 0.0f, 1.0f, 0.0f)); // Bottom Left (Color = Green) + plx_vert_inpm3(PLX_VERT_EOS, 1, -1, 0, plx_pack_color(1.0f, 0.0f, 0.0f, 1.0f)); // Bottom Right (Color = Blue) + + // DRAW THE QUAD + plx_mat3d_identity(); + plx_mat3d_translate(1.5f, 0.0f, -6.0f); // Move 1.5f units to the right and 6 units into the screen + plx_mat3d_rotate(rquad, 1.0f, 0.0f, 0.0f); // Rotate the quad angle 'rquad' on the X axis + + /* Clear internal to an identity matrix */ + plx_mat_identity(); + + /* "Applying" all matrixs: multiply a matrix onto the "internal" one */ + plx_mat3d_apply_all(); + + plx_vert_inpm3(PLX_VERT, -1, 1, 0, plx_pack_color(1.0f, 0.5f, 0.5f, 1.0f)); // Bottom Left (Color = Bluish) + plx_vert_inpm3(PLX_VERT, -1, -1, 0, plx_pack_color(1.0f, 0.5f, 0.5f, 1.0f)); // Top Left (Color = Bluish) + plx_vert_inpm3(PLX_VERT, 1, 1, 0, plx_pack_color(1.0f, 0.5f, 0.5f, 1.0f)); // Bottom Right (Color = Bluish) + plx_vert_inpm3(PLX_VERT_EOS, 1, -1, 0, plx_pack_color(1.0f, 0.5f, 0.5f, 1.0f)); // Top Right (Color = Bluish) + + pvr_scene_finish(); + + rquad -= 2.0f; // Increases the quad's rotation angle + rtri += 2.0f; // Increases the triangle's rotation angle + } + + return 0; +} + diff --git a/POWERVR/SRCS/NeHe/Lesson30/Makefile b/POWERVR/SRCS/NeHe/Lesson30/Makefile new file mode 100644 index 00000000..bdcafa96 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson30/Makefile @@ -0,0 +1 @@ +include Makefile.dc \ No newline at end of file diff --git a/POWERVR/SRCS/NeHe/Lesson30/Makefile.dc b/POWERVR/SRCS/NeHe/Lesson30/Makefile.dc new file mode 100644 index 00000000..fde6ac00 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson30/Makefile.dc @@ -0,0 +1,33 @@ +# +# PLX Lesson 30 +# +# + +TARGET = dcp.elf +OBJS = main.o Model.o MilkshapeModel.o + +all: rm-elf $(TARGET) + +include $(KOS_BASE)/Makefile.rules + +clean: + -rm -f $(TARGET) $(OBJS) romdisk.* +rm-elf: + -rm -f $(TARGET) romdisk.* + +$(TARGET): $(OBJS) romdisk.o + $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ + $(OBJS) romdisk.o $(OBJEXTRA) -lstdc++ -lk++ -lparallax -lpng -ljpeg -lkmg -lz -lm -lkosutils $(KOS_LIBS) + +romdisk.img: + $(KOS_GENROMFS) -f romdisk.img -d romdisk -v + +romdisk.o: romdisk.img + $(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o + +run: $(TARGET) + $(KOS_LOADER) $(TARGET) + +dist: + rm -f $(OBJS) romdisk.o romdisk.img + $(KOS_STRIP) $(TARGET) diff --git a/POWERVR/SRCS/NeHe/Lesson30/MilkshapeModel.cpp b/POWERVR/SRCS/NeHe/Lesson30/MilkshapeModel.cpp new file mode 100644 index 00000000..7b8abc97 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson30/MilkshapeModel.cpp @@ -0,0 +1,222 @@ +/* + MilkshapeModel.cpp + + Loads and renders a Milkshape3D model. + + Author: Brett Porter + Email: brettporter@yahoo.com + Website: http://www.geocities.com/brettporter/ + Copyright (C)2000, Brett Porter. All Rights Reserved. + + This file may be used only as long as this copyright notice remains intact. +*/ + +#include "MilkshapeModel.h" +using namespace std; + +MilkshapeModel::MilkshapeModel() +{ +} + +MilkshapeModel::~MilkshapeModel() +{ +} + +/* + MS3D STRUCTURES +*/ + +// byte-align structures +#ifdef _MSC_VER +# pragma pack( push, packing ) +# pragma pack( 1 ) +# define PACK_STRUCT +#elif defined( __GNUC__ ) +# define PACK_STRUCT __attribute__((packed)) +#else +# error you must byte-align these structures with the appropriate compiler directives +#endif + +typedef unsigned char byte; +typedef unsigned short word; + +/* The following function is a fix created by BlueCrab so this lesson will work on the + * Dreamcast and NullDC. Thanks BlueCrab. It is used to replace *( word* )pPtr; */ +static inline word read_word(const char *ptr) { + return ((word)(*ptr)) | (((word) *(ptr + 1)) << 8); +} + +// File header +struct MS3DHeader +{ + char m_ID[10]; + int m_version; +} PACK_STRUCT; + +// Vertex information +struct MS3DVertex +{ + byte m_flags; + float m_vertex[3]; + char m_boneID; + byte m_refCount; +} PACK_STRUCT; + +// Triangle information +struct MS3DTriangle +{ + word m_flags; + word m_vertexIndices[3]; + float m_vertexNormals[3][3]; + float m_s[3], m_t[3]; + byte m_smoothingGroup; + byte m_groupIndex; +} PACK_STRUCT; + +// Material information +struct MS3DMaterial +{ + char m_name[32]; + float m_ambient[4]; + float m_diffuse[4]; + float m_specular[4]; + float m_emissive[4]; + float m_shininess; // 0.0f - 128.0f + float m_transparency; // 0.0f - 1.0f + byte m_mode; // 0, 1, 2 is unused now + char m_texture[128]; + char m_alphamap[128]; +} PACK_STRUCT; + +// Joint information +struct MS3DJoint +{ + byte m_flags; + char m_name[32]; + char m_parentName[32]; + float m_rotation[3]; + float m_translation[3]; + word m_numRotationKeyframes; + word m_numTranslationKeyframes; +} PACK_STRUCT; + +// Keyframe data +struct MS3DKeyframe +{ + float m_time; + float m_parameter[3]; +} PACK_STRUCT; + +// Default alignment +#ifdef _MSC_VER +# pragma pack( pop, packing ) +#endif + +#undef PACK_STRUCT + +bool MilkshapeModel::loadModelData( const char *filename ) +{ + ifstream inputFile( filename, ios::in | ios::binary ); + if ( inputFile.fail()) { + return false; // "Couldn't open the model file." + } + inputFile.seekg( 0, ios::end ); + long fileSize = inputFile.tellg(); + inputFile.seekg( 0, ios::beg ); + + char *pBuffer = new char[fileSize]; + inputFile.read( pBuffer, fileSize ); + inputFile.close(); + + const char *pPtr = pBuffer; + MS3DHeader *pHeader = ( MS3DHeader* )pPtr; + pPtr += sizeof( MS3DHeader ); + + if ( strncmp( pHeader->m_ID, "MS3D000000", 10 ) != 0 ) + return false; // "Not a valid Milkshape3D model file." + + if ( pHeader->m_version < 3 || pHeader->m_version > 4 ) + return false; // "Unhandled file version. Only Milkshape3D Version 1.3 and 1.4 is supported." ); + + int nVertices = read_word(pPtr); //*( word* )pPtr; + m_numVertices = nVertices; + m_pVertices = new Vertex[nVertices]; + pPtr += sizeof( word ); + + int i; + for ( i = 0; i < nVertices; i++ ) + { + MS3DVertex *pVertex = ( MS3DVertex* )pPtr; + m_pVertices[i].m_boneID = pVertex->m_boneID; + memcpy( m_pVertices[i].m_location, pVertex->m_vertex, sizeof( float )*3 ); + pPtr += sizeof( MS3DVertex ); + } + + int nTriangles = read_word(pPtr); // *( word* )pPtr; + m_numTriangles = nTriangles; + m_pTriangles = new Triangle[nTriangles]; + pPtr += sizeof( word ); + + for ( i = 0; i < nTriangles; i++ ) + { + MS3DTriangle *pTriangle = ( MS3DTriangle* )pPtr; + int vertexIndices[3] = { pTriangle->m_vertexIndices[0], pTriangle->m_vertexIndices[1], pTriangle->m_vertexIndices[2] }; + float t[3] = { 1.0f-pTriangle->m_t[0], 1.0f-pTriangle->m_t[1], 1.0f-pTriangle->m_t[2] }; + memcpy( m_pTriangles[i].m_vertexNormals, pTriangle->m_vertexNormals, sizeof( float )*3*3 ); + memcpy( m_pTriangles[i].m_s, pTriangle->m_s, sizeof( float )*3 ); + memcpy( m_pTriangles[i].m_t, t, sizeof( float )*3 ); + memcpy( m_pTriangles[i].m_vertexIndices, vertexIndices, sizeof( int )*3 ); + pPtr += sizeof( MS3DTriangle ); + } + + int nGroups = read_word(pPtr); // *( word* )pPtr; + m_numMeshes = nGroups; + m_pMeshes = new Mesh[nGroups]; + pPtr += sizeof( word ); + + for ( i = 0; i < nGroups; i++ ) + { + pPtr += sizeof( byte ); // flags + pPtr += 32; // name + + word nTriangles = read_word(pPtr); // *( word* )pPtr; + + pPtr += sizeof( word ); + int *pTriangleIndices = new int[nTriangles]; + for ( int j = 0; j < nTriangles; j++ ) + { + pTriangleIndices[j] = read_word(pPtr); // *( word* )pPtr; + pPtr += sizeof( word ); + } + + char materialIndex = *( char* )pPtr; + pPtr += sizeof( char ); + + m_pMeshes[i].m_materialIndex = materialIndex; + m_pMeshes[i].m_numTriangles = nTriangles; + m_pMeshes[i].m_pTriangleIndices = pTriangleIndices; + } + int nMaterials = *( word* )pPtr; + m_numMaterials = nMaterials; + m_pMaterials = new Material[nMaterials]; + pPtr += sizeof( word ); + for ( i = 0; i < nMaterials; i++ ) + { + MS3DMaterial *pMaterial = ( MS3DMaterial* )pPtr; + memcpy( m_pMaterials[i].m_ambient, pMaterial->m_ambient, sizeof( float )*4 ); + memcpy( m_pMaterials[i].m_diffuse, pMaterial->m_diffuse, sizeof( float )*4 ); + memcpy( m_pMaterials[i].m_specular, pMaterial->m_specular, sizeof( float )*4 ); + memcpy( m_pMaterials[i].m_emissive, pMaterial->m_emissive, sizeof( float )*4 ); + m_pMaterials[i].m_shininess = pMaterial->m_shininess; + m_pMaterials[i].m_pTextureFilename = new char[strlen( pMaterial->m_texture )+1]; + strcpy( m_pMaterials[i].m_pTextureFilename, pMaterial->m_texture ); + pPtr += sizeof( MS3DMaterial ); + } + + reloadTextures(); + + delete[] pBuffer; + + return true; +} + diff --git a/POWERVR/SRCS/NeHe/Lesson30/MilkshapeModel.h b/POWERVR/SRCS/NeHe/Lesson30/MilkshapeModel.h new file mode 100644 index 00000000..e2d293a8 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson30/MilkshapeModel.h @@ -0,0 +1,38 @@ +/* + MilkshapeModel.h + + Loads and renders a Milkshape3D model. + + Author: Brett Porter + Email: brettporter@yahoo.com + Website: http://www.geocities.com/brettporter/ + Copyright (C)2000, Brett Porter. All Rights Reserved. + + This file may be used only as long as this copyright notice remains intact. +*/ + +#ifndef MILKSHAPEMODEL_H +#define MILKSHAPEMODEL_H + +#include +#include +#include +#include "Model.h" + +class MilkshapeModel : public Model +{ + public: + /* Constructor. */ + MilkshapeModel(); + + /* Destructor. */ + virtual ~MilkshapeModel(); + + /* + Load the model data into the private variables. + filename Model filename + */ + virtual bool loadModelData( const char *filename ); +}; + +#endif // ndef MILKSHAPEMODEL_H diff --git a/POWERVR/SRCS/NeHe/Lesson30/Model.cpp b/POWERVR/SRCS/NeHe/Lesson30/Model.cpp new file mode 100644 index 00000000..5b2556ff --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson30/Model.cpp @@ -0,0 +1,170 @@ +/* + Model.cpp + + Abstract base class for a model. The specific extended class will render the given model. + + Author: Brett Porter + Email: brettporter@yahoo.com + Website: http://www.geocities.com/brettporter/ + Copyright (C)2000, Brett Porter. All Rights Reserved. + + This file may be used only as long as this copyright notice remains intact. +*/ + +#include "Model.h" + +Model::Model() +{ + m_numMeshes = 0; + m_pMeshes = NULL; + m_numMaterials = 0; + m_pMaterials = NULL; + m_numTriangles = 0; + m_pTriangles = NULL; + m_numVertices = 0; + m_pVertices = NULL; + + pvr_dr_init(m_pDrState); + +} + +Model::~Model() +{ + destroyModel(); +} + +void Model::destroyModel() { + + int i; + + for ( i = 0; i < m_numMeshes; i++ ) { + delete[] m_pMeshes[i].m_pTriangleIndices; + + } + for ( i = 0; i < m_numMaterials; i++ ) { + if(m_pMaterials[i].m_texture != NULL) { + plx_txr_destroy(m_pMaterials[i].m_texture); + } + delete[] m_pMaterials[i].m_pTextureFilename; + } + + m_numMeshes = 0; + if ( m_pMeshes != NULL ) + { + delete[] m_pMeshes; + m_pMeshes = NULL; + } + + m_numMaterials = 0; + if ( m_pMaterials != NULL ) + { + delete[] m_pMaterials; + m_pMaterials = NULL; + } + + m_numTriangles = 0; + if ( m_pTriangles != NULL ) + { + delete[] m_pTriangles; + m_pTriangles = NULL; + } + + m_numVertices = 0; + if ( m_pVertices != NULL ) + { + delete[] m_pVertices; + m_pVertices = NULL; + } +} + +void Model::draw() +{ + // Draw by group + for ( int i = 0; i < m_numMeshes; i++ ) + { + int materialIndex = m_pMeshes[i].m_materialIndex; + if ( materialIndex >= 0 ) + { + // Lighting (PLX does not do lighting so no port) + //glMaterialfv( GL_FRONT, GL_AMBIENT, m_pMaterials[materialIndex].m_ambient ); + //glMaterialfv( GL_FRONT, GL_DIFFUSE, m_pMaterials[materialIndex].m_diffuse ); + //glMaterialfv( GL_FRONT, GL_SPECULAR, m_pMaterials[materialIndex].m_specular ); + //glMaterialfv( GL_FRONT, GL_EMISSION, m_pMaterials[materialIndex].m_emissive ); + //glMaterialf( GL_FRONT, GL_SHININESS, m_pMaterials[materialIndex].m_shininess ); + + if ( m_pMaterials[materialIndex].m_texture > 0 ) + { + /* Create a textured polygon context */ + pvr_poly_cxt_txr(&m_pContext, + PVR_LIST_OP_POLY, + PVR_TXRFMT_RGB565, + m_pMaterials[materialIndex].m_texture->w, + m_pMaterials[materialIndex].m_texture->h, + m_pMaterials[materialIndex].m_texture->ptr, + PVR_FILTER_BILINEAR); + } + else { + /* Create a colored polygon context */ + pvr_poly_cxt_col(&m_pContext, PVR_LIST_OP_POLY); + } + + } else { + // Material properties? + /* Create a colored polygon context */ + pvr_poly_cxt_col(&m_pContext, PVR_LIST_OP_POLY); + } + + m_pContext.gen.culling = PVR_CULLING_NONE; // Disable culling or else model wont look right + pvr_poly_compile(&m_pHeader, &m_pContext); // Compile the context into a header + pvr_prim(&m_pHeader, sizeof(pvr_poly_hdr_t)); // Submit the header to the PVR + + for ( int j = 0; j < m_pMeshes[i].m_numTriangles; j++ ) + { + int triangleIndex = m_pMeshes[i].m_pTriangleIndices[j]; + const Triangle* pTri = &m_pTriangles[triangleIndex]; + + for ( int k = 0; k < 3; k++ ) + { + int index = pTri->m_vertexIndices[k]; + + if(k == 2) { + + plx_vert_ifdm3(&m_pDrState, // DR state variable + PVR_CMD_VERTEX_EOL, // Flag + m_pVertices[index].m_location[0], // X + m_pVertices[index].m_location[1], // Y + m_pVertices[index].m_location[2], // Z + 0xffffffff, // Color + pTri->m_s[k], // U + pTri->m_t[k]); // V + } else { + + plx_vert_ifdm3(&m_pDrState, // DR state variable + PVR_CMD_VERTEX, // Flag + m_pVertices[index].m_location[0], // X + m_pVertices[index].m_location[1], // Y + m_pVertices[index].m_location[2], // Z + 0xffffffff, // Color + pTri->m_s[k], // U + pTri->m_t[k]); + } + } + } + } +} + +void Model::reloadTextures() +{ + char pfn[100]; + + for ( int i = 0; i < m_numMaterials; i++ ) + if ( strlen( m_pMaterials[i].m_pTextureFilename ) > 0 ) { + sprintf(pfn, "/rd/%s", m_pMaterials[i].m_pTextureFilename); + m_pMaterials[i].m_texture = plx_txr_load(pfn, 0, PVR_TXRLOAD_16BPP); + if( m_pMaterials[i].m_texture == NULL) { printf("Model texture was not loaded"); } + } + else + m_pMaterials[i].m_texture = NULL; +} + + diff --git a/POWERVR/SRCS/NeHe/Lesson30/Model.h b/POWERVR/SRCS/NeHe/Lesson30/Model.h new file mode 100644 index 00000000..43b6d7cc --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson30/Model.h @@ -0,0 +1,101 @@ +/* + Model.h + + Abstract base class for a model. The specific extended class will render the given model. + + Author: Brett Porter + Email: brettporter@yahoo.com + Website: http://www.geocities.com/brettporter/ + Copyright (C)2000, Brett Porter. All Rights Reserved. + + This file may be used only as long as this copyright notice remains intact. +*/ + +#ifndef MODEL_H +#define MODEL_H + +#include +#include +#include +#include +#include + +class Model +{ + public: + // Mesh + struct Mesh + { + int m_materialIndex; + int m_numTriangles; + int *m_pTriangleIndices; + }; + + // Material properties + struct Material + { + float m_ambient[4], m_diffuse[4], m_specular[4], m_emissive[4]; + float m_shininess; + plx_texture_t *m_texture; + char *m_pTextureFilename; + }; + + // Triangle structure + struct Triangle + { + float m_vertexNormals[3][3]; + float m_s[3], m_t[3]; + int m_vertexIndices[3]; + }; + + // Vertex structure + struct Vertex + { + char m_boneID; // for skeletal animation + float m_location[3]; + }; + + public: + /* Constructor. */ + Model(); + + /* Destructor. */ + virtual ~Model(); + + /* + Load the model data into the private variables. + filename Model filename + */ + virtual bool loadModelData( const char *filename ) = 0; + + /* Draw the model */ + void draw(); + + void reloadTextures(); + + /* Deletes all allocated Memory and Set variables to either NULL or 0 */ + void destroyModel(); + + protected: + // Meshes used + int m_numMeshes; + Mesh *m_pMeshes; // check + + // Materials used + int m_numMaterials; + Material *m_pMaterials; // check + + // Triangles used + int m_numTriangles; + Triangle *m_pTriangles; // check + + // Vertices Used + int m_numVertices; + Vertex *m_pVertices; //check + + pvr_poly_cxt_t m_pContext; + pvr_poly_hdr_t m_pHeader; + pvr_dr_state_t m_pDrState; +}; + +#endif // ndef MODEL_H diff --git a/POWERVR/SRCS/NeHe/Lesson30/main.cpp b/POWERVR/SRCS/NeHe/Lesson30/main.cpp new file mode 100644 index 00000000..ef75fd6d --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson30/main.cpp @@ -0,0 +1,117 @@ + + +#include +#include +#include +#include + +#include "MilkshapeModel.h" // Header File For Milkshape File + +void printControls() { + printf("\n/**********Controls**********/\n"); + printf("START-Button: Exits program\n"); + printf("X-Button: NONE \n"); + printf("Y-Button: NONE \n"); + printf("A-Button: NONE \n"); + printf("B-Button: NONE \n"); + + printf("UP-Dir: NONE \n"); + printf("DOWN-Dir: NONE \n"); + printf("LEFT-Dir: NONE \n"); + printf("RIGHT-Dir: NONE \n"); + printf("/****************************/\n\n"); +} + +extern uint8 romdisk[]; +KOS_INIT_FLAGS(INIT_DEFAULT | INIT_MALLOCSTATS); +KOS_INIT_ROMDISK(romdisk); + +pvr_init_params_t params = { + /* Enable opaque and translucent polygons with size 16 */ + { PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_0 }, + + /* Vertex buffer size 512K */ + 512*1024 +}; + +int main(int argc, char **argv) { + + /* Controller Stuff */ + maple_device_t * dev; + cont_state_t * state; + + Model *pModel = NULL; // Holds The Model Data + float yrot = 0.0f; // Y Rotation + + /* vector_t defined in C:\cygwin\usr\local\dc\kos\kos\addons\include\kos\vector.h */ + /* Holds 3 floats */ + vector_t eye = {75.0f, 75.0f, 75.0f}; + vector_t center = {0.0f, 0.0f, 0.0f}; + vector_t up = {0.0f, 1.0f, 0.0f}; + + /* Init PVR API */ + if (pvr_init(¶ms) < 0) + return -1; + + printControls(); + + /* Sets the background color to black */ + pvr_set_bg_color(0.0f, 0.0f, 0.0f); + + /* Load the model */ + pModel = new MilkshapeModel(); + if ( pModel->loadModelData( "/rd/model.ms3d" ) == false ) // Loads The Model And Checks For Errors + { + printf("Couldn't load the model data /rd/model.ms3d \n"); + return 0; // If Model Didn't Load Quit + } + + // GET SOME 3D GOING!! + plx_mat3d_init(); /* Clear internal to an identity matrix */ + plx_mat3d_mode(PLX_MAT_PROJECTION); /** Projection (frustum, screenview) matrix */ + plx_mat3d_identity(); /** Load an identity matrix */ + plx_mat3d_perspective(45.0f, 640.0f / 480.0f, 0.1f, 1000.0f); // (float angle, float aspect, float znear, float zfar); + plx_mat3d_mode(PLX_MAT_MODELVIEW); /** Modelview (rotate, scale) matrix */ + + pModel->reloadTextures(); // Loads Model Textures + + while(1) { + + /* Check key status */ + dev = maple_enum_dev(0, 0); + if(dev == NULL) { + printf("Error: Could not find controller in first port.\n"); + break; + } + state = (cont_state_t *)maple_dev_status(dev); + if (state->buttons & CONT_START) { + break; // exit the program + } + + pvr_wait_ready(); + pvr_scene_begin(); + pvr_list_begin(PVR_LIST_OP_POLY); + + plx_mat3d_identity(); + plx_mat3d_lookat(&eye,¢er,&up); /* Do a camera "look at" */ + plx_mat3d_rotate(yrot, 0.0f, 1.0f, 0.0f); /* Rotate the model by 'yrot' degrees on the Y-Axis */ + + /* Clear internal to an identity matrix */ + plx_mat_identity(); + + /* "Apply" all matrices */ + plx_mat3d_apply_all(); + + /* Draw the Model */ + pModel->draw(); + + pvr_scene_finish(); + + yrot += 1.0f; // Increase the 'yrot' angle + } + // Clean Up!!! + pModel->destroyModel(); + + return 0; +} + diff --git a/POWERVR/SRCS/NeHe/Lesson30/romdisk/Model.ms3d b/POWERVR/SRCS/NeHe/Lesson30/romdisk/Model.ms3d new file mode 100644 index 00000000..03a72005 Binary files /dev/null and b/POWERVR/SRCS/NeHe/Lesson30/romdisk/Model.ms3d differ diff --git a/POWERVR/SRCS/NeHe/Lesson30/romdisk/Thumbs.db b/POWERVR/SRCS/NeHe/Lesson30/romdisk/Thumbs.db new file mode 100644 index 00000000..48768af8 Binary files /dev/null and b/POWERVR/SRCS/NeHe/Lesson30/romdisk/Thumbs.db differ diff --git a/POWERVR/SRCS/NeHe/Lesson30/romdisk/Wood.png b/POWERVR/SRCS/NeHe/Lesson30/romdisk/Wood.png new file mode 100644 index 00000000..3a359059 Binary files /dev/null and b/POWERVR/SRCS/NeHe/Lesson30/romdisk/Wood.png differ diff --git a/POWERVR/SRCS/NeHe/Lesson35/Makefile b/POWERVR/SRCS/NeHe/Lesson35/Makefile new file mode 100644 index 00000000..bdcafa96 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson35/Makefile @@ -0,0 +1 @@ +include Makefile.dc \ No newline at end of file diff --git a/POWERVR/SRCS/NeHe/Lesson35/Makefile.dc b/POWERVR/SRCS/NeHe/Lesson35/Makefile.dc new file mode 100644 index 00000000..a7e74d69 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson35/Makefile.dc @@ -0,0 +1,32 @@ +# +# PLX Lesson 35 +# +# + +TARGET = dcp.elf +OBJS = main.o + +all: rm-elf $(TARGET) + +include $(KOS_BASE)/Makefile.rules + +clean: + -rm -f $(TARGET) $(OBJS) +rm-elf: + -rm -f $(TARGET) + +$(TARGET): $(OBJS) + kos-c++ -o $(TARGET) $(OBJS) -lparallax -lpng -ljpeg -lkmg -lz -lkosutils -lm + +#romdisk.img: +# $(KOS_GENROMFS) -f romdisk.img -d romdisk -v + +#romdisk.o: romdisk.img +# $(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o + +run: $(TARGET) + $(KOS_LOADER) $(TARGET) + +dist: + rm -f $(OBJS) + $(KOS_STRIP) $(TARGET) diff --git a/POWERVR/SRCS/NeHe/Lesson35/main.c b/POWERVR/SRCS/NeHe/Lesson35/main.c new file mode 100644 index 00000000..a4c91191 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson35/main.c @@ -0,0 +1,335 @@ + +#include +#include +#include +#include +#include + +/* PLEASEEEEEEEEEEEEEEE READDDDDDDDDDDDDDDDDDDD + * To compile this you have to add source code to the parallax library and + * recompile it. + * Add this to mat3d.c (C:\cygwin\usr\local\dc\kos\kos-ports\libparallax\src) + * in between plx_mat3d_frustum() and plx_mat3d_push() : + +static matrix_t mo __attribute__((aligned(32))) = { + { 0.0f, 0.0f, 0.0f, 0.0f }, + { 0.0f, 0.0f, 0.0f, 0.0f }, + { 0.0f, 0.0f, 0.0f, 0.0f }, + { 0.0f, 0.0f, 0.0f, 1.0f } +}; + +void plx_mat3d_ortho(float left, float right, float bottom, float top, float znear, float zfar) { + + float x, y, z; + float tx, ty, tz; + + x = 2.0f / (right - left); + y = 2.0f / (top - bottom); + z = -2.0f / (zfar - znear); + tx = -(right + left) / (right - left); + ty = -(top + bottom) / (top - bottom); + tz = -(zfar + znear) / (zfar - znear); + + mo[0][0] = x; + mo[1][1] = y; + mo[2][2] = z; + mo[3][0] = tx; + mo[3][1] = ty; + mo[3][2] = tz; + + mat_load(trans_mats + matrix_mode); + mat_apply(&mo); + mat_store(trans_mats + matrix_mode); +} + +* also add this to matrix.h(C:\cygwin\usr\local\dc\kos\kos-ports\libparallax\include) +* between plx_mat3d_frustum() and plx_mat3d_push() : + +// Setup a orthogonal matrix +void plx_mat3d_ortho(float left, float right, float bottom, float top, float znear, float zfar); + +* and then compile this example. +*/ + +KOS_INIT_FLAGS(INIT_DEFAULT | INIT_MALLOCSTATS); + +void printControls() { + printf("\n/**********Controls**********/\n"); + printf("START-Button: Exits program\n"); + printf("X-Button: NONE \n"); + printf("Y-Button: NONE \n"); + printf("A-Button: NONE \n"); + printf("B-Button: NONE \n"); + + printf("UP-Dir: NONE \n"); + printf("DOWN-Dir: NONE \n"); + printf("LEFT-Dir: NONE \n"); + printf("RIGHT-Dir: NONE \n"); + printf("/****************************/\n\n"); +} + +// User Defined Variables +float angle; /* Used To Rotate The Helix */ +float vertexes[4][3]; /* Holds Float Info For 4 Sets Of Vertices */ +plx_texture_t BlurTexture; /* Holds a texture */ +uint32 tx_x = 1024, tx_y = 512; +plx_dr_state_t dr_state; + +void EmptyTexture() // Create An Empty Texture +{ + pvr_poly_cxt_t cxt; + + // Create Storage Space For Texture Data (1024x512x2) + BlurTexture.ptr = pvr_mem_malloc(1024 * 512 * 2); + + pvr_poly_cxt_txr( + &cxt, + PVR_LIST_TR_POLY, + PVR_TXRFMT_RGB565 | PVR_TXRFMT_NONTWIDDLED, // Change if bad + 1024, + 512, + BlurTexture.ptr, + PVR_FILTER_NONE + ); + pvr_poly_compile(&BlurTexture.hdr_trans, &cxt); +} + +void ProcessHelix() // Draws A Helix +{ + float x; // Helix x Coordinate + float y; // Helix y Coordinate + float z; // Helix z Coordinate + float phi; // Angle + float theta; // Angle + float v, u; // Angles + float r; // Radius Of Twist + int twists = 5; // 5 Twists + uint32 color = plx_pack_color(1.0f, 1.0f, 1.0f, 1.0f); //{1.0f, 0.4f, 0.2f, 0.8f}; Set The Material Color1 + + pvr_poly_cxt_t cxt_helix; + pvr_poly_hdr_t hdr_helix; + + /* vector_t defined in C:\cygwin\usr\local\dc\kos\kos\addons\include\kos\vector.h */ + /* Holds 3 floats */ + vector_t eye = {0.0f, 5.0f, 50.0f}; + vector_t center = {0.0f, 0.0f, 0.0f}; + vector_t up = {0.0f, 1.0f, 0.0f}; + + pvr_poly_cxt_col(&cxt_helix, PVR_LIST_OP_POLY); + pvr_poly_compile(&hdr_helix, &cxt_helix); + pvr_prim(&hdr_helix, sizeof(pvr_poly_hdr_t)); + + plx_mat3d_identity(); // Reset The Modelview Matrix + plx_mat3d_lookat(&eye,¢er,&up); // Eye Position (0,5,50) Center Of Scene (0,0,0), Up On Y Axis + + plx_mat3d_push(); // Push The Modelview Matrix + + plx_mat3d_translate(0.0f, 0.0f, -50.0f); // Move 50 units into the screen + plx_mat3d_rotate(angle/2.0f, 1.0f, 0.0f, 0.0f); // Rotate the quad 45 degrees on the Z-axis + plx_mat3d_rotate(angle/3.0f, 0.0f, 1.0f, 0.0f); // Rotate the quad cnt1*30.0f degress on the X&Y-Axis + + /* "Applying" all matrixs */ + plx_mat3d_apply_all(); + + r = 1.5f; // Radius + plx_dr_init(&dr_state); // Initialize a state variable for Direct Rendering + + for(phi=0; phi <= 360; phi+=20.0) // 360 Degrees In Steps Of 20 + { + for(theta = 0; theta <= 360*twists; theta += 20.0) // 360 Degrees * Number Of Twists In Steps Of 20 + { + v = (phi/180.0f*3.142f); // Calculate Angle Of First Point ( 0 ) + u = (theta/180.0f*3.142f); // Calculate Angle Of First Point ( 0 ) + + x = (float)(fcos(u)*(2.0f+fcos(v) ))*r; // Calculate x Position (1st Point) + y = (float)(fsin(u)*(2.0f+fcos(v) ))*r; // Calculate y Position (1st Point) + z = (float)((( u-(2.0f*3.142f)) + fsin(v) ) * r); // Calculate z Position (1st Point) + + vertexes[0][0]=x; // Set x Value Of First Vertex + vertexes[0][1]=y; // Set y Value Of First Vertex + vertexes[0][2]=z; // Set z Value Of First Vertex + + v = (phi/180.0f*3.142f); // Calculate Angle Of Second Point ( 0 ) + u = ((theta+20)/180.0f*3.142f); // Calculate Angle Of Second Point ( 20 ) + + x = (float)(fcos(u)*(2.0f+fcos(v) ))*r; // Calculate x Position (2nd Point) + y = (float)(fsin(u)*(2.0f+fcos(v) ))*r; // Calculate y Position (2nd Point) + z = (float)((( u-(2.0f*3.142f)) + fsin(v) ) * r); // Calculate z Position (2nd Point) + + vertexes[1][0]=x; // Set x Value Of Second Vertex + vertexes[1][1]=y; // Set y Value Of Second Vertex + vertexes[1][2]=z; // Set z Value Of Second Vertex + + v = ((phi+20)/180.0f*3.142f); // Calculate Angle Of Third Point ( 20 ) + u = ((theta+20)/180.0f*3.142f); // Calculate Angle Of Third Point ( 20 ) + + x = (float)(fcos(u)*(2.0f+fcos(v) ))*r; // Calculate x Position (3rd Point) + y = (float)(fsin(u)*(2.0f+fcos(v) ))*r; // Calculate y Position (3rd Point) + z = (float)((( u-(2.0f*3.142f)) + fsin(v) ) * r); // Calculate z Position (3rd Point) + + vertexes[2][0]=x; // Set x Value Of Third Vertex + vertexes[2][1]=y; // Set y Value Of Third Vertex + vertexes[2][2]=z; // Set z Value Of Third Vertex + + v = ((phi+20)/180.0f*3.142f); // Calculate Angle Of Fourth Point ( 20 ) + u = ((theta)/180.0f*3.142f); // Calculate Angle Of Fourth Point ( 0 ) + + x = (float)(fcos(u)*(2.0f+fcos(v) ))*r; // Calculate x Position (4th Point) + y = (float)(fsin(u)*(2.0f+fcos(v) ))*r; // Calculate y Position (4th Point) + z = (float)((( u-(2.0f*3.142f)) + fsin(v) ) * r); // Calculate z Position (4th Point) + + vertexes[3][0]=x; // Set x Value Of Fourth Vertex + vertexes[3][1]=y; // Set y Value Of Fourth Vertex + vertexes[3][2]=z; // Set z Value Of Fourth Vertex + + // Render The Quad + plx_vert_indm3(&dr_state, PLX_VERT, vertexes[0][0], vertexes[0][1], vertexes[0][2], color); + plx_vert_indm3(&dr_state, PLX_VERT, vertexes[1][0], vertexes[1][1], vertexes[1][2], color); + plx_vert_indm3(&dr_state, PLX_VERT, vertexes[2][0], vertexes[2][1], vertexes[2][2], color); + plx_vert_indm3(&dr_state, PLX_VERT_EOS, vertexes[3][0], vertexes[3][1], vertexes[3][2], color); + + } + } + angle += 8.0f; + plx_mat3d_pop(); // Pop The Matrix +} + +void ViewOrtho() { // Set Up An Ortho View + + plx_mat3d_mode(PLX_MAT_PROJECTION); + plx_mat3d_push(); + plx_mat3d_identity(); + plx_mat3d_ortho( 0, 640 , 480 , 0, -1, 1 ); // Select Ortho Mode (640x480) + plx_mat3d_mode(PLX_MAT_MODELVIEW); + plx_mat3d_push(); + plx_mat3d_identity(); +} + +void ViewPerspective() { // Set Up A Perspective View + + plx_mat3d_mode(PLX_MAT_PROJECTION); // Select Projection + plx_mat3d_pop(); // Pop The Matrix + plx_mat3d_mode(PLX_MAT_MODELVIEW); // Select Modelview + plx_mat3d_pop(); // Pop The Matrix +} + +void RenderToTexture() { // Renders To A Texture + + /* Sets the background color to Medium Blue */ + pvr_set_bg_color(0.0f, 0.0f, 0.5f); + pvr_scene_begin_txr(BlurTexture.ptr, &tx_x, &tx_y); + pvr_list_begin(PVR_LIST_OP_POLY); + ProcessHelix(); // Render The Helix onto the texture + pvr_list_finish(); + pvr_scene_finish(); + +} + +void DrawBlur(int times, float inc) // Draw The Blurred Image +{ + int num; + float spost = 0.0f; // Starting Texture Coordinate Offset + float alphainc = 0.9f / times; // Fade Speed For Alpha Blending + float alpha = 0.2f; // Starting Alpha Value + uint32 color = 0; + + pvr_prim(&BlurTexture.hdr_trans, sizeof(pvr_poly_hdr_t)); + ViewOrtho(); // Switch To An Ortho View + + alphainc = alpha / times; // alphainc=0.2f / Times To Render Blur + + plx_dr_init(&dr_state); // Initialize a state variable for Direct Rendering + + // Begin Drawing Quads + for (num = 0;num < times;num++) // Number Of Times To Render Blur + { + color = plx_pack_color(alpha, 1.0f, 1.0f, 1.0f); + + plx_vert_ifd(&dr_state, PLX_VERT, 0.0f, 512.0f, 1.0f, color, 0.0f+spost, 1.0f-spost); + plx_vert_ifd(&dr_state, PLX_VERT, 0.0f, 0.0f, 1.0f, color, 0.0f+spost, 0.0f+spost); + plx_vert_ifd(&dr_state, PLX_VERT, 1024.0f, 512.0f , 1.0f, color, 1.0f-spost, 1.0f-spost ); + plx_vert_ifd(&dr_state, PLX_VERT_EOS, 1024.0f, 0.0f , 1.0f, color, 1.0f-spost, 0.0f+spost); + + spost += inc; // Gradually Increase spost (Zooming Closer To Texture Center) + alpha = alpha - alphainc; // Gradually Decrease alpha (Gradually Fading Image Out) + } + + ViewPerspective(); // Switch To A Perspective View +} + +void Draw (void) // Draw The Scene +{ + pvr_wait_ready(); + plx_mat3d_identity(); // Reset The Modelview Matrix + RenderToTexture(); // Render To A Texture + + pvr_wait_ready(); + pvr_scene_begin(); + pvr_list_begin(PVR_LIST_OP_POLY); + ProcessHelix(); // Draw Our Helix + pvr_list_finish(); + pvr_list_begin(PVR_LIST_TR_POLY); + pvr_prim(&BlurTexture.hdr_trans, sizeof(pvr_poly_hdr_t)); + DrawBlur(13,0.02f); // Draw The Blur Effect + pvr_list_finish(); + pvr_scene_finish(); +} + + +pvr_init_params_t params = { + /* Enable opaque and translucent polygons with size 16 */ + { PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_0 }, + + /* Vertex buffer size 512K */ + 512*1024 +}; + +int main(int argc, char **argv) { + + /* Controller Stuff */ + maple_device_t * dev; + cont_state_t * state; + + /* Init PVR API */ + if (pvr_init(¶ms) < 0) + return -1; + + printControls(); + + EmptyTexture(); + + // GET SOME 3D GOING!! + plx_mat3d_init(); /* Clear internal to an identity matrix */ + plx_mat3d_mode(PLX_MAT_PROJECTION); /** Projection (frustum, screenview) matrix */ + plx_mat3d_identity(); /** Load an identity matrix */ + plx_mat3d_perspective(50.0f, 640.0f / 480.0f, 0.1f, 2000.0f); // (float angle, float aspect, float znear, float zfar); + plx_mat3d_mode(PLX_MAT_MODELVIEW); /** Modelview (rotate, scale) matrix */ + + while(1) { + + // Check for the user pressing START + dev = maple_enum_dev(0, 0); + if(dev == NULL) { + printf("Error: Could not find controller in first port.\n"); + break; + } + state = (cont_state_t *)maple_dev_status(dev); + if (state->buttons & CONT_START) { + break; // exit the program + } + + Draw(); + } + // Clean Up!!! + plx_txr_destroy(&BlurTexture); + + return 0; +} + + + + + + + + diff --git a/POWERVR/SRCS/NeHe/Lesson4/Makefile b/POWERVR/SRCS/NeHe/Lesson4/Makefile new file mode 100644 index 00000000..bdcafa96 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson4/Makefile @@ -0,0 +1 @@ +include Makefile.dc \ No newline at end of file diff --git a/POWERVR/SRCS/NeHe/Lesson4/Makefile.dc b/POWERVR/SRCS/NeHe/Lesson4/Makefile.dc new file mode 100644 index 00000000..6912b051 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson4/Makefile.dc @@ -0,0 +1,31 @@ +# +# PLX Lesson 4 +# +# + +TARGET = dcp.elf +OBJS = main.o + +all: rm-elf $(TARGET) + +include $(KOS_BASE)/Makefile.rules + +clean: + -rm -f $(TARGET) $(OBJS) +rm-elf: + -rm -f $(TARGET) +$(TARGET): $(OBJS) + kos-c++ -o $(TARGET) $(OBJS) -lparallax -lz -lkosutils -lm + +#romdisk.img: +# $(KOS_GENROMFS) -f romdisk.img -d romdisk -v + +#romdisk.o: romdisk.img +# $(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o + +run: $(TARGET) + $(KOS_LOADER) $(TARGET) + +dist: + rm -f $(OBJS) romdisk.o romdisk.img + $(KOS_STRIP) $(TARGET) diff --git a/POWERVR/SRCS/NeHe/Lesson4/main.c b/POWERVR/SRCS/NeHe/Lesson4/main.c new file mode 100644 index 00000000..f85fb285 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson4/main.c @@ -0,0 +1,169 @@ + + +#include +#include +#include +#include + +KOS_INIT_FLAGS(INIT_DEFAULT | INIT_MALLOCSTATS); + +void printControls() { + printf("\n/**********Controls**********/\n"); + printf("START-Button: Exits program\n"); + printf("X-Button: NONE \n"); + printf("Y-Button: NONE \n"); + printf("A-Button: NONE \n"); + printf("B-Button: NONE \n"); + + printf("UP-Dir: NONE \n"); + printf("DOWN-Dir: NONE \n"); + printf("LEFT-Dir: NONE \n"); + printf("RIGHT-Dir: NONE \n"); + printf("/****************************/\n\n"); +} + +pvr_init_params_t params = { + /* Enable opaque and translucent polygons with size 16 */ + { PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_0 }, + + /* Vertex buffer size 512K */ + 512*1024 +}; + +int main(int argc, char **argv) { + + /* Controller Stuff */ + maple_device_t * dev; + cont_state_t * state; + + int rquad = 0; + int rtri = 0; + + /* Init PVR API */ + if (pvr_init(¶ms) < 0) + return -1; + + printControls(); + + /* Sets the background color to black */ + pvr_set_bg_color(0.0f,0.0f,0.0f); + + plx_cxt_init(); // Initialize the plx context system + plx_cxt_texture(NULL); // No texture will be used + plx_cxt_culling(PLX_CULL_NONE); // No culling + + // GET SOME 3D GOING!! + /* Init matrices */ + plx_mat3d_init(); /* Clear internal to an identity matrix */ + plx_mat3d_mode(PLX_MAT_PROJECTION); /** Projection (frustum, screenview) matrix */ + plx_mat3d_identity(); /** Load an identity matrix */ + plx_mat3d_perspective(45.0f, 640.0f / 480.0f, 0.1f, 100.0f); // (float angle, float aspect, float znear, float zfar); + plx_mat3d_mode(PLX_MAT_MODELVIEW); /** Modelview (rotate, scale) matrix */ + + while(1) { + + // Check for the user pressing START + dev = maple_enum_dev(0, 0); + if(dev == NULL) { + printf("Error: Could not find controller in first port.\n"); + break; + } + state = (cont_state_t *)maple_dev_status(dev); + if (state->buttons & CONT_START) { + break; // exit the program + } + + pvr_wait_ready(); + pvr_scene_begin(); + pvr_list_begin(PVR_LIST_OP_POLY); + + // Submit the context + plx_cxt_send(PVR_LIST_OP_POLY); // Submit the Header for PVR_LIST_OP_POLY + + // DRAW THE PYRAMID + plx_mat3d_identity(); + plx_mat3d_translate(-1.5f, 0.0f, -6.0f); // Move 1.5f units to the left and 6 units into the screen + plx_mat3d_rotate(rtri, 0.0f, 1.0f, 0.0f); // Rotate the pyramid angle 'rtri' on the Y axis + + /* Clear internal to an identity matrix */ + plx_mat_identity(); + + /* "Applying" all matrixs: multiply a matrix onto the "internal" one */ + plx_mat3d_apply_all(); + + // Front Face of Pyramid + plx_vert_inpm3(PLX_VERT, 0, 1, 0, plx_pack_color(1.0f, 1.0f, 0.0f, 0.0f)); // Red: Top Of Triangle (Front) + plx_vert_inpm3(PLX_VERT, -1, -1, 1, plx_pack_color(1.0f, 0.0f, 1.0f, 0.0f)); // Green: Left Of Triangle (Front) + plx_vert_inpm3(PLX_VERT_EOS, 1, -1, 1, plx_pack_color(1.0f, 0.0f, 0.0f, 1.0f)); // Blue: Right Of Triangle (Front) + + // Right Face of Pyramid + plx_vert_inpm3(PLX_VERT, 0, 1, 0, plx_pack_color(1.0f, 1.0f, 0.0f, 0.0f)); // Red: Top Of Triangle (Right) + plx_vert_inpm3(PLX_VERT, 1, -1, 1, plx_pack_color(1.0f, 0.0f, 0.0f, 1.0f)); // Blue: Left Of Triangle (Right) + plx_vert_inpm3(PLX_VERT_EOS, 1, -1, -1, plx_pack_color(1.0f, 0.0f, 1.0f, 0.0f)); // Green: Right Of Triangle (Right) + + // Back Face of Pyramid + plx_vert_inpm3(PLX_VERT, 0, 1, 0, plx_pack_color(1.0f, 1.0f, 0.0f, 0.0f)); // Red: Top Of Triangle (Back) + plx_vert_inpm3(PLX_VERT, 1, -1, -1, plx_pack_color(1.0f, 0.0f, 1.0f, 0.0f)); // Green: Left Of Triangle (Back) + plx_vert_inpm3(PLX_VERT_EOS, -1, -1, -1, plx_pack_color(1.0f, 0.0f, 0.0f, 1.0f));// Blue: Right Of Triangle (Back) + + // Left Face of Pyramid + plx_vert_inpm3(PLX_VERT, 0, 1, 0, plx_pack_color(1.0f, 1.0f, 0.0f, 0.0f)); // Red: Top Of Triangle (Left) + plx_vert_inpm3(PLX_VERT, -1, -1, -1, plx_pack_color(1.0f, 0.0f, 0.0f, 1.0f)); // Blue: Left Of Triangle (Left) + plx_vert_inpm3(PLX_VERT_EOS, -1, -1, 1, plx_pack_color(1.0f, 0.0f, 1.0f, 0.0f)); // Green: Right Of Triangle (Left) + + // DRAW THE BOX + plx_mat3d_identity(); + plx_mat3d_translate(1.5f, 0.0f, -6.0f); // Move 1.5f units to the right and 6 units into the screen + plx_mat3d_rotate(rquad, 1.0f, 0.0f, 0.0f); // Rotate the box angle 'rquad' on the X axis + + /* Clear internal to an identity matrix */ + plx_mat_identity(); + + /* "Applying" all matrixs: multiply a matrix onto the "internal" one */ + plx_mat3d_apply_all(); + + // Top Face of Box (GREEN) + plx_vert_inpm3(PLX_VERT, -1, 1, 1, plx_pack_color(1.0f, 0.0f, 1.0f, 0.0f)); // Bottom Left Of The Quad (Top) + plx_vert_inpm3(PLX_VERT, -1, 1, -1, plx_pack_color(1.0f, 0.0f, 1.0f, 0.0f)); // Top Left Of The Quad (Top) + plx_vert_inpm3(PLX_VERT, 1, 1, 1, plx_pack_color(1.0f, 0.0f, 1.0f, 0.0f)); // Bottom Right Of The Quad (Top) + plx_vert_inpm3(PLX_VERT_EOS, 1, 1, -1, plx_pack_color(1.0f, 0.0f, 1.0f, 0.0f)); // Top Right Of The Quad (Top) + + // Bottom Face of Box (ORANGE) + plx_vert_inpm3(PLX_VERT, -1, -1, -1, plx_pack_color(1.0f, 1.0f, 0.5f, 0.0f)); // Bottom Left Of The Quad (Bottom) + plx_vert_inpm3(PLX_VERT, -1, -1, 1, plx_pack_color(1.0f, 1.0f, 0.5f, 0.0f)); // Top Left Of The Quad (Bottom) + plx_vert_inpm3(PLX_VERT, 1, -1, -1, plx_pack_color(1.0f, 1.0f, 0.5f, 0.0f)); // Bottom Right Of The Quad (Bottom) + plx_vert_inpm3(PLX_VERT_EOS, 1, -1, 1, plx_pack_color(1.0f, 1.0f, 0.5f, 0.0f)); // Top Right Of The Quad (Bottom) + + // Front Face of Box (RED) + plx_vert_inpm3(PLX_VERT, -1, -1, 1, plx_pack_color(1.0f, 1.0f, 0.0f, 0.0f)); // Bottom Left Of The Quad (Front) + plx_vert_inpm3(PLX_VERT, -1, 1, 1, plx_pack_color(1.0f, 1.0f, 0.0f, 0.0f)); // Top Left Of The Quad (Front) + plx_vert_inpm3(PLX_VERT, 1, -1, 1, plx_pack_color(1.0f, 1.0f, 0.0f, 0.0f)); // Bottom Right Of The Quad (Front) + plx_vert_inpm3(PLX_VERT_EOS, 1, 1, 1, plx_pack_color(1.0f, 1.0f, 0.0f, 0.0f)); // Top Right Of The Quad (Front) + + // Back Face of Box (YELLOW) + plx_vert_inpm3(PLX_VERT, -1, 1, -1, plx_pack_color(1.0f, 1.0f, 1.0f, 0.0f)); // Bottom Left Of The Quad (Back) + plx_vert_inpm3(PLX_VERT, -1, -1, -1, plx_pack_color(1.0f, 1.0f, 1.0f, 0.0f)); // Top Left Of The Quad (Back) + plx_vert_inpm3(PLX_VERT, 1, 1, -1, plx_pack_color(1.0f, 1.0f, 1.0f, 0.0f)); // Bottom Right Of The Quad (Back) + plx_vert_inpm3(PLX_VERT_EOS, 1, -1, -1, plx_pack_color(1.0f, 1.0f, 1.0f, 0.0f));// Top Right Of The Quad (Back) + + // Left Face of Box (BLUE) + plx_vert_inpm3(PLX_VERT, -1, -1, -1, plx_pack_color(1.0f, 0.0f, 0.0f, 1.0f)); // Bottom Left Of The Quad (Left) + plx_vert_inpm3(PLX_VERT, -1, 1, -1, plx_pack_color(1.0f, 0.0f, 0.0f, 1.0f)); // Top Left Of The Quad (Left) + plx_vert_inpm3(PLX_VERT, -1, -1, 1, plx_pack_color(1.0f, 0.0f, 0.0f, 1.0f)); // Bottom Right Of The Quad (Left) + plx_vert_inpm3(PLX_VERT_EOS, -1, 1, 1, plx_pack_color(1.0f, 0.0f, 0.0f, 1.0f)); // Top Right Of The Quad (Left) + + // Right Face of Box (VIOLET) + plx_vert_inpm3(PLX_VERT, 1, -1, 1, plx_pack_color(1.0f, 1.0f, 0.0f, 1.0f)); // Bottom Left Of The Quad (Right) + plx_vert_inpm3(PLX_VERT, 1, 1, 1, plx_pack_color(1.0f, 1.0f, 0.0f, 1.0f)); // Top Left Of The Quad (Right) + plx_vert_inpm3(PLX_VERT, 1, -1, -1, plx_pack_color(1.0f, 1.0f, 0.0f, 1.0f)); // Bottom Right Of The Quad (Right) + plx_vert_inpm3(PLX_VERT_EOS, 1, 1, -1, plx_pack_color(1.0f, 1.0f, 0.0f, 1.0f)); // Top Right Of The Quad (Right) + + pvr_scene_finish(); + + rquad -= 2.0f; // Increases the box's rotation angle + rtri += 2.0f; // Increases the pyramid's rotation angle + } + + return 0; +} + diff --git a/POWERVR/SRCS/NeHe/Lesson5/Makefile b/POWERVR/SRCS/NeHe/Lesson5/Makefile new file mode 100644 index 00000000..bdcafa96 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson5/Makefile @@ -0,0 +1 @@ +include Makefile.dc \ No newline at end of file diff --git a/POWERVR/SRCS/NeHe/Lesson5/Makefile.dc b/POWERVR/SRCS/NeHe/Lesson5/Makefile.dc new file mode 100644 index 00000000..723ce938 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson5/Makefile.dc @@ -0,0 +1,32 @@ +# +# PLX Lesson 5 +# +# + +TARGET = dcp.elf +OBJS = main.o + +all: rm-elf $(TARGET) + +include $(KOS_BASE)/Makefile.rules + +clean: + -rm -f $(TARGET) $(OBJS) romdisk.* +rm-elf: + -rm -f $(TARGET) romdisk.* + +$(TARGET): $(OBJS) romdisk.o + kos-c++ -o $(TARGET) $(OBJS)romdisk.o -lparallax -lpng -lkmg -ljpeg -lz -lkosutils -lm + +romdisk.img: + $(KOS_GENROMFS) -f romdisk.img -d romdisk -v + +romdisk.o: romdisk.img + $(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o + +run: $(TARGET) + $(KOS_LOADER) $(TARGET) + +dist: + rm -f $(OBJS) romdisk.o romdisk.img + $(KOS_STRIP) $(TARGET) diff --git a/POWERVR/SRCS/NeHe/Lesson5/main.c b/POWERVR/SRCS/NeHe/Lesson5/main.c new file mode 100644 index 00000000..c1a1e845 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson5/main.c @@ -0,0 +1,160 @@ + + +#include +#include +#include +#include +#include + +extern uint8 romdisk[]; +KOS_INIT_FLAGS(INIT_DEFAULT | INIT_MALLOCSTATS); +KOS_INIT_ROMDISK(romdisk); + +void printControls() { + printf("\n/**********Controls**********/\n"); + printf("START-Button: Exits program\n"); + printf("X-Button: NONE \n"); + printf("Y-Button: NONE \n"); + printf("A-Button: NONE \n"); + printf("B-Button: NONE \n"); + + printf("UP-Dir: NONE \n"); + printf("DOWN-Dir: NONE \n"); + printf("LEFT-Dir: NONE \n"); + printf("RIGHT-Dir: NONE \n"); + printf("/****************************/\n\n"); +} + +/** + Like plx_vert_ifdm3, but uses plx_prim. Missing from "plx_prim.h" so I added it here. + */ +static inline void plx_vert_ifpm3(int flags, float x, float y, float z, uint32 color, float u, float v) { + plx_mat_tfip_3d(x, y, z); + plx_vert_ifp(flags, x, y, z, color, u, v); +} + +pvr_init_params_t params = { + /* Enable opaque and translucent polygons with size 16 */ + { PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_0 }, + + /* Vertex buffer size 512K */ + 512*1024 +}; + +int main(int argc, char **argv) { + + /* Controller Stuff */ + maple_device_t * dev; + cont_state_t * state; + + float xrot = 0; /* X Rotation */ + float yrot = 0; /* Y Rotation */ + float zrot = 0; /* Z Rotation */ + uint32 color = plx_pack_color(1.0f, 1.0f, 1.0f, 1.0f); /* or (0xffffffff) Should equal this if you want images to have their original color */ + plx_texture_t *a_texture; /* Pointer to plx_texture */ + + /* Init PVR API */ + if (pvr_init(¶ms) < 0) + return -1; + + printControls(); + + /* Sets the background color to black */ + pvr_set_bg_color(0.0f, 0.0f, 0.0f); + + /* Load the texture */ + a_texture = plx_txr_load("/rd/logo.png", 0, PVR_TXRLOAD_16BPP); + + plx_cxt_init(); // Initialize the plx context system + plx_cxt_texture(a_texture); // Texture 'a_texture' will be used with the context system + plx_cxt_culling(PLX_CULL_CCW); // Enable Counter Clockwise Culling + + // GET SOME 3D GOING!! + /* Init matrices */ + plx_mat3d_init(); /* Clear internal to an identity matrix */ + plx_mat3d_mode(PLX_MAT_PROJECTION); /** Projection (frustum, screenview) matrix */ + plx_mat3d_identity(); /** Load an identity matrix */ + plx_mat3d_perspective(45.0f, 640.0f / 480.0f, 0.1f, 100.0f); // (float angle, float aspect, float znear, float zfar); + plx_mat3d_mode(PLX_MAT_MODELVIEW); /** Modelview (rotate, scale) matrix */ + + while(1) { + + // Check for the user pressing START + dev = maple_enum_dev(0, 0); + if(dev == NULL) { + printf("Error: Could not find controller in first port.\n"); + break; + } + state = (cont_state_t *)maple_dev_status(dev); + if (state->buttons & CONT_START) { + break; // exit the program + } + + pvr_wait_ready(); + pvr_scene_begin(); + pvr_list_begin(PVR_LIST_OP_POLY); + + // Submit the context + plx_cxt_send(PVR_LIST_OP_POLY); // Submit the Header for PVR_LIST_OP_POLY + + // DRAW THE BOX + plx_mat3d_identity(); + plx_mat3d_translate(0.0f, 0.0f, -5.0f); // Move 5 units into the screen + plx_mat3d_rotate(xrot, 1.0f, 0.0f, 0.0f); // Rotate the BOX angle 'xrot' on the X axis + plx_mat3d_rotate(yrot, 0.0f, 1.0f, 0.0f); // Rotate the BOX angle 'yrot' on the Y axis + plx_mat3d_rotate(zrot, 0.0f, 0.0f, 1.0f); // Rotate the BOX angle 'zrot' on the Z axis + + /* Clear internal to an identity matrix */ + plx_mat_identity(); + + /* "Applying" all matrixs: multiply a matrix onto the "internal" one */ + plx_mat3d_apply_all(); + + // Top Face of Box + plx_vert_ifpm3(PLX_VERT, -1, 1, 1, color, 0, 1); // Bottom Left Of The Quad (Top) + plx_vert_ifpm3(PLX_VERT, -1, 1, -1, color, 0, 0); // Top Left Of The Quad (Top) + plx_vert_ifpm3(PLX_VERT, 1, 1, 1, color, 1, 1); // Bottom Right Of The Quad (Top) + plx_vert_ifpm3(PLX_VERT_EOS, 1, 1, -1, color, 1, 0); // Top Right Of The Quad (Top) + + // Bottom Face of Box + plx_vert_ifpm3(PLX_VERT, -1, -1, -1, color, 0, 1); // Bottom Left Of The Quad (Bottom) + plx_vert_ifpm3(PLX_VERT, -1, -1, 1, color, 0, 0); // Top Left Of The Quad (Bottom) + plx_vert_ifpm3(PLX_VERT, 1, -1, -1, color, 1, 1); // Bottom Right Of The Quad (Bottom) + plx_vert_ifpm3(PLX_VERT_EOS, 1, -1, 1, color, 1, 0); // Top Right Of The Quad (Bottom) + + // Front Face of Box + plx_vert_ifpm3(PLX_VERT, -1, -1, 1, color, 0, 1); // Bottom Left Of The Quad (Front) + plx_vert_ifpm3(PLX_VERT, -1, 1, 1, color, 0, 0); // Top Left Of The Quad (Front) + plx_vert_ifpm3(PLX_VERT, 1, -1, 1, color, 1, 1); // Bottom Right Of The Quad (Front) + plx_vert_ifpm3(PLX_VERT_EOS, 1, 1, 1, color, 1, 0); // Top Right Of The Quad (Front) + + // Back Face of Box + plx_vert_ifpm3(PLX_VERT, -1, 1, -1, color, 0, 1); // Bottom Left Of The Quad (Back) + plx_vert_ifpm3(PLX_VERT, -1, -1, -1, color, 0, 0); // Top Left Of The Quad (Back) + plx_vert_ifpm3(PLX_VERT, 1, 1, -1, color, 1, 1); // Bottom Right Of The Quad (Back) + plx_vert_ifpm3(PLX_VERT_EOS, 1, -1, -1, color, 1, 0);// Top Right Of The Quad (Back) + + // Left Face of Box + plx_vert_ifpm3(PLX_VERT, -1, -1, -1, color, 0, 1); // Bottom Left Of The Quad (Left) + plx_vert_ifpm3(PLX_VERT, -1, 1, -1, color, 0, 0); // Top Left Of The Quad (Left) + plx_vert_ifpm3(PLX_VERT, -1, -1, 1, color, 1, 1); // Bottom Right Of The Quad (Left) + plx_vert_ifpm3(PLX_VERT_EOS, -1, 1, 1, color, 1, 0); // Top Right Of The Quad (Left) + + // Right Face of Box + plx_vert_ifpm3(PLX_VERT, 1, -1, 1, color, 0, 1); // Bottom Left Of The Quad (Right) + plx_vert_ifpm3(PLX_VERT, 1, 1, 1, color, 0, 0); // Top Left Of The Quad (Right) + plx_vert_ifpm3(PLX_VERT, 1, -1, -1, color, 1, 1); // Bottom Right Of The Quad (Right) + plx_vert_ifpm3(PLX_VERT_EOS, 1, 1, -1, color, 1, 0); // Top Right Of The Quad (Right) + + pvr_scene_finish(); + + xrot += 3.0f; // Increases the box's X-rotation angle + yrot += 2.0f; // Increases the box's Y-rotation angle + zrot += 4.0f; // Increases the box's Z-rotation angle + } + // Clean up!!! + plx_txr_destroy(a_texture); + + return 0; +} + diff --git a/POWERVR/SRCS/NeHe/Lesson5/romdisk/Thumbs.db b/POWERVR/SRCS/NeHe/Lesson5/romdisk/Thumbs.db new file mode 100644 index 00000000..15ae1b86 Binary files /dev/null and b/POWERVR/SRCS/NeHe/Lesson5/romdisk/Thumbs.db differ diff --git a/POWERVR/SRCS/NeHe/Lesson5/romdisk/logo.png b/POWERVR/SRCS/NeHe/Lesson5/romdisk/logo.png new file mode 100644 index 00000000..7572e1aa Binary files /dev/null and b/POWERVR/SRCS/NeHe/Lesson5/romdisk/logo.png differ diff --git a/POWERVR/SRCS/NeHe/Lesson6/Makefile b/POWERVR/SRCS/NeHe/Lesson6/Makefile new file mode 100644 index 00000000..bdcafa96 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson6/Makefile @@ -0,0 +1 @@ +include Makefile.dc \ No newline at end of file diff --git a/POWERVR/SRCS/NeHe/Lesson6/Makefile.dc b/POWERVR/SRCS/NeHe/Lesson6/Makefile.dc new file mode 100644 index 00000000..94f60de2 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson6/Makefile.dc @@ -0,0 +1,32 @@ +# +# PLX Lesson 6 +# +# + +TARGET = dcp.elf +OBJS = main.o + +all: rm-elf $(TARGET) + +include $(KOS_BASE)/Makefile.rules + +clean: + -rm -f $(TARGET) $(OBJS) romdisk.* +rm-elf: + -rm -f $(TARGET) romdisk.* + +$(TARGET): $(OBJS) romdisk.o + kos-c++ -o $(TARGET) $(OBJS)romdisk.o -lparallax -lpng -ljpeg -lkmg -lz -lkosutils -lm + +romdisk.img: + $(KOS_GENROMFS) -f romdisk.img -d romdisk -v + +romdisk.o: romdisk.img + $(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o + +run: $(TARGET) + $(KOS_LOADER) $(TARGET) + +dist: + rm -f $(OBJS) romdisk.o romdisk.img + $(KOS_STRIP) $(TARGET) diff --git a/POWERVR/SRCS/NeHe/Lesson6/main.c b/POWERVR/SRCS/NeHe/Lesson6/main.c new file mode 100644 index 00000000..38e3a2ce --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson6/main.c @@ -0,0 +1,180 @@ + + +#include +#include +#include +#include +#include + +extern uint8 romdisk[]; +KOS_INIT_FLAGS(INIT_DEFAULT | INIT_MALLOCSTATS); +KOS_INIT_ROMDISK(romdisk); + +void printControls() { + printf("\n/**********Controls**********/\n"); + printf("START-Button: Exits program\n"); + printf("X-Button: Increase x rotation speed \n"); + printf("Y-Button: Decrease x rotation speed \n"); + printf("A-Button: Increase y rotation speed \n"); + printf("B-Button: Decrease y rotation speed \n"); + + printf("UP-Dir: Move the cube into the distance \n"); + printf("DOWN-Dir: Move the cube closer \n"); + printf("LEFT-Dir: NONE \n"); + printf("RIGHT-Dir: NONE \n"); + printf("/****************************/\n\n"); +} + +/** + Like plx_vert_ifdm3, but uses plx_prim. + */ +static inline void plx_vert_ifpm3(int flags, float x, float y, float z, uint32 color, float u, float v) { + plx_mat_tfip_3d(x, y, z); + plx_vert_ifp(flags, x, y, z, color, u, v); +} + +pvr_init_params_t params = { + /* Enable opaque and translucent polygons with size 16 */ + { PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_0 }, + + /* Vertex buffer size 512K */ + 512*1024 +}; + +int main(int argc, char **argv) { + + /* Controller Stuff */ + maple_device_t * dev; + cont_state_t * state; + + float xrot = 0; // x rotation + float yrot = 0; // y rotation + float xspeed = 0; // x rotation speed + float yspeed = 0; // y rotation speed + float z = -5.0f; // depth into the screen. + + uint32 color = plx_pack_color(1.0f, 1.0f, 1.0f, 1.0f); /* or (0xffffffff) Should equal this if you want images to have their original color */ + + plx_texture_t *a_texture; /* Pointer to plx_texture */ + + /* Init PVR API */ + if (pvr_init(¶ms) < 0) + return -1; + + printControls(); + + /* Sets the background color to black */ + pvr_set_bg_color(0.0f, 0.0f, 0.0f); + + /* Load the texture */ + a_texture = plx_txr_load("/rd/crate.png", 0, PVR_TXRLOAD_16BPP); + + plx_cxt_init(); // Initialize the plx context system + plx_cxt_texture(a_texture); // Texture 'a_texture' will be used with the context system + plx_cxt_culling(PLX_CULL_CCW); // Enable Counter Clockwise Culling + + // GET SOME 3D GOING!! + /* Init matrices */ + plx_mat3d_init(); /* Clear internal to an identity matrix */ + plx_mat3d_mode(PLX_MAT_PROJECTION); /** Projection (frustum, screenview) matrix */ + plx_mat3d_identity(); /** Load an identity matrix */ + plx_mat3d_perspective(45.0f, 640.0f / 480.0f, 0.1f, 100.0f); // (float angle, float aspect, float znear, float zfar); + plx_mat3d_mode(PLX_MAT_MODELVIEW); /** Modelview (rotate, scale) matrix */ + + while(1) { + + /* Check key status */ + dev = maple_enum_dev(0, 0); + if(dev == NULL) { + printf("Error: Could not find controller in first port.\n"); + break; + } + state = (cont_state_t *)maple_dev_status(dev); + if (state->buttons & CONT_START) { + break; // exit the program + } + if (state->buttons & CONT_X) { + xspeed += 0.01f; // increase x rotation speed + } + if (state->buttons & CONT_Y) { + xspeed -= 0.01f; // decrease x rotation speed + } + if (state->buttons & CONT_A) { + yspeed += 0.01f; // increase y rotation speed + } + if (state->buttons & CONT_B) { + yspeed -= 0.01f; // decrease y rotation speed + } + if (state->buttons & CONT_DPAD_UP) { + z -= 0.02f; // move the cube into the distance. + } + if (state->buttons & CONT_DPAD_DOWN) { + z += 0.02f; // move the cube closer. + } + + pvr_wait_ready(); + pvr_scene_begin(); + pvr_list_begin(PVR_LIST_OP_POLY); + + // Submit the context + plx_cxt_send(PVR_LIST_OP_POLY); // Submit the Header for PVR_LIST_OP_POLY + + // DRAW THE BOX + plx_mat3d_identity(); + plx_mat3d_translate(0.0f, 0.0f, z); // Move Z units into/outof the screen + plx_mat3d_rotate(xrot, 1.0f, 0.0f, 0.0f); // Rotate the BOX angle 'xrot' on the X axis + plx_mat3d_rotate(yrot, 0.0f, 1.0f, 0.0f); // Rotate the BOX angle 'yrot' on the Y axis + + /* Clear internal to an identity matrix */ + plx_mat_identity(); + + /* "Applying" all matrixs: multiply a matrix onto the "internal" one */ + plx_mat3d_apply_all(); + + // Top Face of Box + plx_vert_ifpm3(PLX_VERT, -1, 1, 1, color, 0, 1); // Bottom Left Of The Quad (Top) + plx_vert_ifpm3(PLX_VERT, -1, 1, -1, color, 0, 0); // Top Left Of The Quad (Top) + plx_vert_ifpm3(PLX_VERT, 1, 1, 1, color, 1, 1); // Bottom Right Of The Quad (Top) + plx_vert_ifpm3(PLX_VERT_EOS, 1, 1, -1, color, 1, 0); // Top Right Of The Quad (Top) + + // Bottom Face of Box + plx_vert_ifpm3(PLX_VERT, -1, -1, -1, color, 0, 1); // Bottom Left Of The Quad (Bottom) + plx_vert_ifpm3(PLX_VERT, -1, -1, 1, color, 0, 0); // Top Left Of The Quad (Bottom) + plx_vert_ifpm3(PLX_VERT, 1, -1, -1, color, 1, 1); // Bottom Right Of The Quad (Bottom) + plx_vert_ifpm3(PLX_VERT_EOS, 1, -1, 1, color, 1, 0); // Top Right Of The Quad (Bottom) + + // Front Face of Box + plx_vert_ifpm3(PLX_VERT, -1, -1, 1, color, 0, 1); // Bottom Left Of The Quad (Front) + plx_vert_ifpm3(PLX_VERT, -1, 1, 1, color, 0, 0); // Top Left Of The Quad (Front) + plx_vert_ifpm3(PLX_VERT, 1, -1, 1, color, 1, 1); // Bottom Right Of The Quad (Front) + plx_vert_ifpm3(PLX_VERT_EOS, 1, 1, 1, color, 1, 0); // Top Right Of The Quad (Front) + + // Back Face of Box + plx_vert_ifpm3(PLX_VERT, -1, 1, -1, color, 0, 1); // Bottom Left Of The Quad (Back) + plx_vert_ifpm3(PLX_VERT, -1, -1, -1, color, 0, 0); // Top Left Of The Quad (Back) + plx_vert_ifpm3(PLX_VERT, 1, 1, -1, color, 1, 1); // Bottom Right Of The Quad (Back) + plx_vert_ifpm3(PLX_VERT_EOS, 1, -1, -1, color, 1, 0);// Top Right Of The Quad (Back) + + // Left Face of Box + plx_vert_ifpm3(PLX_VERT, -1, -1, -1, color, 0, 1); // Bottom Left Of The Quad (Left) + plx_vert_ifpm3(PLX_VERT, -1, 1, -1, color, 0, 0); // Top Left Of The Quad (Left) + plx_vert_ifpm3(PLX_VERT, -1, -1, 1, color, 1, 1); // Bottom Right Of The Quad (Left) + plx_vert_ifpm3(PLX_VERT_EOS, -1, 1, 1, color, 1, 0); // Top Right Of The Quad (Left) + + // Right Face of Box + plx_vert_ifpm3(PLX_VERT, 1, -1, 1, color, 0, 1); // Bottom Left Of The Quad (Right) + plx_vert_ifpm3(PLX_VERT, 1, 1, 1, color, 0, 0); // Top Left Of The Quad (Right) + plx_vert_ifpm3(PLX_VERT, 1, -1, -1, color, 1, 1); // Bottom Right Of The Quad (Right) + plx_vert_ifpm3(PLX_VERT_EOS, 1, 1, -1, color, 1, 0); // Top Right Of The Quad (Right) + + pvr_scene_finish(); + + xrot += xspeed; // Increase the box's X Axis Rotation + yrot += yspeed; // Increase the box's Y Axis Rotation + } + // Clean up!!! + plx_txr_destroy(a_texture); + + return 0; +} + diff --git a/POWERVR/SRCS/NeHe/Lesson6/romdisk/Thumbs.db b/POWERVR/SRCS/NeHe/Lesson6/romdisk/Thumbs.db new file mode 100644 index 00000000..d18d676c Binary files /dev/null and b/POWERVR/SRCS/NeHe/Lesson6/romdisk/Thumbs.db differ diff --git a/POWERVR/SRCS/NeHe/Lesson6/romdisk/crate.png b/POWERVR/SRCS/NeHe/Lesson6/romdisk/crate.png new file mode 100644 index 00000000..e2ee71b4 Binary files /dev/null and b/POWERVR/SRCS/NeHe/Lesson6/romdisk/crate.png differ diff --git a/POWERVR/SRCS/NeHe/Lesson7/Makefile b/POWERVR/SRCS/NeHe/Lesson7/Makefile new file mode 100644 index 00000000..bdcafa96 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson7/Makefile @@ -0,0 +1 @@ +include Makefile.dc \ No newline at end of file diff --git a/POWERVR/SRCS/NeHe/Lesson7/Makefile.dc b/POWERVR/SRCS/NeHe/Lesson7/Makefile.dc new file mode 100644 index 00000000..58552786 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson7/Makefile.dc @@ -0,0 +1,32 @@ +# +# PLX Lesson 7 +# +# + +TARGET = dcp.elf +OBJS = main.o + +all: rm-elf $(TARGET) + +include $(KOS_BASE)/Makefile.rules + +clean: + -rm -f $(TARGET) $(OBJS) romdisk.* +rm-elf: + -rm -f $(TARGET) romdisk.* + +$(TARGET): $(OBJS) romdisk.o + kos-c++ -o $(TARGET) $(OBJS)romdisk.o -lparallax -lpng -ljpeg -lkmg -lz -lkosutils -lm + +romdisk.img: + $(KOS_GENROMFS) -f romdisk.img -d romdisk -v + +romdisk.o: romdisk.img + $(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o + +run: $(TARGET) + $(KOS_LOADER) $(TARGET) + +dist: + rm -f $(OBJS) romdisk.o romdisk.img + $(KOS_STRIP) $(TARGET) diff --git a/POWERVR/SRCS/NeHe/Lesson7/main.c b/POWERVR/SRCS/NeHe/Lesson7/main.c new file mode 100644 index 00000000..25ee7d9c --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson7/main.c @@ -0,0 +1,221 @@ +/************************************************************************* +* NOTE: For some reason, which ever face of the box I decide to draw first +* does not have transparency when it is enabled. I have no idea +* why and I can not fix it. +*************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include + +extern uint8 romdisk[]; +KOS_INIT_FLAGS(INIT_DEFAULT | INIT_MALLOCSTATS); +KOS_INIT_ROMDISK(romdisk); + +void printControls() { + printf("\n/**********Controls**********/\n"); + printf("START-Button: Exits program\n"); + printf("X-Button: Toggle filtering \n"); + printf("Y-Button: Toggle blending\n"); + printf("A-Button: Move the cube into the distance \n"); + printf("B-Button: Move the cube closer \n"); + + printf("UP-Dir: Decrease x rotation speed \n"); + printf("DOWN-Dir: Increase x rotation speed \n"); + printf("LEFT-Dir: Decrease y rotation speed \n"); + printf("RIGHT-Dir: Increase y rotation speed \n"); + printf("/****************************/\n\n"); +} + +/** + Like plx_vert_ifdm3, but uses plx_prim. + */ +static inline void plx_vert_ifpm3(int flags, float x, float y, float z, uint32 color, float u, float v) { + plx_mat_tfip_3d(x, y, z); + plx_vert_ifp(flags, x, y, z, color, u, v); +} + +pvr_init_params_t params = { + /* Enable opaque and translucent polygons with size 16 */ + { PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_0 }, + + /* Vertex buffer size 512K */ + 512*1024 +}; + +int main(int argc, char **argv) { + + /* Controller Stuff */ + maple_device_t * dev; + cont_state_t * state; + int xp = 0; // False (True or False: Pressed X button last) Toggles Filtering + int yp = 0; // False (True or False: Pressed Y button last) Toggles Transparency + int blend = 0; // False (True or False: Blending) + + /* Rotation and depth into screen */ + float xrot = 0; // x rotation + float yrot = 0; // y rotation + float xspeed = 0; // x rotation speed + float yspeed = 0; // y rotation speed + float z = -5.0f; // depth into the screen. + + int filter = 0; // Start with no filtering + uint32 color = plx_pack_color(0.5f, 1.0f, 1.0f, 1.0f); // plx_pack_color(a, r, g, b) a = 0.5 meaning it is see through + plx_texture_t *textures[2]; /* Array of pointers to plx_texture(Holds two textures) */ + + /* Init PVR API */ + if (pvr_init(¶ms) < 0) + return -1; + + printControls(); + + /* Sets the background color to black */ + pvr_set_bg_color(0.0f, 0.0f, 0.0f); + + /* Load the textures */ + textures[0] = plx_txr_load("/rd/glass.png", 0, PVR_TXRLOAD_16BPP); + textures[1] = plx_txr_load("/rd/glass.png", 0, PVR_TXRLOAD_16BPP); + + plx_cxt_init(); // Initialize the plx context system + + // GET SOME 3D GOING!! + plx_mat3d_init(); /* Clear internal to an identity matrix */ + plx_mat3d_mode(PLX_MAT_PROJECTION); /** Projection (frustum, screenview) matrix */ + plx_mat3d_identity(); /** Load an identity matrix */ + plx_mat3d_perspective(45.0f, 640.0f / 480.0f, 0.1f, 1000.0f); // (float angle, float aspect, float znear, float zfar); + plx_mat3d_mode(PLX_MAT_MODELVIEW); /** Modelview (rotate, scale) matrix */ + + /* Set the filtering for each texture */ + plx_txr_setfilter(textures[0], PLX_FILTER_NONE); + plx_txr_setfilter(textures[1], PLX_FILTER_BILINEAR); + + while(1) { + + /* Check key status */ + dev = maple_enum_dev(0, 0); + if(dev == NULL) { + printf("Error: Could not find controller in first port.\n"); + break; + } + state = (cont_state_t *)maple_dev_status(dev); + if (state->buttons & CONT_START) { + break; // exit the program + } + if (state->buttons & CONT_X && !xp) { + xp = 1; + filter += 1; // Toggle Filter + if (filter > 1) + filter = 0; + } + if (!(state->buttons & CONT_X)) { + xp = 0; + } + if (state->buttons & CONT_Y && !yp) { + yp = 1; + blend = !blend; // Toggle Blending + } + if (!(state->buttons & CONT_Y)) { + yp = 0; + } + if (state->buttons & CONT_A) { + z -= 0.02f; // move the cube into the distance. + } + if (state->buttons & CONT_B) { + z += 0.02f; // move the cube closer. + } + if (state->buttons & CONT_DPAD_UP) { + xspeed -= 0.01f; // decrease x rotation speed + } + if (state->buttons & CONT_DPAD_DOWN) { + xspeed += 0.01f; // increase x rotation speed + } + if (state->buttons & CONT_DPAD_LEFT) { + yspeed -= 0.01f; // decrease y rotation speed + } + if (state->buttons & CONT_DPAD_RIGHT) { + yspeed += 0.01f; // increase y rotation speed + } + + pvr_wait_ready(); + pvr_scene_begin(); + + // Texture 'textures[filter]' will be used with the context system. Depends on which filter is selected. + plx_cxt_texture(textures[filter]); + + if(blend) { + plx_list_begin(PVR_LIST_TR_POLY); + plx_cxt_culling(PVR_CULLING_NONE); // No culling + plx_cxt_blending(PLX_BLEND_SRCALPHA, PLX_BLEND_INVSRCALPHA); + plx_cxt_send(PVR_LIST_TR_POLY); + } + else { + plx_list_begin(PVR_LIST_OP_POLY); + plx_cxt_culling(PVR_CULLING_CCW); // Enable Counter-clockwise culling + plx_cxt_blending(PLX_BLEND_ONE, PLX_BLEND_ZERO); + plx_cxt_send(PVR_LIST_OP_POLY); + } + + // DRAW THE BOX + plx_mat3d_identity(); + plx_mat3d_translate(0.0f, 0.0f, z); // Move Z units into/outof the screen + plx_mat3d_rotate(xrot, 1.0f, 0.0f, 0.0f); // Rotate the BOX angle 'xrot' on the X axis + plx_mat3d_rotate(yrot, 0.0f, 1.0f, 0.0f); // Rotate the BOX angle 'yrot' on the Y axis + + /* Clear internal to an identity matrix */ + plx_mat_identity(); + + /* "Applying" all matrixs: multiply a matrix onto the "internal" one */ + plx_mat3d_apply_all(); + + // Front Face of Box + plx_vert_ifpm3(PLX_VERT, -1, -1, 1, color, 0, 1); // Bottom Left Of The Quad (Front) + plx_vert_ifpm3(PLX_VERT, -1, 1, 1, color, 0, 0); // Top Left Of The Quad (Front) + plx_vert_ifpm3(PLX_VERT, 1, -1, 1, color, 1, 1); // Bottom Right Of The Quad (Front) + plx_vert_ifpm3(PLX_VERT_EOS, 1, 1, 1, color, 1, 0); // Top Right Of The Quad (Front) + + // Back Face of Box + plx_vert_ifpm3(PLX_VERT, -1, 1, -1, color, 0, 1); // Bottom Left Of The Quad (Back) + plx_vert_ifpm3(PLX_VERT, -1, -1, -1, color, 0, 0); // Top Left Of The Quad (Back) + plx_vert_ifpm3(PLX_VERT, 1, 1, -1, color, 1, 1); // Bottom Right Of The Quad (Back) + plx_vert_ifpm3(PLX_VERT_EOS, 1, -1, -1, color, 1, 0);// Top Right Of The Quad (Back) + + // Top Face of Box + plx_vert_ifpm3(PLX_VERT, -1, 1, 1, color, 0, 1); // Bottom Left Of The Quad (Top) + plx_vert_ifpm3(PLX_VERT, -1, 1, -1, color, 0, 0); // Top Left Of The Quad (Top) + plx_vert_ifpm3(PLX_VERT, 1, 1, 1, color, 1, 1); // Bottom Right Of The Quad (Top) + plx_vert_ifpm3(PLX_VERT_EOS, 1, 1, -1, color, 1, 0); // Top Right Of The Quad (Top) + + // Bottom Face of Box + plx_vert_ifpm3(PLX_VERT, -1, -1, -1, color, 0, 1); // Bottom Left Of The Quad (Bottom) + plx_vert_ifpm3(PLX_VERT, -1, -1, 1, color, 0, 0); // Top Left Of The Quad (Bottom) + plx_vert_ifpm3(PLX_VERT, 1, -1, -1, color, 1, 1); // Bottom Right Of The Quad (Bottom) + plx_vert_ifpm3(PLX_VERT_EOS, 1, -1, 1, color, 1, 0); // Top Right Of The Quad (Bottom) + + // Right Face of Box + plx_vert_ifpm3(PLX_VERT, 1, -1, 1, color, 0, 1); // Bottom Left Of The Quad (Right) + plx_vert_ifpm3(PLX_VERT, 1, 1, 1, color, 0, 0); // Top Left Of The Quad (Right) + plx_vert_ifpm3(PLX_VERT, 1, -1, -1, color, 1, 1); // Bottom Right Of The Quad (Right) + plx_vert_ifpm3(PLX_VERT_EOS, 1, 1, -1, color, 1, 0); // Top Right Of The Quad (Right) + + // Left Face of Box + plx_vert_ifpm3(PLX_VERT, -1, -1, -1, color, 0, 1); // Bottom Left Of The Quad (Left) + plx_vert_ifpm3(PLX_VERT, -1, 1, -1, color, 0, 0); // Top Left Of The Quad (Left) + plx_vert_ifpm3(PLX_VERT, -1, -1, 1, color, 1, 1); // Bottom Right Of The Quad (Left) + plx_vert_ifpm3(PLX_VERT_EOS, -1, 1, 1, color, 1, 0); // Top Right Of The Quad (Left) + + pvr_scene_finish(); + + xrot += xspeed; // Increase box's X Axis Rotation + yrot += yspeed; // Increase box's Y Axis Rotation + } + // Clean UP!!! + plx_txr_destroy(textures[0]); + plx_txr_destroy(textures[1]); + + return 0; +} + diff --git a/POWERVR/SRCS/NeHe/Lesson7/romdisk/Thumbs.db b/POWERVR/SRCS/NeHe/Lesson7/romdisk/Thumbs.db new file mode 100644 index 00000000..e44b03fa Binary files /dev/null and b/POWERVR/SRCS/NeHe/Lesson7/romdisk/Thumbs.db differ diff --git a/POWERVR/SRCS/NeHe/Lesson7/romdisk/glass.png b/POWERVR/SRCS/NeHe/Lesson7/romdisk/glass.png new file mode 100644 index 00000000..bb813531 Binary files /dev/null and b/POWERVR/SRCS/NeHe/Lesson7/romdisk/glass.png differ diff --git a/POWERVR/SRCS/NeHe/Lesson8/Makefile b/POWERVR/SRCS/NeHe/Lesson8/Makefile new file mode 100644 index 00000000..bdcafa96 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson8/Makefile @@ -0,0 +1 @@ +include Makefile.dc \ No newline at end of file diff --git a/POWERVR/SRCS/NeHe/Lesson8/Makefile.dc b/POWERVR/SRCS/NeHe/Lesson8/Makefile.dc new file mode 100644 index 00000000..831be807 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson8/Makefile.dc @@ -0,0 +1,32 @@ +# +# PLX Lesson 8 +# +# + +TARGET = dcp.elf +OBJS = main.o + +all: rm-elf $(TARGET) + +include $(KOS_BASE)/Makefile.rules + +clean: + -rm -f $(TARGET) $(OBJS) romdisk.* +rm-elf: + -rm -f $(TARGET) romdisk.* + +$(TARGET): $(OBJS) romdisk.o + kos-c++ -o $(TARGET) $(OBJS)romdisk.o -lparallax -lpng -ljpeg -lkmg -lz -lkosutils -lm + +romdisk.img: + $(KOS_GENROMFS) -f romdisk.img -d romdisk -v + +romdisk.o: romdisk.img + $(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o + +run: $(TARGET) + $(KOS_LOADER) $(TARGET) + +dist: + rm -f $(OBJS) romdisk.o romdisk.img + $(KOS_STRIP) $(TARGET) diff --git a/POWERVR/SRCS/NeHe/Lesson8/main.c b/POWERVR/SRCS/NeHe/Lesson8/main.c new file mode 100644 index 00000000..eb4cddc7 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson8/main.c @@ -0,0 +1,220 @@ + + +#include +#include +#include +#include +#include + +extern uint8 romdisk[]; +KOS_INIT_FLAGS(INIT_DEFAULT | INIT_MALLOCSTATS); +KOS_INIT_ROMDISK(romdisk); + +void printControls() { + printf("\n/**********Controls**********/\n"); + printf("START-Button: Exits program\n"); + printf("X-Button: NONE \n"); + printf("Y-Button: Toggle twinkling\n"); + printf("A-Button: Move the collection of stars into the distance \n"); + printf("B-Button: Move the collection of stars closer \n"); + + printf("UP-Dir: Negative x rotation \n"); + printf("DOWN-Dir: Positive x rotation \n"); + printf("LEFT-Dir: NONE \n"); + printf("RIGHT-Dir: NONE \n"); + printf("/****************************/\n\n"); +} + + +#define NUM_STARS 50 /* Number Of Stars To Draw */ + +typedef struct /* Create A Structure For Star */ +{ + uint8 r, g, b; /* Stars Color */ + float dist, /* Stars Distance From Center */ + angle; /* Stars Current Angle */ +} stars; + +static stars star[NUM_STARS]; /* Need To Keep Track Of 'NUM_STARS' Stars */ + +static int twinkle = 0; /* Twinkling Stars (0-false 1-true) */ + +static float zoom = -15.0f; /* Distance Away From Stars */ +static float tilt = 90.0f; /* Tilt The View */ +static float spin; /* Spin Stars */ + +static uint16 loop; /* General Loop Variable */ +plx_texture_t *a_texture; /* Pointer to plx_texture */ + +/** + Like plx_vert_ifdm3, but uses plx_prim. + */ +static inline void plx_vert_ifpm3(int flags, float x, float y, float z, uint32 color, float u, float v) { + plx_mat_tfip_3d(x, y, z); + plx_vert_ifp(flags, x, y, z, color, u, v); +} + +pvr_init_params_t params = { + /* Enable opaque and translucent polygons with size 16 */ + { PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_0 }, + + /* Vertex buffer size 512K */ + 512*1024 +}; + +int main(int argc, char **argv) { + + /* Controller Stuff */ + maple_device_t * dev; + cont_state_t * state; + + int yp = 0; // False (True or False: Pressed Y button last) + uint32 color = 0; + + /* Init PVR API */ + if (pvr_init(¶ms) < 0) + return -1; + + printControls(); + + /* Sets the background color to black */ + pvr_set_bg_color(0.0f, 0.0f, 0.0f); + + /* Load the textures */ + a_texture = plx_txr_load("/rd/star.png", 1, PVR_TXRLOAD_16BPP); /* The '1' enables transparency in the image */ + + plx_txr_setfilter(a_texture, PLX_FILTER_BILINEAR); + + plx_cxt_init(); // Initialize the plx context system + plx_cxt_texture(a_texture); // Texture 'a_texture' will be used with the context system + plx_cxt_culling(PLX_CULL_NONE); // No culling + + // GET SOME 3D GOING!! + plx_mat3d_init(); /* Clear internal to an identity matrix */ + plx_mat3d_mode(PLX_MAT_PROJECTION); /** Projection (frustum, screenview) matrix */ + plx_mat3d_identity(); /** Load an identity matrix */ + plx_mat3d_perspective(45.0f, 640.0f / 480.0f, 0.1f, 100.0f); /* (float angle, float aspect, float znear, float zfar); */ + plx_mat3d_mode(PLX_MAT_MODELVIEW); /** Modelview (rotate, scale) matrix */ + + /* Set up the stars */ + for (loop = 0; loop < NUM_STARS; loop++) + { + star[loop].angle = 0.0f; /* initially no rotation */ + star[loop].dist = ((float)(loop)/NUM_STARS)*5.0f; /* calculate distance form the center */ + star[loop].r = rand()%256; /* random red intensity */ + star[loop].g = rand()%256; /* random green intensity */ + star[loop].b = rand()%256; /* random blue intensity */ + } + + while(1) { + + /* Check key status */ + dev = maple_enum_dev(0, 0); + if(dev == NULL) { + printf("Error: Could not find controller in first port.\n"); + break; + } + state = (cont_state_t *)maple_dev_status(dev); + if (state->buttons & CONT_START) { + break; // exit the program + } + if (state->buttons & CONT_Y && !yp) { + yp = 1; // toggle twinkling + twinkle = !twinkle; + } + if (!(state->buttons & CONT_Y)) { + yp = 0; + } + if (state->buttons & CONT_A) { + zoom -= 0.2f; // move the collection of stars into the distance. + } + if (state->buttons & CONT_B) { + zoom += 0.2f; // move the collection of stars closer. + } + if (state->buttons & CONT_DPAD_UP) { + tilt -= 0.5f; // negative x rotation + } + if (state->buttons & CONT_DPAD_DOWN) { + tilt += 0.5f; // positive x rotation + } + + pvr_wait_ready(); + pvr_scene_begin(); + + pvr_list_begin(PVR_LIST_TR_POLY); + plx_cxt_send(PVR_LIST_TR_POLY); // Submit the Header for PVR_LIST_TR_POLY + + for (loop = 0; loop < NUM_STARS; loop++) { // loop through all the stars. + + // DRAW STARS + plx_mat3d_identity(); // reset the view before we draw each star. + plx_mat3d_translate(0.0f, 0.0f, zoom); // zoom into the screen. + plx_mat3d_rotate(tilt, 1.0f, 0.0f, 0.0f); // tilt the view. + + plx_mat3d_rotate(star[loop].angle, 0.0f, 1.0f, 0.0f); // rotate to the current star's angle. + plx_mat3d_translate(star[loop].dist, 0.0f, 0.0f); // move forward on the X plane (the star's x plane). + + plx_mat3d_rotate(-star[loop].angle, 0.0f, 1.0f, 0.0f); // cancel the current star's angle. + plx_mat3d_rotate(-tilt, 1.0f, 0.0f, 0.0f); // cancel the screen tilt. + + /* Clear internal to an identity matrix */ + plx_mat_identity(); + + /* "Applying" all matrixs: multiply a matrix onto the "internal" one */ + plx_mat3d_apply_all(); + + if(twinkle) { // twinkling stars enabled ... draw an additional star. + color = plx_pack_color(1.0f, (float)(star[(NUM_STARS-loop)-1].r), (float)(star[(NUM_STARS-loop)-1].g), + (float)(star[(NUM_STARS-loop)-1].b)); + + plx_vert_ifpm3(PLX_VERT, -1.0f, 1.0f, 0.0f, color, 0.0f, 1.0f); // Bottom Left Of The Texture and Star + plx_vert_ifpm3(PLX_VERT, -1.0f, -1.0f, 0.0f, color, 0.0f, 0.0f); // Top Left Of The Texture and Star + plx_vert_ifpm3(PLX_VERT, 1.0f, 1.0f, 0.0f, color, 1.0f, 1.0f); // Bottom Right Of The Texture and Star + plx_vert_ifpm3(PLX_VERT_EOS, 1.0f, -1.0f, 0.0f, color, 1.0f, 0.0f); // Top Right Of The Texture and Star + } + + // DRAW STARS + plx_mat3d_identity(); // reset the view before we draw each star. + plx_mat3d_translate(0.0f, 0.0f, zoom); // zoom into the screen. + plx_mat3d_rotate(tilt, 1.0f, 0.0f, 0.0f); // tilt the view. + + plx_mat3d_rotate(star[loop].angle, 0.0f, 1.0f, 0.0f); // rotate to the current star's angle. + plx_mat3d_translate(star[loop].dist, 0.0f, 0.0f); // move forward on the X plane (the star's x plane). + + plx_mat3d_rotate(-star[loop].angle, 0.0f, 1.0f, 0.0f); // cancel the current star's angle. + plx_mat3d_rotate(-tilt, 1.0f, 0.0f, 0.0f); // cancel the screen tilt. + plx_mat3d_rotate(spin, 0.0f, 0.0f, 1.0f); // rotate the star on the z axis. + + /* Clear internal to an identity matrix */ + plx_mat_identity(); + + /* "Applying" all matrixs: multiply a matrix onto the "internal" one */ + plx_mat3d_apply_all(); + + color = plx_pack_color(1.0f, (float)(star[loop].r), (float)(star[loop].g), (float)(star[loop].b)); + + plx_vert_ifpm3(PLX_VERT, -1.0f, 1.0f, 0.0f, color, 0.0f, 1.0f); // Bottom Left Of The Texture and Star + plx_vert_ifpm3(PLX_VERT, -1.0f, -1.0f, 0.0f, color, 0.0f, 0.0f); // Top Left Of The Texture and Star + plx_vert_ifpm3(PLX_VERT, 1.0f, 1.0f, 0.0f, color, 1.0f, 1.0f); // Bottom Right Of The Texture and Star + plx_vert_ifpm3(PLX_VERT_EOS, 1.0f, -1.0f, 0.0f, color, 1.0f, 0.0f); // Top Right Of The Texture and Star + + spin += 0.01f; // used to spin the stars. + star[loop].angle += (loop * 1.0f)/(NUM_STARS * 1.0f); // change star angle. + star[loop].dist -= 0.01f; // bring back to center. + + if (star[loop].dist < 0.0f) // star hit the center + { + star[loop].dist += 5.0f; // move 5 units from the center. + star[loop].r = rand()%256; // new red color. + star[loop].g = rand()%256; // new green color. + star[loop].b = rand()%256; // new blue color. + } + } + pvr_scene_finish(); + } + // Clean up!!! + plx_txr_destroy(a_texture); + + return 0; +} + diff --git a/POWERVR/SRCS/NeHe/Lesson8/romdisk/Thumbs.db b/POWERVR/SRCS/NeHe/Lesson8/romdisk/Thumbs.db new file mode 100644 index 00000000..d800298e Binary files /dev/null and b/POWERVR/SRCS/NeHe/Lesson8/romdisk/Thumbs.db differ diff --git a/POWERVR/SRCS/NeHe/Lesson8/romdisk/star.png b/POWERVR/SRCS/NeHe/Lesson8/romdisk/star.png new file mode 100644 index 00000000..07857919 Binary files /dev/null and b/POWERVR/SRCS/NeHe/Lesson8/romdisk/star.png differ diff --git a/POWERVR/SRCS/NeHe/Lesson9/Makefile b/POWERVR/SRCS/NeHe/Lesson9/Makefile new file mode 100644 index 00000000..bdcafa96 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson9/Makefile @@ -0,0 +1 @@ +include Makefile.dc \ No newline at end of file diff --git a/POWERVR/SRCS/NeHe/Lesson9/Makefile.dc b/POWERVR/SRCS/NeHe/Lesson9/Makefile.dc new file mode 100644 index 00000000..7aa168ee --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson9/Makefile.dc @@ -0,0 +1,32 @@ +# +# PLX Lesson 9 +# +# + +TARGET = dcp.elf +OBJS = main.o + +all: rm-elf $(TARGET) + +include $(KOS_BASE)/Makefile.rules + +clean: + -rm -f $(TARGET) $(OBJS) romdisk.* +rm-elf: + -rm -f $(TARGET) romdisk.* + +$(TARGET): $(OBJS) romdisk.o + kos-c++ -o $(TARGET) $(OBJS)romdisk.o -lparallax -lpng -ljpeg -lkmg -lz -lkosutils -lm + +romdisk.img: + $(KOS_GENROMFS) -f romdisk.img -d romdisk -v + +romdisk.o: romdisk.img + $(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o + +run: $(TARGET) + $(KOS_LOADER) $(TARGET) + +dist: + rm -f $(OBJS) romdisk.o romdisk.img + $(KOS_STRIP) $(TARGET) diff --git a/POWERVR/SRCS/NeHe/Lesson9/main.c b/POWERVR/SRCS/NeHe/Lesson9/main.c new file mode 100644 index 00000000..f86dbd79 --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson9/main.c @@ -0,0 +1,296 @@ + + +#include +#include +#include +#include +#include + +extern uint8 romdisk[]; +KOS_INIT_FLAGS(INIT_DEFAULT | INIT_MALLOCSTATS); +KOS_INIT_ROMDISK(romdisk); + +void printControls() { + printf("\n/**********Controls**********/\n"); + printf("START-Button: Exits program\n"); + printf("X-Button: Toggles filtering \n"); + printf("Y-Button: Toggle blending\n"); + printf("A-Button: Look up \n"); + printf("B-Button: Look down \n"); + + printf("UP-Dir: Walk forward \n"); + printf("DOWN-Dir: Walk backward \n"); + printf("LEFT-Dir: Turn left \n"); + printf("RIGHT-Dir: Turn right \n"); + printf("/****************************/\n\n"); +} + +uint8 loop; // general loop variable +plx_texture_t *textures[2]; // storage for 2 textures + +float xrot; // x rotation +float yrot; // y rotation +float xspeed; // x rotation speed +float yspeed; // y rotation speed + +float walkbias = 0.0f; +float walkbiasangle = 0.0f; + +float lookupdown = 0.0f; +const float piover180 = 0.0174532925f; // pie/180 degrees + +float xpos, zpos; + +typedef struct { // vertex coordinates - 3d and texture + float x, y, z; // 3d coords. + float u, v; // texture coords. +} VERTEX; + +typedef struct { // triangle + VERTEX vertex[3]; // 3 vertices array +} TRIANGLE; + +typedef struct { // sector of a 3d environment + int numtriangles; // number of triangles in the sector + TRIANGLE* triangle; // pointer to array of triangles. +} SECTOR; + +SECTOR sector1; + +// Helper for SetupWorld. reads a file into a string until a nonblank, non-comment line +// is found ("/" at the start indicating a comment); assumes lines < 255 characters long. +void readstr(FILE *f, char *string) +{ + do { // Start A Loop + fgets(string, 255, f); // Read one line + } while ((string[0] == '/') || (string[0] == '\n')); // See If It Is Worthy Of Processing + return; +} + +// loads the world from a text file. +void SetupWorld() +{ + float x, y, z, u, v; + int vert; + int numtriangles; // Number Of Triangles In Sector + FILE *filein; // file to load the world from + char oneline[255]; // String To Store Data In + + filein = fopen("/rd/world.txt", "rt"); + + readstr(filein, oneline); // Get Single Line Of Data + sscanf(oneline, "NUMPOLLIES %d\n", &numtriangles); // Read In Number Of Triangles + + sector1.numtriangles = numtriangles; // Define The Number Of Triangles In Sector 1 + sector1.triangle = (TRIANGLE *) malloc(sizeof(TRIANGLE)*numtriangles); // Allocate Memory For numtriangles And Set Pointer + + for (loop = 0; loop < numtriangles; loop++) { // Loop Through All The Triangles + for (vert = 0; vert < 3; vert++) { + readstr(filein,oneline); // Read String To Work With + sscanf(oneline, "%f %f %f %f %f", &x, &y, &z, &u, &v); // Read Data Into Respective Vertex Values + sector1.triangle[loop].vertex[vert].x = x; + sector1.triangle[loop].vertex[vert].y = y; + sector1.triangle[loop].vertex[vert].z = z; + sector1.triangle[loop].vertex[vert].u = u; + sector1.triangle[loop].vertex[vert].v = v; + } + } + + fclose(filein); + return; +} + + +/** + Like plx_vert_ifdm3, but uses plx_prim. + */ +static inline void plx_vert_ifpm3(int flags, float x, float y, float z, uint32 color, float u, float v) { + plx_mat_tfip_3d(x, y, z); + plx_vert_ifp(flags, x, y, z, color, u, v); +} + +pvr_init_params_t params = { + /* Enable opaque and translucent polygons with size 16 */ + { PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_0 }, + + /* Vertex buffer size 512K */ + 512*1024 +}; + +int main(int argc, char **argv) { + + /* Controller Stuff */ + maple_device_t * dev; + cont_state_t * state; + int xp = 0; // False (True or False: Pressed X button last) Toggles Filtering + int yp = 0; // False (True or False: Pressed Y button last) Toggles Transparency + int blend = 0; // blending on/off + + float x_m, y_m, z_m, u_m, v_m; + float xtrans, ztrans, ytrans; + float sceneroty; + int numtriangles; + + int filter = 0; // texture filtering method to use (NONE or BILINEAR) + uint32 color = plx_pack_color(0.5f, 1.0f, 1.0f, 1.0f); + + /* Init PVR API */ + if (pvr_init(¶ms) < 0) + return -1; + + printControls(); + + /* Sets the background color to black */ + pvr_set_bg_color(0.0f, 0.0f, 0.0f); + + /* load our world from romdisk */ + SetupWorld(); + + /* Load the textures */ + textures[0] = plx_txr_load("/rd/mud.png", 0, PVR_TXRLOAD_16BPP | PVR_TXRLOAD_INVERT_Y); + textures[1] = plx_txr_load("/rd/mud.png", 0, PVR_TXRLOAD_16BPP | PVR_TXRLOAD_INVERT_Y); + + plx_cxt_init(); // Initialize the plx context system + plx_cxt_culling(PLX_CULL_NONE); // No culling + + // GET SOME 3D GOING!! + plx_mat3d_init(); /* Clear internal to an identity matrix */ + plx_mat3d_mode(PLX_MAT_PROJECTION); /** Projection (frustum, screenview) matrix */ + plx_mat3d_identity(); /** Load an identity matrix */ + plx_mat3d_perspective(45.0f, 640.0f / 480.0f, 0.1f, 100.0f); // (float angle, float aspect, float znear, float zfar); + plx_mat3d_mode(PLX_MAT_MODELVIEW); /** Modelview (rotate, scale) matrix */ + + /* Set the filters for each texture */ + plx_txr_setfilter(textures[0], PLX_FILTER_NONE); + plx_txr_setfilter(textures[1], PLX_FILTER_BILINEAR); + + while(1) { + + /* Check key status */ + dev = maple_enum_dev(0, 0); + if(dev == NULL) { + printf("Error: Could not find controller in first port.\n"); + break; + } + state = (cont_state_t *)maple_dev_status(dev); + if (state->buttons & CONT_START) { + break; // exit the program + } + if (state->buttons & CONT_X && !xp) { + xp = 1; + filter += 1; // Toggle Filter + if (filter > 1) + filter = 0; + } + if (!(state->buttons & CONT_X)) { + xp = 0; + } + if (state->buttons & CONT_Y && !yp) { + yp = 1; + blend = !blend; // Toggle Blending + } + if (!(state->buttons & CONT_Y)) { + yp = 0; + } + if (state->buttons & CONT_A) { + lookupdown -= 1.0f; // look up + } + if (state->buttons & CONT_B) { + lookupdown += 1.0f; // look down + } + if (state->buttons & CONT_DPAD_UP) { + xpos -= fsin(yrot*piover180) * 0.05f; // moves you forward(bobbing head) + zpos -= fcos(yrot*piover180) * 0.05f; + if (walkbiasangle >= 359.0f) { + walkbiasangle = 0.0f; + } else { + walkbiasangle += 10.0f; + } + walkbias = fsin(walkbiasangle * piover180)/20.0f; + } + if (state->buttons & CONT_DPAD_DOWN) { + xpos += fsin(yrot*piover180) * 0.05f; // moves you backward(bobbing head) + zpos += fcos(yrot*piover180) * 0.05f; + if (walkbiasangle <= 1.0f) { + walkbiasangle = 359.0f; + } else { + walkbiasangle -= 10.0f; + } + walkbias = fsin(walkbiasangle * piover180)/20.0f; + } + if (state->buttons & CONT_DPAD_LEFT) { + yrot += 1.5f; // Turn Left + } + if (state->buttons & CONT_DPAD_RIGHT) { + yrot -= 1.5f; // Turn Right + } + + pvr_wait_ready(); + pvr_scene_begin(); + + if(blend) { + pvr_list_begin(PVR_LIST_TR_POLY); + plx_cxt_send(PVR_LIST_TR_POLY); // Submit the Header for PVR_LIST_TR_POLY + } else { + pvr_list_begin(PVR_LIST_OP_POLY); + plx_cxt_send(PVR_LIST_OP_POLY); // Submit the Header for PVR_LIST_OP_POLY + } + + /* Select texture according to filter */ + plx_cxt_texture(textures[filter]); + + xtrans = -xpos; // Used For Player Translation On The X Axis + ztrans = -zpos; // Used For Player Translation On The Z Axis + ytrans = -walkbias - 0.25f; // Used For Bouncing Motion Up And Down + sceneroty = 360.0f - yrot; // 360 Degree Angle For Player Direction + + plx_mat3d_identity(); + plx_mat3d_rotate(lookupdown, 1.0f, 0.0f, 0.0f); // Rotate Up And Down To Look Up And Down + plx_mat3d_rotate(sceneroty, 0.0f, 1.0f, 0.0f); // Rotate Depending On Direction Player Is Facing + plx_mat3d_translate(xtrans, ytrans, ztrans); // Translate The Scene Based On Player Position + + /* Clear internal to an identity matrix */ + plx_mat_identity(); + + /* "Applying" all matrixs: multiply a matrix onto the "internal" one */ + plx_mat3d_apply_all(); + + numtriangles = sector1.numtriangles; + + for (loop = 0; loop < numtriangles; loop++) { // loop through all the triangles + + // Vertex 1 + x_m = sector1.triangle[loop].vertex[0].x; + y_m = sector1.triangle[loop].vertex[0].y; + z_m = sector1.triangle[loop].vertex[0].z; + u_m = sector1.triangle[loop].vertex[0].u; + v_m = sector1.triangle[loop].vertex[0].v; + plx_vert_ifpm3(PLX_VERT, x_m, y_m, z_m, color, u_m, v_m); + + // Vertex 2 + x_m = sector1.triangle[loop].vertex[1].x; + y_m = sector1.triangle[loop].vertex[1].y; + z_m = sector1.triangle[loop].vertex[1].z; + u_m = sector1.triangle[loop].vertex[1].u; + v_m = sector1.triangle[loop].vertex[1].v; + plx_vert_ifpm3(PLX_VERT, x_m, y_m, z_m, color, u_m, v_m); + + // Vertex 3 + x_m = sector1.triangle[loop].vertex[2].x; + y_m = sector1.triangle[loop].vertex[2].y; + z_m = sector1.triangle[loop].vertex[2].z; + u_m = sector1.triangle[loop].vertex[2].u; + v_m = sector1.triangle[loop].vertex[2].v; + plx_vert_ifpm3(PLX_VERT_EOS, x_m, y_m, z_m, color, u_m, v_m); + + } + pvr_scene_finish(); + } + // Clean up!!! + free(sector1.triangle); + plx_txr_destroy(textures[0]); + plx_txr_destroy(textures[1]); + + return 0; +} + diff --git a/POWERVR/SRCS/NeHe/Lesson9/romdisk/Thumbs.db b/POWERVR/SRCS/NeHe/Lesson9/romdisk/Thumbs.db new file mode 100644 index 00000000..b581916b Binary files /dev/null and b/POWERVR/SRCS/NeHe/Lesson9/romdisk/Thumbs.db differ diff --git a/POWERVR/SRCS/NeHe/Lesson9/romdisk/mud.png b/POWERVR/SRCS/NeHe/Lesson9/romdisk/mud.png new file mode 100644 index 00000000..b871bb48 Binary files /dev/null and b/POWERVR/SRCS/NeHe/Lesson9/romdisk/mud.png differ diff --git a/POWERVR/SRCS/NeHe/Lesson9/romdisk/world.txt b/POWERVR/SRCS/NeHe/Lesson9/romdisk/world.txt new file mode 100644 index 00000000..a3368bba --- /dev/null +++ b/POWERVR/SRCS/NeHe/Lesson9/romdisk/world.txt @@ -0,0 +1,160 @@ + +NUMPOLLIES 36 + +// Floor 1 +-3.0 0.0 -3.0 0.0 6.0 +-3.0 0.0 3.0 0.0 0.0 + 3.0 0.0 3.0 6.0 0.0 + +-3.0 0.0 -3.0 0.0 6.0 + 3.0 0.0 -3.0 6.0 6.0 + 3.0 0.0 3.0 6.0 0.0 + +// Ceiling 1 +-3.0 1.0 -3.0 0.0 6.0 +-3.0 1.0 3.0 0.0 0.0 + 3.0 1.0 3.0 6.0 0.0 +-3.0 1.0 -3.0 0.0 6.0 + 3.0 1.0 -3.0 6.0 6.0 + 3.0 1.0 3.0 6.0 0.0 + +// A1 + +-2.0 1.0 -2.0 0.0 1.0 +-2.0 0.0 -2.0 0.0 0.0 +-0.5 0.0 -2.0 1.5 0.0 +-2.0 1.0 -2.0 0.0 1.0 +-0.5 1.0 -2.0 1.5 1.0 +-0.5 0.0 -2.0 1.5 0.0 + +// A2 + + 2.0 1.0 -2.0 2.0 1.0 + 2.0 0.0 -2.0 2.0 0.0 + 0.5 0.0 -2.0 0.5 0.0 + 2.0 1.0 -2.0 2.0 1.0 + 0.5 1.0 -2.0 0.5 1.0 + 0.5 0.0 -2.0 0.5 0.0 + +// B1 + +-2.0 1.0 2.0 2.0 1.0 +-2.0 0.0 2.0 2.0 0.0 +-0.5 0.0 2.0 0.5 0.0 +-2.0 1.0 2.0 2.0 1.0 +-0.5 1.0 2.0 0.5 1.0 +-0.5 0.0 2.0 0.5 0.0 + +// B2 + + 2.0 1.0 2.0 2.0 1.0 + 2.0 0.0 2.0 2.0 0.0 + 0.5 0.0 2.0 0.5 0.0 + 2.0 1.0 2.0 2.0 1.0 + 0.5 1.0 2.0 0.5 1.0 + 0.5 0.0 2.0 0.5 0.0 + +// C1 + +-2.0 1.0 -2.0 0.0 1.0 +-2.0 0.0 -2.0 0.0 0.0 +-2.0 0.0 -0.5 1.5 0.0 +-2.0 1.0 -2.0 0.0 1.0 +-2.0 1.0 -0.5 1.5 1.0 +-2.0 0.0 -0.5 1.5 0.0 + +// C2 + +-2.0 1.0 2.0 2.0 1.0 +-2.0 0.0 2.0 2.0 0.0 +-2.0 0.0 0.5 0.5 0.0 +-2.0 1.0 2.0 2.0 1.0 +-2.0 1.0 0.5 0.5 1.0 +-2.0 0.0 0.5 0.5 0.0 + +// D1 + +2.0 1.0 -2.0 0.0 1.0 +2.0 0.0 -2.0 0.0 0.0 +2.0 0.0 -0.5 1.5 0.0 +2.0 1.0 -2.0 0.0 1.0 +2.0 1.0 -0.5 1.5 1.0 +2.0 0.0 -0.5 1.5 0.0 + +// D2 + +2.0 1.0 2.0 2.0 1.0 +2.0 0.0 2.0 2.0 0.0 +2.0 0.0 0.5 0.5 0.0 +2.0 1.0 2.0 2.0 1.0 +2.0 1.0 0.5 0.5 1.0 +2.0 0.0 0.5 0.5 0.0 + +// Upper hallway - L +-0.5 1.0 -3.0 0.0 1.0 +-0.5 0.0 -3.0 0.0 0.0 +-0.5 0.0 -2.0 1.0 0.0 +-0.5 1.0 -3.0 0.0 1.0 +-0.5 1.0 -2.0 1.0 1.0 +-0.5 0.0 -2.0 1.0 0.0 + +// Upper hallway - R +0.5 1.0 -3.0 0.0 1.0 +0.5 0.0 -3.0 0.0 0.0 +0.5 0.0 -2.0 1.0 0.0 +0.5 1.0 -3.0 0.0 1.0 +0.5 1.0 -2.0 1.0 1.0 +0.5 0.0 -2.0 1.0 0.0 + +// Lower hallway - L +-0.5 1.0 3.0 0.0 1.0 +-0.5 0.0 3.0 0.0 0.0 +-0.5 0.0 2.0 1.0 0.0 +-0.5 1.0 3.0 0.0 1.0 +-0.5 1.0 2.0 1.0 1.0 +-0.5 0.0 2.0 1.0 0.0 + +// Lower hallway - R +0.5 1.0 3.0 0.0 1.0 +0.5 0.0 3.0 0.0 0.0 +0.5 0.0 2.0 1.0 0.0 +0.5 1.0 3.0 0.0 1.0 +0.5 1.0 2.0 1.0 1.0 +0.5 0.0 2.0 1.0 0.0 + + +// Left hallway - Lw + +-3.0 1.0 0.5 1.0 1.0 +-3.0 0.0 0.5 1.0 0.0 +-2.0 0.0 0.5 0.0 0.0 +-3.0 1.0 0.5 1.0 1.0 +-2.0 1.0 0.5 0.0 1.0 +-2.0 0.0 0.5 0.0 0.0 + +// Left hallway - Hi + +-3.0 1.0 -0.5 1.0 1.0 +-3.0 0.0 -0.5 1.0 0.0 +-2.0 0.0 -0.5 0.0 0.0 +-3.0 1.0 -0.5 1.0 1.0 +-2.0 1.0 -0.5 0.0 1.0 +-2.0 0.0 -0.5 0.0 0.0 + +// Right hallway - Lw + +3.0 1.0 0.5 1.0 1.0 +3.0 0.0 0.5 1.0 0.0 +2.0 0.0 0.5 0.0 0.0 +3.0 1.0 0.5 1.0 1.0 +2.0 1.0 0.5 0.0 1.0 +2.0 0.0 0.5 0.0 0.0 + +// Right hallway - Hi + +3.0 1.0 -0.5 1.0 1.0 +3.0 0.0 -0.5 1.0 0.0 +2.0 0.0 -0.5 0.0 0.0 +3.0 1.0 -0.5 1.0 1.0 +2.0 1.0 -0.5 0.0 1.0 +2.0 0.0 -0.5 0.0 0.0 \ No newline at end of file diff --git a/POWERVR/SRCS/dreamroq-r2.2/LICENSE.KOS b/POWERVR/SRCS/dreamroq-r2.2/LICENSE.KOS new file mode 100644 index 00000000..464d6a1d --- /dev/null +++ b/POWERVR/SRCS/dreamroq-r2.2/LICENSE.KOS @@ -0,0 +1,64 @@ +Dreamroq is covered under the same terms as the KallistiOS license which +is copied below: + + +Most of the code of KallistiOS proper is currently covered under the KOS +License, which are the terms of the *new* BSD license with our names +inserted as the copyright holders and the "advertising clause" removed +entirely. In all files that state that they are part of the KallistiOS +operating system, you can assume that the following text is inserted in +the header: + +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the KOS License. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* KOS License (README.KOS) for more details. +* +* You should have received a copy of the KOS License along with this +* program; if not, please visit Cryptic Allusion DCDev at: +* +* http://dcdev.allusion.net/ +* + +The text of that license follows. In layman's terms, all it really +says is that you have to give credit where credit is due (both in +derived source files and binary compilations; a credit in the +documentation is ok) and there is no warranty. + + Dan Potter + + +All of the documentation and software included in the KallistiOS Releases +is copyrighted (c)2000-2002 by Dan Potter and others (as noted in each file). + +Copyright 2000, 2001, 2002 + Dan Potter and others (as noted in each file). All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of Cryptic Allusion nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + diff --git a/POWERVR/SRCS/dreamroq-r2.2/Makefile b/POWERVR/SRCS/dreamroq-r2.2/Makefile new file mode 100644 index 00000000..ce37af78 --- /dev/null +++ b/POWERVR/SRCS/dreamroq-r2.2/Makefile @@ -0,0 +1,6 @@ +all: test-dreamroq + +test-dreamroq: test-dreamroq.o dreamroqlib.o + +clean: + rm -f *.o test-dreamroq diff --git a/POWERVR/SRCS/dreamroq-r2.2/Makefile.kos b/POWERVR/SRCS/dreamroq-r2.2/Makefile.kos new file mode 100644 index 00000000..d5e188ff --- /dev/null +++ b/POWERVR/SRCS/dreamroq-r2.2/Makefile.kos @@ -0,0 +1,38 @@ +# Put the filename of the output binary here +TARGET = dreamroq-player.elf + +# List all of your C files here, but change the extension to ".o" +OBJS = dreamroq-player.o dreamroqlib.o + +#AICA Audio Driver +KOS_CFLAGS += -I. -Ilibdcmc/ +OBJS += libdcmc/timer.o +OBJS += libdcmc/snddrv.o + +#PVR Video Driver +OBJS += libdcmc/pvrdrv.o + +all: rm-elf $(TARGET) + +include $(KOS_BASE)/Makefile.rules + +clean: + -rm -f $(TARGET) $(OBJS) + +rm-elf: + -rm -f $(TARGET) + +# If you don't need a ROMDISK, then remove "romdisk.o" from the next few +# lines. Also change the -l arguments to include everything you need, +# such as -lmp3, etc.. these will need to go _before_ $(KOS_LIBS) +$(TARGET): $(OBJS) + $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ + $(OBJS) $(OBJEXTRA) $(KOS_LIBS) + +run: $(TARGET) + $(KOS_LOADER) $(TARGET) + +dist: + rm -f $(OBJS) romdisk.o romdisk.img + $(KOS_STRIP) $(TARGET) + diff --git a/POWERVR/SRCS/dreamroq-r2.2/README b/POWERVR/SRCS/dreamroq-r2.2/README new file mode 100644 index 00000000..47be67fc --- /dev/null +++ b/POWERVR/SRCS/dreamroq-r2.2/README @@ -0,0 +1,131 @@ +Dreamroq by Mike Melanson (mike -at- multimedia.cx) +R2 update by Josh Pearson (ph3nom.dcmc@gmail.com) + +Introduction +============ +Dreamroq is a RoQ playback library designed for the Sega Dreamcast video +game console. + +RoQ is a relatively simple video file format developed for video-heavy +CD-ROM games. Read more about the format here: + +http://wiki.multimedia.cx/index.php?title=RoQ + +The Dreamroq library includes a player component that is designed to run +under the KallistiOS (KOS) open source operating system. Read more about +KOS at: + +http://gamedev.allusion.net/softprj/kos/ + +The library also includes a sample testing utility that can be built +and executed on Unix systems. This utility is useful for debugging and +validation. + +RoQ sample files can be found at: + +http://samples.mplayerhq.hu/game-formats/idroq/ + +RoQ files can also be created using the Switchblade encoder: + +http://icculus.org/~riot/ + +A version of Switchblade is also included in FFmpeg and many derivative +programs: + +http://ffmpeg.org/ + + +License +======= +Dreamroq is meant to be license-compatible with the rest of the KallistiOS +operating system, which is a BSD-style open source license. You can read +the specific text in LICENSE.KOS. + + +Building (Unix) +=============== +To build and test on Linux/Mac OS X/Cygwin, simply type: + + make + +in the source directory. This will build the executable test-dreamroq. This +utility has the following usage: + + ./test-dreamroq + +This will decode the RoQ file from the command line into a series of PNM +files in the current working directory (watch out-- this could take up a +lot of disk space). + + +Building (KOS) +============== +There are 2 Makefiles included with Dreamroq. The first -- implicitly +invoked when running a bare 'make' command as seen in the "Building (Unix)" +section -- builds the test utility. The second Makefile is Makefile.KOS, +invoked with: + + make -f Makefile.KOS + +This is a standard KOS Makefile which assumes that a KOS build environment +is available. This is covered in the KOS documentation. This step will +build a file named dreamroq-player.elf which can be loaded onto a Dreamcast +console via standard means (also outside the scope of this document). + +The file dreamcast-player.c contains a hardcoded RoQ file path in its +main function. It is best if this points to a file burned on an optical +disc. It is also viable to build a small RoQ file as a ROM disk into the +ELF file (which is well supported in KOS) and load the file from the '/rd' +mount point. + + +Bugs, Issues, and Future Development +==================================== + +:R2 Release by PH3NOM: + +I have updated the dreamroq library to support decoding of DPCM +audio samples encoded in the RoQ stream. + +The KOS Dreamcast player has been updated to support streaming +of the decoded samples, directly using the Dreamcast's AICA +audio hardware, running in a seperate thread. + +DMA transfers to the PVR and rendering of the frame is executed +in a seperate thread, so the decoder can continue to process the +next frame while the current frame is being processed by the PVR. + +Furthermore, a frame-rate timer has been implemented, so the video +should be played back at correct speed. Also, the allocated PVR +memory is now freed on exit of the player. + +==================================== +/* deprecated */ +The library only does video playback; no sound right now. + +The video decoder is not 100% correct yet. You will likely notice a few +artifacts which need to be ironed out. + +Many of the video rendering modes could be optimized slightly by copying +pairs of pixels as 32-bit units. This should work on any mode except motion +compensated blocks; the latter could experience alignment issues which +the DC's SH-4 can't handle. + +The library is a tad slow. Profiling indicates that the main bottleneck +is loading data from disc; the video decoder itself is pretty fast. The +player might benefit by moving data loading (I/O-bound operation) into a +separate thread. For that matter, the phase which sends the decoded +texture to the graphics hardware via DMA and renders it should also be +in a separate thread. + +The player is just a proof of concept at this point. It doesn't try to +render frames with proper timing-- it just plays them as fast as possible +(which often isn't very fast, mostly due to the I/O bottleneck). + +If the RoQ video is taller than it is wide, expect some odd rendering. + +The API between the library and the client app leaves a bit to be desired. +Notably absent is some proper initialization and teardown mechanism. +Currently, the first call to the render callback initializes the PVR buffers +but they are never explicitly freed. + diff --git a/POWERVR/SRCS/dreamroq-r2.2/dreamroq-player.c b/POWERVR/SRCS/dreamroq-r2.2/dreamroq-player.c new file mode 100644 index 00000000..2c941bc2 --- /dev/null +++ b/POWERVR/SRCS/dreamroq-r2.2/dreamroq-player.c @@ -0,0 +1,207 @@ +/* +* Dreamroq by Mike Melanson +* Updated by Josh Pearson to add audio support +* +* This is the sample Dreamcast player app, designed to be run under +* the KallistiOS operating system. +*/ + +#include +#include +#include + +#include +#include +#include +#include + +#include "dreamroqlib.h" + +#include "pvr_driver.h" +#include "snddrv.h" +#include "dc_timer.h" + +/* Audio Global variables */ +#define PCM_BUF_SIZE 1024*1024 +static unsigned char *pcm_buf = NULL; +static int pcm_size = 0; +static int audio_init = 0; +static mutex_t * pcm_mut; + +/* Video Global variables */ +static int graphics_initialized = 0; +static float video_delay; +static int frame=0; +static unsigned char *vidbuf; /* Video Address */ +static kthread_t * render_thread; /* Video thread */ +static volatile int render_thd=0; /* Video thread status */ +static const float VIDEO_RATE = 25.0f; /* Video FPS */ + +/* PVR Driver Handle */ +static struct pvr_frame roq_vram_ptr; +static struct pvr_frame_vertex roq_vram_vertex; + +static void audio_thd() +{ + do + { + /* Wait for AICA Driver to request some samples */ + while( snddrv.buf_status != SNDDRV_STATUS_NEEDBUF ) + thd_pass(); + + /* Wait for RoQ Decoder to produce enough samples */ + while( pcm_size < snddrv.pcm_needed ) + { + if( snddrv.dec_status == SNDDEC_STATUS_DONE ) + goto done; + thd_pass(); + } + + /* Copy the Requested PCM Samples to the AICA Driver */ + mutex_lock( pcm_mut ); + memcpy( snddrv.pcm_buffer, pcm_buf, snddrv.pcm_needed ); + + /* Shift the Remaining PCM Samples Back */ + pcm_size -= snddrv.pcm_needed; + memmove( pcm_buf, pcm_buf+snddrv.pcm_needed, pcm_size ); + mutex_unlock( pcm_mut ); + + /* Let the AICA Driver know the PCM samples are ready */ + snddrv.buf_status = SNDDRV_STATUS_HAVEBUF; + + } while( snddrv.dec_status == SNDDEC_STATUS_STREAMING ); + done: + snddrv.dec_status = SNDDEC_STATUS_NULL; +} + +static void video_thd() +{ + render_thd=1; /* Signal Thread is active */ + + /* Load the Texture from RAM to VRAM using DMA */ + pvr_dma_load( (unsigned char *)vidbuf, &roq_vram_ptr); + + /* Delay the frame to match Frame Rate */ + frame_delay( VIDEO_RATE, video_delay, ++frame ); + + /* Draw the frame using the PVR */ + pvr_draw_frame_dma(&roq_vram_ptr); + + render_thd=0; /* Signal Thread is finished */ + +} + +static int render_cb(unsigned short *buf, int width, int height, int stride, + int texture_height) +{ + /* on first call, initialize textures and drawing coordinates */ + if (!graphics_initialized) + { + /* Allocate VRAM for current texture */ + pvr_malloc( &roq_vram_ptr, width, height ); + + /* Compile the PVR Driver Handle */ + pvr_resize_resolution( roq_vram_ptr, &roq_vram_vertex ); + pvr_compile_poly(roq_vram_vertex, &roq_vram_ptr, + PVR_LIST_OP_POLY, PVR_TXRFMT_RGB565 | PVR_TXRFMT_NONTWIDDLED, 10.0f); + + /* Get current hardware timing */ + video_delay = (float)dc_get_time(); + + graphics_initialized = 1; + } + + /* Wait for last frame to finish render */ + while( render_thd ) + thd_pass(); + + /* Current decoded frame */ + vidbuf = buf; + + /* Create a thread to render the current frame */ + render_thread = thd_create( video_thd, NULL ); + + return ROQ_SUCCESS; +} + +static int audio_cb( unsigned char *buf, int size, int channels) +{ + if(!audio_init) + { + /* allocate PCM buffer */ + pcm_buf = malloc(PCM_BUF_SIZE); + if( pcm_buf == NULL ) + return ROQ_NO_MEMORY; + + /* Start AICA Driver */ + snddrv_start( 22050, channels ); + snddrv.dec_status = SNDDEC_STATUS_STREAMING; + + /* Create a thread to stream the samples to the AICA */ + thd_create( audio_thd, NULL ); + + /* Create a mutex to handle the double-threaded buffer */ + pcm_mut = mutex_create(); + + audio_init=1; + } + + /* Copy the decoded PCM samples to our local PCM buffer */ + mutex_lock( pcm_mut ); + memcpy( pcm_buf+pcm_size, buf, size); + pcm_size += size; + mutex_unlock( pcm_mut ); + + return ROQ_SUCCESS; +} + +static int quit_cb() +{ + cont_cond_t cont; + + /* check controller state */ + if (cont_get_cond(maple_first_controller(), &cont)) + { + /* controller read error */ + return 1; + } + cont.buttons = ~cont.buttons; + return (cont.buttons & CONT_START); +} + +int main() +{ + int status=0; + + vid_set_mode(DM_640x480, PM_RGB565); + pvr_init_defaults(); + pvr_dma_init(); + + printf("dreamroq_play(C) Multimedia Mike Melanson & Josh PH3NOM Pearson 2011\n"); + + /* To disable a callback, simply replace the function name by 0 */ + status = dreamroq_play("/cd/sample.roq", 0, render_cb, audio_cb, quit_cb); + + printf("dreamroq_play() status = %d\n", status); + + if(audio_init) + { + snddrv.dec_status = SNDDEC_STATUS_DONE; /* Singal audio thread to stop */ + while( snddrv.dec_status != SNDDEC_STATUS_NULL ) + thd_pass(); + free( pcm_buf ); + pcm_buf = NULL; + pcm_size = 0; + mutex_destroy(pcm_mut); /* Destroy the PCM mutex */ + snddrv_exit(); /* Exit the AICA Driver */ + } + + if(graphics_initialized) + { + pvr_free( &roq_vram_ptr ); /* Free the PVR memory */ + } + + pvr_dma_shutdown(); + + return 0; +} diff --git a/POWERVR/SRCS/dreamroq-r2.2/dreamroqlib.c b/POWERVR/SRCS/dreamroq-r2.2/dreamroqlib.c new file mode 100644 index 00000000..1d648158 --- /dev/null +++ b/POWERVR/SRCS/dreamroq-r2.2/dreamroqlib.c @@ -0,0 +1,579 @@ +/* + * Dreamroq by Mike Melanson + * Updated by Josh Pearson to add audio support + * + * This is the main playback engine. + */ + +#include +#include +#include + +#include "dreamroqlib.h" + +#define RoQ_INFO 0x1001 +#define RoQ_QUAD_CODEBOOK 0x1002 +#define RoQ_QUAD_VQ 0x1011 +#define RoQ_SOUND_MONO 0x1020 +#define RoQ_SOUND_STEREO 0x1021 +#define RoQ_SIGNATURE 0x1084 + +#define CHUNK_HEADER_SIZE 8 + +#define LE_16(buf) (*buf | (*(buf+1) << 8)) +#define LE_32(buf) (*buf | (*(buf+1) << 8) | (*(buf+2) << 16) | (*(buf+3) << 24)) + +#define MAX_BUF_SIZE (64 * 1024) + +#define ROQ_CODEBOOK_SIZE 256 + +struct roq_audio +{ + int pcm_samples; + int channels; + int position; + short snd_sqr_arr[260]; + unsigned char pcm_sample[MAX_BUF_SIZE]; +}roq_audio; + +typedef struct +{ + int width; + int height; + int mb_width; + int mb_height; + int mb_count; + + int current_frame; + unsigned short *frame[2]; + int stride; + int texture_height; + + unsigned short cb2x2[ROQ_CODEBOOK_SIZE][4]; + unsigned short cb4x4[ROQ_CODEBOOK_SIZE][16]; +} roq_state; + + + +static int roq_unpack_quad_codebook(unsigned char *buf, int size, int arg, + roq_state *state) +{ + int y[4]; + int yp, u, v; + int r, g, b; + int count2x2; + int count4x4; + int i, j; + unsigned short *v2x2; + unsigned short *v4x4; + + count2x2 = (arg >> 8) & 0xFF; + count4x4 = arg & 0xFF; + + if (!count2x2) + count2x2 = ROQ_CODEBOOK_SIZE; + /* 0x00 means 256 4x4 vectors iff there is enough space in the chunk + * after accounting for the 2x2 vectors */ + if (!count4x4 && count2x2 * 6 < size) + count4x4 = ROQ_CODEBOOK_SIZE; + + /* size sanity check */ + if ((count2x2 * 6 + count4x4 * 4) != size) + { + return ROQ_BAD_CODEBOOK; + } + + /* unpack the 2x2 vectors */ + for (i = 0; i < count2x2; i++) + { + /* unpack the YUV components from the bytestream */ + for (j = 0; j < 4; j++) + y[j] = *buf++; + u = *buf++; + v = *buf++; + + /* convert to RGB565 */ + for (j = 0; j < 4; j++) + { + yp = (y[j] - 16) * 1.164; + r = (yp + 1.596 * (v - 128)) / 8; + g = (yp - 0.813 * (v - 128) - 0.391 * (u - 128)) / 4; + b = (yp + 2.018 * (u - 128)) / 8; + + if (r < 0) r = 0; + if (r > 31) r = 31; + if (g < 0) g = 0; + if (g > 63) g = 63; + if (b < 0) b = 0; + if (b > 31) b = 31; + + state->cb2x2[i][j] = ( + (r << 11) | + (g << 5) | + (b << 0) ); + } + } + + /* unpack the 4x4 vectors */ + for (i = 0; i < count4x4; i++) + { + for (j = 0; j < 4; j++) + { + v2x2 = state->cb2x2[*buf++]; + v4x4 = state->cb4x4[i] + (j / 2) * 8 + (j % 2) * 2; + v4x4[0] = v2x2[0]; + v4x4[1] = v2x2[1]; + v4x4[4] = v2x2[2]; + v4x4[5] = v2x2[3]; + } + } + + return ROQ_SUCCESS; +} + +#define GET_BYTE(x) \ + if (index >= size) { \ + status = ROQ_BAD_VQ_STREAM; \ + x = 0; \ + } else { \ + x = buf[index++]; \ + } + +#define GET_MODE() \ + if (!mode_count) { \ + GET_BYTE(mode_lo); \ + GET_BYTE(mode_hi); \ + mode_set = (mode_hi << 8) | mode_lo; \ + mode_count = 16; \ + } \ + mode_count -= 2; \ + mode = (mode_set >> mode_count) & 0x03; + +static int roq_unpack_vq(unsigned char *buf, int size, unsigned int arg, + roq_state *state) +{ + int status = ROQ_SUCCESS; + int mb_x, mb_y; + int block; /* 8x8 blocks */ + int subblock; /* 4x4 blocks */ + int stride = state->stride; + int i; + + /* frame and pixel management */ + unsigned short *this_frame; + unsigned short *last_frame; + + int line_offset; + int mb_offset; + int block_offset; + int subblock_offset; + + unsigned short *this_ptr; + unsigned int *this_ptr32; + unsigned short *last_ptr; + /*unsigned int *last_ptr32;*/ + unsigned short *vector16; + unsigned int *vector32; + int stride32 = stride / 2; + + /* bytestream management */ + int index = 0; + int mode_set = 0; + int mode, mode_lo, mode_hi; + int mode_count = 0; + + /* vectors */ + int mx, my; + int motion_x, motion_y; + unsigned char data_byte; + + mx = (arg >> 8) & 0xFF; + my = arg & 0xFF; + + if (state->current_frame == 1) + { + state->current_frame = 0; + this_frame = state->frame[0]; + last_frame = state->frame[1]; + } + else + { + state->current_frame = 1; + this_frame = state->frame[1]; + last_frame = state->frame[0]; + } + + for (mb_y = 0; mb_y < state->mb_height && status == ROQ_SUCCESS; mb_y++) + { + line_offset = mb_y * 16 * stride; + for (mb_x = 0; mb_x < state->mb_width && status == ROQ_SUCCESS; mb_x++) + { + mb_offset = line_offset + mb_x * 16; + for (block = 0; block < 4 && status == ROQ_SUCCESS; block++) + { + block_offset = mb_offset + (block / 2 * 8 * stride) + (block % 2 * 8); + /* each 8x8 block gets a mode */ + GET_MODE(); + switch (mode) + { + case 0: /* MOT: skip */ + break; + + case 1: /* FCC: motion compensation */ + /* this needs to be done 16 bits at a time due to + * data alignment issues on the SH-4 */ + GET_BYTE(data_byte); + motion_x = 8 - (data_byte >> 4) - mx; + motion_y = 8 - (data_byte & 0xF) - my; + last_ptr = last_frame + block_offset + + (motion_y * stride) + motion_x; + this_ptr = this_frame + block_offset; + for (i = 0; i < 8; i++) + { + *this_ptr++ = *last_ptr++; + *this_ptr++ = *last_ptr++; + *this_ptr++ = *last_ptr++; + *this_ptr++ = *last_ptr++; + *this_ptr++ = *last_ptr++; + *this_ptr++ = *last_ptr++; + *this_ptr++ = *last_ptr++; + *this_ptr++ = *last_ptr++; + + last_ptr += stride - 8; + this_ptr += stride - 8; + } + break; + + case 2: /* SLD: upsample 4x4 vector */ + GET_BYTE(data_byte); + vector16 = state->cb4x4[data_byte]; + for (i = 0; i < 4*4; i++) + { + this_ptr = this_frame + block_offset + + (i / 4 * 2 * stride) + (i % 4 * 2); + this_ptr[0] = *vector16; + this_ptr[1] = *vector16; + this_ptr[stride+0] = *vector16; + this_ptr[stride+1] = *vector16; + vector16++; + } + break; + + case 3: /* CCC: subdivide into 4 subblocks */ + for (subblock = 0; subblock < 4; subblock++) + { + subblock_offset = block_offset + (subblock / 2 * 4 * stride) + (subblock % 2 * 4); + + GET_MODE(); + switch (mode) + { + case 0: /* MOT: skip */ + break; + + case 1: /* FCC: motion compensation */ + GET_BYTE(data_byte); + motion_x = 8 - (data_byte >> 4) - mx; + motion_y = 8 - (data_byte & 0xF) - my; + last_ptr = last_frame + subblock_offset + + (motion_y * stride) + motion_x; + this_ptr = this_frame + subblock_offset; + for (i = 0; i < 4; i++) + { + *this_ptr++ = *last_ptr++; + *this_ptr++ = *last_ptr++; + *this_ptr++ = *last_ptr++; + *this_ptr++ = *last_ptr++; + + last_ptr += stride - 4; + this_ptr += stride - 4; + } + break; + + case 2: /* SLD: use 4x4 vector from codebook */ + GET_BYTE(data_byte); + vector32 = (unsigned int*)state->cb4x4[data_byte]; + + this_ptr32 = (unsigned int*)this_frame; + this_ptr32 += subblock_offset / 2; + for (i = 0; i < 4; i++) + { + *this_ptr32++ = *vector32++; + *this_ptr32++ = *vector32++; + + + this_ptr32 += stride32 - 2; + } + break; + + case 3: /* CCC: subdivide into 4 subblocks */ + GET_BYTE(data_byte); + vector16 = state->cb2x2[data_byte]; + this_ptr = this_frame + subblock_offset; + + + this_ptr[0] = vector16[0]; + this_ptr[1] = vector16[1]; + this_ptr[stride+0] = vector16[2]; + this_ptr[stride+1] = vector16[3]; + + GET_BYTE(data_byte); + vector16 = state->cb2x2[data_byte]; + + + this_ptr[2] = vector16[0]; + this_ptr[3] = vector16[1]; + this_ptr[stride+2] = vector16[2]; + this_ptr[stride+3] = vector16[3]; + + this_ptr += stride * 2; + + GET_BYTE(data_byte); + vector16 = state->cb2x2[data_byte]; + + + this_ptr[0] = vector16[0]; + this_ptr[1] = vector16[1]; + this_ptr[stride+0] = vector16[2]; + this_ptr[stride+1] = vector16[3]; + + GET_BYTE(data_byte); + vector16 = state->cb2x2[data_byte]; + + + this_ptr[2] = vector16[0]; + this_ptr[3] = vector16[1]; + this_ptr[stride+2] = vector16[2]; + this_ptr[stride+3] = vector16[3]; + + break; + } + } + break; + } + } + } + } + + /* sanity check to see if the stream was fully consumed */ + if (status == ROQ_SUCCESS && index < size-2) + { + status = ROQ_BAD_VQ_STREAM; + } + + return status; +} + +int dreamroq_play(char *filename, int loop, render_callback render_cb, + audio_callback audio_cb, quit_callback quit_cb) +{ + FILE *f; + size_t file_ret; + int framerate; + int chunk_id; + unsigned int chunk_size; + unsigned int chunk_arg; + roq_state state; + int status; + int initialized = 0; + unsigned char read_buffer[MAX_BUF_SIZE]; + int i, snd_left, snd_right; + + f = fopen(filename, "rb"); + if (!f) + return ROQ_FILE_OPEN_FAILURE; + + file_ret = fread(read_buffer, CHUNK_HEADER_SIZE, 1, f); + if (file_ret != 1) + { + fclose(f); + printf("\nROQ_FILE_READ_FAILURE\n\n"); + return ROQ_FILE_READ_FAILURE; + + } + chunk_id = LE_16(&read_buffer[0]); + chunk_size = LE_32(&read_buffer[2]); + if (chunk_id != RoQ_SIGNATURE || chunk_size != 0xFFFFFFFF) + { + fclose(f); + return ROQ_FILE_READ_FAILURE; + } + framerate = LE_16(&read_buffer[6]); + printf("RoQ file plays at %d frames/sec\n", framerate); + + /* Initialize Audio SQRT Look-Up Table */ + for(i = 0; i < 128; i++) + { + roq_audio.snd_sqr_arr[i] = i * i; + roq_audio.snd_sqr_arr[i + 128] = -(roq_audio.snd_sqr_arr[i]); + } + + status = ROQ_SUCCESS; + while (!feof(f) && status == ROQ_SUCCESS) + { + /* if client program defined a quit callback, check if it's time + * to quit */ + if (quit_cb && quit_cb()) + break; + + file_ret = fread(read_buffer, CHUNK_HEADER_SIZE, 1, f); + #ifdef FPSGRAPH + printf("r\n"); + #endif + if (file_ret != 1) + { + /* if the read failed but the file is not EOF, there is a deeper + * problem; don't entertain the idea of looping */ + if (!feof(f)) + break; + else if (loop) + { + /* it shouldn't be necessary to close and re-open the file + * here; however, this works around a bug in KOS 1.2.0 in + * which seeking back doesn't clear the EOF flag */ + //fclose(f); + //f = fopen(filename, "rb"); + if (!f) + status = ROQ_FILE_OPEN_FAILURE; + else + { + /* skip the signature header */ + fseek(f, 8, SEEK_SET); + continue; + } + } + else + break; + } + + chunk_id = LE_16(&read_buffer[0]); + chunk_size = LE_32(&read_buffer[2]); + chunk_arg = LE_16(&read_buffer[6]); + + if (chunk_size > MAX_BUF_SIZE) + { + fclose(f); + return ROQ_CHUNK_TOO_LARGE; + } + + file_ret = fread(read_buffer, chunk_size, 1, f); + if (file_ret != 1) + { + status = ROQ_FILE_READ_FAILURE; + break; + } + + switch(chunk_id) + { + case RoQ_INFO: + if (initialized) + continue; + + state.width = LE_16(&read_buffer[0]); + state.height = LE_16(&read_buffer[2]); + /* width and height each need to be divisible by 16 */ + if ((state.width & 0xF) || (state.height & 0xF)) + { + status = ROQ_INVALID_PIC_SIZE; + break; + } + state.mb_width = state.width / 16; + state.mb_height = state.height / 16; + state.mb_count = state.mb_width * state.mb_height; + if (state.width < 8 || state.width > 1024) + status = ROQ_INVALID_DIMENSION; + else + { + state.stride = 8; + while (state.stride < state.width) + state.stride <<= 1; + } + if (state.height < 8 || state.height > 1024) + status = ROQ_INVALID_DIMENSION; + else + { + state.texture_height = 8; + while (state.texture_height < state.height) + state.texture_height <<= 1; + } + + printf(" RoQ_INFO: dimensions = %dx%d, %dx%d; %d mbs, texture = %dx%d\n", + state.width, state.height, state.mb_width, state.mb_height, + state.mb_count, state.stride, state.texture_height); + + state.frame[0] = (unsigned short*)memalign(32,state.texture_height * state.stride * sizeof(unsigned short)); + state.frame[1] = (unsigned short*)memalign(32,state.texture_height * state.stride * sizeof(unsigned short)); + state.current_frame = 0; + if (!state.frame[0] || !state.frame[1]) + { + free (state.frame[0]); + free (state.frame[1]); + status = ROQ_NO_MEMORY; + break; + } + memset(state.frame[0], 0, state.texture_height * state.stride * sizeof(unsigned short)); + memset(state.frame[1], 0, state.texture_height * state.stride * sizeof(unsigned short)); + + /* set this flag so that this code is not executed again when + * looping */ + initialized = 1; + break; + + case RoQ_QUAD_CODEBOOK: + status = roq_unpack_quad_codebook(read_buffer, chunk_size, + chunk_arg, &state); + break; + + case RoQ_QUAD_VQ: + status = roq_unpack_vq(read_buffer, chunk_size, + chunk_arg, &state); + if (render_cb) + status = render_cb(state.frame[state.current_frame], + state.width, state.height, state.stride, state.texture_height); + break; + + case RoQ_SOUND_MONO: + roq_audio.channels = 1; + roq_audio.pcm_samples = chunk_size*2; + snd_left = chunk_arg; + for(i = 0; i < chunk_size; i++) + { + snd_left += roq_audio.snd_sqr_arr[read_buffer[i]]; + roq_audio.pcm_sample[i * 2] = snd_left & 0xff; + roq_audio.pcm_sample[i * 2 + 1] = (snd_left & 0xff00) >> 8; + } + if (audio_cb) + status = audio_cb( roq_audio.pcm_sample, roq_audio.pcm_samples, + roq_audio.channels ); + break; + + case RoQ_SOUND_STEREO: + roq_audio.channels = 2; + roq_audio.pcm_samples = chunk_size*2; + snd_left = (chunk_arg & 0xFF00); + snd_right = (chunk_arg & 0xFF) << 8; + for(i = 0; i < chunk_size; i += 2) + { + snd_left += roq_audio.snd_sqr_arr[read_buffer[i]]; + snd_right += roq_audio.snd_sqr_arr[read_buffer[i+1]]; + roq_audio.pcm_sample[i * 2] = snd_left & 0xff; + roq_audio.pcm_sample[i * 2 + 1] = (snd_left & 0xff00) >> 8; + roq_audio.pcm_sample[i * 2 + 2] = snd_right & 0xff; + roq_audio.pcm_sample[i * 2 + 3] = (snd_right & 0xff00) >> 8; + } + if (audio_cb) + status = audio_cb( roq_audio.pcm_sample, roq_audio.pcm_samples, + roq_audio.channels ); + break; + + default: + break; + } + } + + free(state.frame[0]); + free(state.frame[1]); + fclose(f); + + return status; +} + diff --git a/POWERVR/SRCS/dreamroq-r2.2/dreamroqlib.h b/POWERVR/SRCS/dreamroq-r2.2/dreamroqlib.h new file mode 100644 index 00000000..09f71764 --- /dev/null +++ b/POWERVR/SRCS/dreamroq-r2.2/dreamroqlib.h @@ -0,0 +1,37 @@ +/* + * Dreamroq by Mike Melanson + * + * This is the header file to be included in the programs wishing to + * use the Dreamroq playback engine. + */ + +#ifndef NEWROQ_H +#define NEWROQ_H + +#define ROQ_SUCCESS 0 +#define ROQ_FILE_OPEN_FAILURE 1 +#define ROQ_FILE_READ_FAILURE 2 +#define ROQ_CHUNK_TOO_LARGE 3 +#define ROQ_BAD_CODEBOOK 4 +#define ROQ_INVALID_PIC_SIZE 5 +#define ROQ_NO_MEMORY 6 +#define ROQ_BAD_VQ_STREAM 7 +#define ROQ_INVALID_DIMENSION 8 +#define ROQ_RENDER_PROBLEM 9 +#define ROQ_CLIENT_PROBLEM 10 + +/* The library calls this function when it has a frame ready for display. */ +typedef int (*render_callback)(unsigned short *buf, int width, int height, + int stride, int texture_height); + +/* The library calls this function when it has pcm samples ready for output. */ +typedef int (*audio_callback)(unsigned char *buf, int samples, int channels); + +/* The library calls this function to ask whether it should quit playback. + * Return non-zero if it's time to quite. */ +typedef int (*quit_callback)(); + +int dreamroq_play(char *filename, int loop, render_callback render_cb, + audio_callback audio_cb, quit_callback quit_cb); + +#endif /* NEWROQ_H */ diff --git a/POWERVR/SRCS/dreamroq-r2.2/libdcmc/dc_timer.h b/POWERVR/SRCS/dreamroq-r2.2/libdcmc/dc_timer.h new file mode 100644 index 00000000..6df1ee93 --- /dev/null +++ b/POWERVR/SRCS/dreamroq-r2.2/libdcmc/dc_timer.h @@ -0,0 +1,19 @@ +/* +** +** This File is a part of Dreamcast Media Center +** (C) Josh "PH3NOM" Pearson 2011 +** +*/ + +/* 'Public' Function Protocols */ + +#ifndef DCTIMER_H +#define DCTIMER_H + +/* Returns hardware time in miliseconds */ +int dc_get_time(); + +/* Regulate the Video Frame Rate */ +void frame_delay( float AVI_video_rate, float AVI_delay, int frameCounter ); + +#endif diff --git a/POWERVR/SRCS/dreamroq-r2.2/libdcmc/pvr_driver.h b/POWERVR/SRCS/dreamroq-r2.2/libdcmc/pvr_driver.h new file mode 100644 index 00000000..74984d48 --- /dev/null +++ b/POWERVR/SRCS/dreamroq-r2.2/libdcmc/pvr_driver.h @@ -0,0 +1,97 @@ +/* +** +** PVR Video Driver +** (C) Josh "PH3NOM" Pearson 2011-2012 +** +*/ + +#ifndef PVR_DRIVER_H +#define PVR_DRIVER_H + +#include +#include +//#include + +#define PVR_TEX_WIDTH 1024.0f +#define PVR_TEX_HEIGHT 1024.0f +#define DISPLAY_WIDTH 640 +#define DISPLAY_HEIGHT 480 +#define DISPLAY_AR 4/3 + +#include +mutex_t * pvr_mutex; +#define PVR_create_mutex() { pvr_mutex = mutex_create(); } +#define PVR_lock_mutex() { mutex_lock( pvr_mutex ); } +#define PVR_unlock_mutex() { mutex_unlock( pvr_mutex ); } +#define PVR_destroy_mutex() { mutex_destroy( pvr_mutex ); } + +struct pvr_frame +{ + int tex_width; + int tex_height; + int vram_width; + int vram_height; + int texFmt; + int texColor; + pvr_ptr_t * vram_tex; + pvr_vertex_t vert[4]; + pvr_poly_hdr_t poly; + pvr_poly_cxt_t cxt; +}; + +struct pvr_frame_vertex +{ + int top; + int bottom; + int left; + int right; + int width; + int height; + float height_ratio; + float width_ratio; +}; + +/* PVR Driver - Public Function Protocols */ +/* Driver functions require using above structures pvr_frame/pvr_frame_vertex */ + + +/* Allocate VRAM for the texture. Must be done before any PVR driver function */ +int pvr_malloc( struct pvr_frame *pvr, int width, int height ); + +/* Free allocated VRAM for the texture. Should be done when finished. */ +int pvr_free( struct pvr_frame *pvr ); + + +/* Automatically set polygon co-ordinates for fullscreen, before compiling */ +void pvr_resize_resolution( struct pvr_frame pvr, struct pvr_frame_vertex *display ); + +/* Manually set polygon co-ordinates, before compiling the polygon */ +int pvr_set_resolution( struct pvr_frame pvr, int x, int y, + int dispWidth, int dispHeight, struct pvr_frame_vertex *display ); + + +/* Compile the polygon. Only needs to be done once, before display */ +int pvr_compile_poly( struct pvr_frame_vertex display, struct pvr_frame *pvr, int mode, int fmt, float z ); + + +/* Load Texture Data from RAM to VRAM, Pixel by Pixel */ +/* To use this function, first PVR_create_mutex() must be called. */ +/* When finished, PVR_destroy_mutex() should be called */ +/* This function is intended for use with pvr_draw_frame() */ +void pvr_pixel_load( unsigned char *src, struct pvr_frame *pvr ); + +/* Load Texture Data from RAM to VRAM, 32bytes at a time */ +/* This function is intended for use with pvr_draw_frame() */ +void pvr_txr_load_sq( unsigned char *src, struct pvr_frame *pvr ); + +/* Load Texture Data from RAM to VRAM, using fast DMA */ +/* This function is intended for use with pvr_draw_frame_dma() */ +void pvr_dma_load( unsigned char *src, struct pvr_frame *pvr ); + +/* Draw a single Opaqe Polygon */ +void pvr_draw_frame( struct pvr_frame *pvr_frame ); + +/* Draw a single Opaqe Polygon with DMA enabled */ +void pvr_draw_frame_dma( struct pvr_frame *pvr_frame ); + +#endif diff --git a/POWERVR/SRCS/dreamroq-r2.2/libdcmc/pvrdrv.c b/POWERVR/SRCS/dreamroq-r2.2/libdcmc/pvrdrv.c new file mode 100644 index 00000000..9cf09ea5 --- /dev/null +++ b/POWERVR/SRCS/dreamroq-r2.2/libdcmc/pvrdrv.c @@ -0,0 +1,237 @@ +/* +** +** PVR Video Driver +** (C) Josh "PH3NOM" Pearson 2011-2012 +** +*/ + +#include + +#include "pvr_driver.h" + +/* Free PVR Ram */ +int pvr_free( struct pvr_frame *pvr ) +{ + if(pvr->vram_tex) + { + pvr_mem_free(pvr->vram_tex); + return 1; + } + + return 0; +} + +/* Find and allocate the smallest possible PVR VRAM texture area */ +int pvr_malloc( struct pvr_frame *pvr, int width, int height ) +{ + /* Set the texture context width and height */ + pvr->tex_width = width; + pvr->tex_height = height; + + /* Check if Texture resolution exceeds PVR maximum */ + if ( pvr->tex_width > PVR_TEX_WIDTH || pvr->tex_height > PVR_TEX_HEIGHT ) { + printf("ERROR: IMAGE Exceeds PVR maximum resolution!\n"); + return 0; + } + + /* Find the smallest PVR Polygon size to fit the Texture, from 8x8 to 1024x1024 */ + pvr->vram_width = pvr->vram_height = 0x08; + while( pvr->vram_widthtex_width ) + pvr->vram_width<<=1; + while( pvr->vram_heighttex_height ) + pvr->vram_height<<=1; + + /* Allocate PVR VRAM for the current Texture */ + if(pvr->vram_tex) pvr_mem_free(pvr->vram_tex); + pvr->vram_tex = pvr_mem_malloc(pvr->vram_width*pvr->vram_height*2); + + return 1; +} + +/* Transfer texture data from SH4 RAM to PVR VRAM using DMA */ +void pvr_dma_load( unsigned char *src, struct pvr_frame *pvr ) +{ + dcache_flush_range(src, 16384); /* Flush the SH4 Cache */ + pvr_wait_ready(); /* Wait for PVR to be in a ready state */ + while (!pvr_dma_ready()); /* Wait for PVR DMA to finish transfer */ + + pvr_dma_transfer( src, pvr->vram_tex, pvr->vram_width*pvr->tex_height*2, + PVR_DMA_VRAM64, 1, NULL, 0 ); +} + +/* Copy a frame from RAM to VRAM, pixel by pixel. Mutex protected. */ +void pvr_pixel_load( unsigned char *src, struct pvr_frame *pvr ) +{ + int x, y; + uint16 *texture; + uint16 *image; + + /* Copy the image data from RAM to VRAM, byte by byte */ + image = (uint16 *)src; + texture = (uint16 *)pvr->vram_tex; + PVR_lock_mutex(); + for (y=0; ytex_height; y++) + { + for (x=0; xtex_width; x++) + texture[x] = image[x]; + texture += pvr->vram_width; image += pvr->tex_width; + } + PVR_unlock_mutex(); + + /* free the resources */ + sq_clr(image, sizeof(image)); + sq_clr(texture, sizeof(texture)); +} + +/* Copy a frame from RAM to VRAM, 32 bytes at a time using Store-Queues */ +void pvr_txr_load_sq( unsigned char *src, struct pvr_frame *pvr ) +{ + int i, n; + unsigned int *d, *s; + + /* Make sure our video width is compatible with SQ transfers */ + uint32 count = pvr->tex_width * 2; + if (count % 4) + count = (count & 0xfffffffc) + 4; + + d = (unsigned int *)(void *) + (0xe0000000 | (((unsigned long)pvr->vram_tex) & 0x03ffffe0)); + s = (unsigned int *)src; + + /* Set store queue memory area as desired */ + QACR0 = ((((unsigned int)pvr->vram_tex)>>26)<<2)&0x1c; + QACR1 = ((((unsigned int)pvr->vram_tex)>>26)<<2)&0x1c; + + for(i=0;itex_height;i++){ + d = (unsigned int *)(void *) + (0xe0000000 | (((unsigned long)pvr->vram_tex+(i*(pvr->vram_width*2))) & 0x03ffffe0)); + + n = count>>5; + + while(n--) { + asm("pref @%0" : : "r" (s + 8)); // prefetch 32 bytes for next loop + d[0] = *(s++); + d[1] = *(s++); + d[2] = *(s++); + d[3] = *(s++); + d[4] = *(s++); + d[5] = *(s++); + d[6] = *(s++); + d[7] = *(s++); + asm("pref @%0" : : "r" (d)); + d += 8; + } + + } + /* Wait for both store queues to complete */ + d = (unsigned int *)0xe0000000; + d[0] = d[8] = 0; +} + +/* Calculate output resolution */ +void pvr_resize_resolution( struct pvr_frame pvr, struct pvr_frame_vertex *display ) +{ + /* Initialize texture width and height */ + display->width = pvr.tex_width; + display->height = pvr.tex_height; + + /* Calculate display resolution */ + if ( pvr.tex_height < pvr.tex_width * DISPLAY_AR ) { + display->top = ( DISPLAY_HEIGHT - (( pvr.tex_height * DISPLAY_WIDTH ) / pvr.tex_width) ) / 2; + display->bottom = DISPLAY_HEIGHT - display->top; + display->left = 0; display->right = DISPLAY_WIDTH; + } + else { + display->top = 0; display->bottom = DISPLAY_HEIGHT; + display->left = ( DISPLAY_WIDTH - (( pvr.tex_width * DISPLAY_HEIGHT ) / pvr.tex_height) ) / 2; + display->right = DISPLAY_WIDTH - display->left; + } + + /* Calculate Top and Bottom u/v co-oridnates */ + display->width_ratio = pvr.tex_width / (float)pvr.vram_width; + display->height_ratio = pvr.tex_height / (float)pvr.vram_height; + +} + +/* Calculate output resolution */ +int pvr_set_resolution( struct pvr_frame pvr, int x, int y, + int dispWidth, int dispHeight, struct pvr_frame_vertex *display ) +{ + /* Fill the pvr_frame_vertex structure*/ + display->top = y; + display->bottom = y+dispHeight; + display->left = x; + display->right = x+dispWidth; + display->width = pvr.tex_width; + display->height = pvr.tex_height; + display->width_ratio = pvr.tex_width / (float)pvr.vram_width; + display->height_ratio = pvr.tex_height / (float)pvr.vram_height; + + return 1; +} + +/* Cache our PVR verticies */ +int pvr_compile_poly( struct pvr_frame_vertex display, struct pvr_frame *pvr, int mode, int fmt, float z ) +{ + /* Submit the vertecies */ + pvr->vert[0].argb = pvr->vert[1].argb = pvr->vert[2].argb = pvr->vert[3].argb = PVR_PACK_COLOR(1.0f, 1.0f, 1.0f, 1.0f); + pvr->vert[0].oargb = pvr->vert[1].oargb = pvr->vert[2].oargb = pvr->vert[3].oargb = 0; + pvr->vert[0].z = pvr->vert[1].z = pvr->vert[2].z = pvr->vert[3].z = z; + pvr->vert[0].flags = pvr->vert[1].flags = pvr->vert[2].flags = PVR_CMD_VERTEX; + pvr->vert[3].flags = PVR_CMD_VERTEX_EOL; + + pvr->vert[0].x = display.left; + pvr->vert[0].y = display.bottom; + pvr->vert[0].u = 0.0f; + pvr->vert[0].v = display.height_ratio; + + pvr->vert[1].x = display.left; + pvr->vert[1].y = display.top; + pvr->vert[1].u = 0.0f; + pvr->vert[1].v = 0.0f; + + pvr->vert[2].x = display.right; + pvr->vert[2].y = display.bottom; + pvr->vert[2].u = display.width_ratio; + pvr->vert[2].v = display.height_ratio; + + pvr->vert[3].x = display.right; + pvr->vert[3].y = display.top; + pvr->vert[3].u = display.width_ratio; + pvr->vert[3].v = 0.0f; + + /* Compile the polygon */ + pvr_poly_cxt_txr(&pvr->cxt, mode, fmt, + pvr->vram_width, pvr->vram_height, pvr->vram_tex, PVR_FILTER_BILINEAR); + pvr_poly_compile(&pvr->poly, &pvr->cxt); + + return 1; +} + +#define pvr_submit_poly( pvr ) { \ + pvr_prim(&pvr->poly, sizeof(pvr->poly)); \ + pvr_prim(&pvr->vert[0], sizeof(pvr->vert[0])); \ + pvr_prim(&pvr->vert[1], sizeof(pvr->vert[1])); \ + pvr_prim(&pvr->vert[2], sizeof(pvr->vert[2])); \ + pvr_prim(&pvr->vert[3], sizeof(pvr->vert[3])); } + +/* Render a single Opaque frame using the PVR */ +void pvr_draw_frame( struct pvr_frame *pvr_frame ) +{ + pvr_wait_ready(); + pvr_scene_begin(); + pvr_list_begin(PVR_LIST_OP_POLY); + pvr_submit_poly(pvr_frame); + pvr_list_finish(); + pvr_scene_finish(); +} + +/* Render a single Opaque frame using the PVR, DMA enabled */ +void pvr_draw_frame_dma( struct pvr_frame *pvr_frame ) +{ + pvr_scene_begin(); + pvr_list_begin(PVR_LIST_OP_POLY); + pvr_submit_poly(pvr_frame); + pvr_list_finish(); + pvr_scene_finish(); +} diff --git a/POWERVR/SRCS/dreamroq-r2.2/libdcmc/snddrv.c b/POWERVR/SRCS/dreamroq-r2.2/libdcmc/snddrv.c new file mode 100644 index 00000000..210c8e75 --- /dev/null +++ b/POWERVR/SRCS/dreamroq-r2.2/libdcmc/snddrv.c @@ -0,0 +1,143 @@ +/* +** +** (C) Josh 'PH3NOM' Pearson 2011 +** +*/ +/* +** To anyone looking at this code: +** +** This driver runs in its own thread on the sh4. +** +** When the AICA driver requests more samples, +** it will signal sndbuf_status=SNDDRV_STATUS_NEEDBUF +** and assign the number of requested samples to snddrv.pcm_needed. +** +** The decoders need to check sndbuf_status, +** when more samples are requested by the driver ** the decoders will loop +** decoding into pcm_buffer untill pcm_bytes==snddrv.pcm_needed +** at that point the decoder signals sndbuf_status=SNDDRV_STATUS_HAVEBUF +** +*/ + +#include +#include +#include + +#include +#include + +#include "snddrv.h" + +snd_stream_hnd_t shnd; +kthread_t * snddrv_thd; +static int snddrv_vol = 255; + +/* Increase the Sound Driver volume */ +int snddrv_volume_up() { + + if( snddrv_vol <= 245 ) { + snddrv_vol += 10; + snd_stream_volume(shnd, snddrv_vol); + } + return snddrv_vol; +} + +/* Decrease the Sound Driver volume */ +int snddrv_volume_down() { + + if( snddrv_vol >= 10 ) { + snddrv_vol -= 10; + snd_stream_volume(shnd, snddrv_vol); + } + return snddrv_vol; +} + +/* Exit the Sound Driver */ +int snddrv_exit() { + + if( snddrv.drv_status != SNDDRV_STATUS_NULL ) { + snddrv.drv_status = SNDDRV_STATUS_DONE; + snddrv.buf_status = SNDDRV_STATUS_BUFEND; + + while( snddrv.drv_status != SNDDRV_STATUS_NULL ) + thd_pass(); + + + printf("SNDDRV: Exited\n"); + } + + memset( snddrv.pcm_buffer, 0, 65536+16384); + snddrv.pcm_bytes = 0; + snddrv.pcm_needed = 0; + + SNDDRV_FREE_STRUCT(); + + return snddrv.drv_status; +} + +/* Signal how many samples the AICA needs, then wait for the deocder to produce them */ +static void *snddrv_callback(snd_stream_hnd_t hnd, int len, int * actual) { + + /* Signal the Decoder thread how many more samples are needed */ + snddrv.pcm_needed = len; + snddrv.buf_status = SNDDRV_STATUS_NEEDBUF; + + /* Wait for the samples to be ready */ + while( snddrv.buf_status != SNDDRV_STATUS_HAVEBUF && snddrv.buf_status != SNDDRV_STATUS_BUFEND ) + thd_pass(); + + snddrv.pcm_ptr = snddrv.pcm_buffer; + snddrv.pcm_bytes = 0; + *actual = len; + + return snddrv.pcm_ptr; + +} + +static void snddrv_thread() { + + printf("SNDDRV: Rate - %i, Channels - %i\n", snddrv.rate, snddrv.channels); + + shnd = snd_stream_alloc(snddrv_callback, SND_STREAM_BUFFER_MAX/4); + + snd_stream_start(shnd, snddrv.rate, snddrv.channels-1); + snddrv.drv_status = SNDDRV_STATUS_STREAMING; + + while( snddrv.drv_status != SNDDRV_STATUS_DONE && snddrv.drv_status != SNDDRV_STATUS_ERROR ) { + + snd_stream_poll(shnd); + thd_sleep(20); + + } + + snd_stream_destroy(shnd); + snd_stream_shutdown(); + + snddrv.drv_status = SNDDRV_STATUS_NULL; + + printf("SNDDRV: Finished\n"); + +} + +/* Start the AICA Sound Stream Thread */ +int snddrv_start( int rate, int chans ) { + + snddrv.rate = rate; + snddrv.channels = chans; + if( snddrv.channels > 2) { + printf("SNDDRV: ERROR - Exceeds maximum channels\n"); + return -1; + } + + printf("SNDDRV: Creating Driver Thread\n"); + + snddrv.drv_status = SNDDRV_STATUS_INITIALIZING; + + snd_stream_init(); + + snddrv_thd = thd_create( snddrv_thread, NULL ); + + return snddrv.drv_status; + +} + diff --git a/POWERVR/SRCS/dreamroq-r2.2/libdcmc/snddrv.h b/POWERVR/SRCS/dreamroq-r2.2/libdcmc/snddrv.h new file mode 100644 index 00000000..8c6f954b --- /dev/null +++ b/POWERVR/SRCS/dreamroq-r2.2/libdcmc/snddrv.h @@ -0,0 +1,108 @@ +/* +** +** This File is a part of Dreamcast Media Center +** (C) Josh "PH3NOM" Pearson 2011 +** +*/ + +#ifndef SNDDRV_H +#define SNDDRV_H + +/* Keep track of things from the Driver side */ +#define SNDDRV_STATUS_NULL 0x00 +#define SNDDRV_STATUS_INITIALIZING 0x01 +#define SNDDRV_STATUS_READY 0x02 +#define SNDDRV_STATUS_STREAMING 0x03 +#define SNDDRV_STATUS_DONE 0x04 +#define SNDDRV_STATUS_ERROR 0x05 + +/* Keep track of things from the Decoder side */ +#define SNDDEC_STATUS_NULL 0x00 +#define SNDDEC_STATUS_INITIALIZING 0x01 +#define SNDDEC_STATUS_READY 0x02 +#define SNDDEC_STATUS_STREAMING 0x03 +#define SNDDEC_STATUS_PAUSING 0x04 +#define SNDDEC_STATUS_PAUSED 0x05 +#define SNDDEC_STATUS_RESUMING 0x06 +#define SNDDEC_STATUS_DONE 0x07 +#define SNDDEC_STATUS_ERROR 0x08 + +/* Keep track of the buffer status from both sides*/ +#define SNDDRV_STATUS_NEEDBUF 0x00 +#define SNDDRV_STATUS_HAVEBUF 0x01 +#define SNDDRV_STATUS_BUFEND 0x02 + +/* This seems to be a good number for file seeking on compressed audio */ +#define SEEK_LEN 16384*48 + +/* SNDDRV (C) AICA Audio Driver */ +struct snddrv { + int rate; + int channels; + int pcm_bytes; + int pcm_needed; + volatile int drv_status; + volatile int dec_status; + volatile int buf_status; + unsigned int pcm_buffer[65536+16384]; + unsigned int *pcm_ptr; +}snddrv; + +#define SNDDRV_FREE_STRUCT() { \ + snddrv.rate = snddrv.channels = snddrv.drv_status = \ + snddrv.dec_status = snddrv.buf_status = 0; } + +struct snddrv_song_info { + char *artist[128]; + char * title[128]; + char * track[128]; + char * album[128]; + char * genre[128]; + char *fname; + volatile int fpos; + volatile float spos; + int fsize; + float slen; +}snd_sinfo; + +#define SNDDRV_FREE_SINFO() { \ + sq_clr( snd_sinfo.artist, 128 ); \ + sq_clr( snd_sinfo.title, 128 ); \ + sq_clr( snd_sinfo.track, 128 ); \ + sq_clr( snd_sinfo.album, 128 ); \ + sq_clr( snd_sinfo.genre, 128 ); \ + snd_sinfo.fpos = snd_sinfo.spos = snd_sinfo.fsize = snd_sinfo.slen = 0; } + +#define min(a,b) ( (a) < (b) ? (a) : (b) ) + +#define MAX_CHANNELS 6 /* make this higher to support files with + more channels for LibFAAD */ + +/* MicroSoft channel definitions */ +#define SPEAKER_FRONT_LEFT 0x1 +#define SPEAKER_FRONT_RIGHT 0x2 +#define SPEAKER_FRONT_CENTER 0x4 +#define SPEAKER_LOW_FREQUENCY 0x8 +#define SPEAKER_BACK_LEFT 0x10 +#define SPEAKER_BACK_RIGHT 0x20 +#define SPEAKER_FRONT_LEFT_OF_CENTER 0x40 +#define SPEAKER_FRONT_RIGHT_OF_CENTER 0x80 +#define SPEAKER_BACK_CENTER 0x100 +#define SPEAKER_SIDE_LEFT 0x200 +#define SPEAKER_SIDE_RIGHT 0x400 +#define SPEAKER_TOP_CENTER 0x800 +#define SPEAKER_TOP_FRONT_LEFT 0x1000 +#define SPEAKER_TOP_FRONT_CENTER 0x2000 +#define SPEAKER_TOP_FRONT_RIGHT 0x4000 +#define SPEAKER_TOP_BACK_LEFT 0x8000 +#define SPEAKER_TOP_BACK_CENTER 0x10000 +#define SPEAKER_TOP_BACK_RIGHT 0x20000 +#define SPEAKER_RESERVED 0x80000000 + +/* SNDDRV Function Protocols */ +int snddrv_start( int rate, int chans ); +int snddrv_exit(); +int snddrv_volume_up(); +int snddrv_volume_down(); + +#endif diff --git a/POWERVR/SRCS/dreamroq-r2.2/libdcmc/timer.c b/POWERVR/SRCS/dreamroq-r2.2/libdcmc/timer.c new file mode 100644 index 00000000..83352b3b --- /dev/null +++ b/POWERVR/SRCS/dreamroq-r2.2/libdcmc/timer.c @@ -0,0 +1,37 @@ +/* +** +** This file is a part of Dreamcast Media Center +** (C) Josh PH3NOM Pearson 2011 +** +*/ + +#include +#include +#include +#include + +#include "dc_timer.h" + +/* Get current hardware timing using arch/timer.h */ +int dc_get_time() +{ + uint32 s, ms; + uint64 msec; + + timer_ms_gettime(&s, &ms); + msec = (((uint64)s) * ((uint64)1000)) + ((uint64)ms); + + return (int)msec; +} + +/* Regulate the Video Frame Rate */ +void frame_delay( float AVI_video_rate, float AVI_delay, int frameCounter ) +{ + float AVI_real_time = frameCounter / AVI_video_rate; + float CPU_real_time= ( ( (float)dc_get_time()- AVI_delay ) / 1000.0f ); + //printf("AVI_real_time: %f, CPU_real_time %f\n", AVI_real_time, CPU_real_time ); + while ( CPU_real_time < AVI_real_time ) { + CPU_real_time= ( ( (float)dc_get_time()- AVI_delay ) / 1000.0f ); + thd_pass(); + } +} diff --git a/POWERVR/SRCS/dreamroq-r2.2/test-dreamroq.c b/POWERVR/SRCS/dreamroq-r2.2/test-dreamroq.c new file mode 100644 index 00000000..945bc1e2 --- /dev/null +++ b/POWERVR/SRCS/dreamroq-r2.2/test-dreamroq.c @@ -0,0 +1,62 @@ +/* + * Dreamroq by Mike Melanson + * + * This is a simple, sample program that helps test the Dreamroq library. + */ + +#include +#include "dreamroqlib.h" + +int quit_cb() +{ + /* big, fat no-op for command line tool */ + return 0; +} + +int render_cb(unsigned short *buf, int width, int height, int stride, + int texture_height) +{ + static int count = 0; + FILE *out; + char filename[20]; + int x, y, pixel; + + sprintf(filename, "%04d.pnm", count); + printf("writing frame %d to file %s\n", count, filename); + count++; + out = fopen(filename, "wb"); + if (!out) + return ROQ_CLIENT_PROBLEM; + fprintf(out, "P6\n%d %d\n255\n", width, height); + for (y = 0; y < height; y++) + { + for (x = 0; x < width; x++) + { + pixel = *buf++; + fputc(((pixel >> 11) << 3) & 0xFF, out); /* red */ + fputc(((pixel >> 5) << 2) & 0xFF, out); /* green */ + fputc(((pixel >> 0) << 3) & 0xFF, out); /* blue */ + } + buf += (stride - width); + } + fclose(out); + + return ROQ_SUCCESS; +} + +int main(int argc, char *argv[]) +{ + int status; + + if (argc < 2) + { + printf("USAGE: newroq-cli \n"); + return 1; + } + + status = dreamroq_play(argv[1], 0, render_cb, 0, quit_cb); + printf("final status = %d\n", status); + + return status; +} + diff --git a/POWERVR/SRCS/ntscenforcer/1ST_READ.BIN b/POWERVR/SRCS/ntscenforcer/1ST_READ.BIN new file mode 100644 index 00000000..9b7d75ec Binary files /dev/null and b/POWERVR/SRCS/ntscenforcer/1ST_READ.BIN differ diff --git a/POWERVR/SRCS/palenforcer/1ST_READ.BIN b/POWERVR/SRCS/palenforcer/1ST_READ.BIN new file mode 100644 index 00000000..1337f74a Binary files /dev/null and b/POWERVR/SRCS/palenforcer/1ST_READ.BIN differ diff --git a/POWERVR/SRCS/palenforcer/ChangeLog b/POWERVR/SRCS/palenforcer/ChangeLog new file mode 100644 index 00000000..cbccacc6 --- /dev/null +++ b/POWERVR/SRCS/palenforcer/ChangeLog @@ -0,0 +1 @@ +v1.0 - initial release diff --git a/POWERVR/SRCS/palenforcer/INSTALL b/POWERVR/SRCS/palenforcer/INSTALL new file mode 100644 index 00000000..0605d7d8 --- /dev/null +++ b/POWERVR/SRCS/palenforcer/INSTALL @@ -0,0 +1,151 @@ +Basic Installation +================== + + This package requires a cross-compiler suite targeted for the +Hitachi SuperH series of microprocessors. +Currently only GNU gcc is supported so make sure you have properly +installed this before attempting to build this package. Run the 'configure' +script which will attempt to guess correct values for any system- +dependent variables. If it fails to locate a cross-compiler even though +it is installed, set the environment variable $DCC to the name of the +compiler and be sure to include the directory path where it's stored +in the $PATH variable before running the script. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you can remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the configure script and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not supports the `VPATH' +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use `make distclean' before reconfiguring for another +architecture. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. diff --git a/POWERVR/SRCS/palenforcer/Makefile.in b/POWERVR/SRCS/palenforcer/Makefile.in new file mode 100644 index 00000000..74ff0658 --- /dev/null +++ b/POWERVR/SRCS/palenforcer/Makefile.in @@ -0,0 +1,41 @@ +# Makefile for PAL-enforcer + +CC = @CC@ +CFLAGS = @CFLAGS@ +LD = @LD@ +OBJCOPY = @OBJCOPY@ + +all: 1ST_READ.BIN + +1ST_READ.BIN: main.elf + ${OBJCOPY} -O binary main.elf 1ST_READ.BIN + + main.elf: crt0.o main.o image.o handler.o + ${CC} ${CFLAGS} -Wl,-T,dc.x -L. -o main.elf -nostdlib -nostartfiles crt0.o main.o image.o handler.o -lgcc + +image.o: image.raw + ${LD} -A sh -b binary --oformat elf32-shl $< -o $@ -r -EL --no-warn-mismatch -T image.x + +main.o: main.c + ${CC} ${CFLAGS} -c main.c + +handler.o: handler.bin + ${LD} -A sh -b binary --oformat elf32-shl $< -o $@ -r -EL --no-warn-mismatch -T handler.x + +handler.bin: handler.elf + ${OBJCOPY} -O binary handler.elf handler.bin + +handler.elf: handler-tmp.o + ${CC} ${CFLAGS} -nostdlib -nostartfiles -Wl,-e,_break_handler,-Ttext,0x8c004000 -o handler.elf handler-tmp.o + +handler-tmp.o: handler.c + ${CC} ${CFLAGS} -c -o handler-tmp.o handler.c + +crt0.o: crt0.S + ${CC} ${CFLAGS} -c crt0.S + +clean: + rm -f *.o *.elf *.bin *.BIN + +distclean: + rm -f *.o *.elf *.bin *.BIN config.* Makefile diff --git a/POWERVR/SRCS/palenforcer/NEWS b/POWERVR/SRCS/palenforcer/NEWS new file mode 100644 index 00000000..6c2f9bb5 --- /dev/null +++ b/POWERVR/SRCS/palenforcer/NEWS @@ -0,0 +1 @@ +No news is good news. diff --git a/POWERVR/SRCS/palenforcer/README b/POWERVR/SRCS/palenforcer/README new file mode 100644 index 00000000..d3517278 --- /dev/null +++ b/POWERVR/SRCS/palenforcer/README @@ -0,0 +1,33 @@ +General Information +=================== + +PAL-enforcer is a program intended to make NTSC titles work +on TVs that can only handle 50Hz (like my parents' old one). +It does this by intercepting any writes to the hardware-register +that controls the output frequency and ensure that it is always +set to 50Hz. Unfortunately it doesnt change the colour encoding +so picture may be in black & white; PAL-enforcer is really a bit +of a misnomer. It overrides the region-lockout allowing games from +all territories to be played. (This last part comes with a big +caveat; it is only known to work with a Japanese Ver.1.004 bootROM +by patching an instruction that might very well be in different +locations in other versions of the ROM...) + + +Installation +============ + +See the file 'INSTALL' for detailed instructions + + +Usage +===== + +After compiling, the program should be burned onto a CD that +can be booted on the DC. After booting, replace the CD with +the game to be played (will only work with a original GDROMs +though I make no guarantee about WindowsCE games since I don't +have any of those) and hopefully the game will boot in 50 Hz +mode. + + diff --git a/POWERVR/SRCS/palenforcer/acinclude.m4 b/POWERVR/SRCS/palenforcer/acinclude.m4 new file mode 100644 index 00000000..9059a428 --- /dev/null +++ b/POWERVR/SRCS/palenforcer/acinclude.m4 @@ -0,0 +1,11 @@ +dnl define macro to check valid arguments to compiler +AC_DEFUN(AC_CHECK_COMPILER_ARG, +[AC_CACHE_CHECK(whether $1 accepts $2, $3, +[echo 'void f(){}' > conftest.c +if test -z "`$1 $2 -c conftest.c 2>&1`"; then + $3=yes +else + $3=no +fi +rm -f conftest.c conftest.o +])]) diff --git a/POWERVR/SRCS/palenforcer/aclocal.m4 b/POWERVR/SRCS/palenforcer/aclocal.m4 new file mode 100644 index 00000000..918b4ccf --- /dev/null +++ b/POWERVR/SRCS/palenforcer/aclocal.m4 @@ -0,0 +1,24 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl define macro to check valid arguments to compiler +AC_DEFUN(AC_CHECK_COMPILER_ARG, +[AC_CACHE_CHECK(whether $1 accepts $2, $3, +[echo 'void f(){}' > conftest.c +if test -z "`$1 $2 -c conftest.c 2>&1`"; then + $3=yes +else + $3=no +fi +rm -f conftest.c conftest.o +])]) + diff --git a/POWERVR/SRCS/palenforcer/configure b/POWERVR/SRCS/palenforcer/configure new file mode 100644 index 00000000..b3ca0d8b --- /dev/null +++ b/POWERVR/SRCS/palenforcer/configure @@ -0,0 +1,1559 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=main.c + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + +# AM_INIT_AUTOMAKE(palenforcer, 1.0.0) +# AM_CONFIG_HEADER(config.h) + +TRYPATH="$PATH:/usr/local/dc/bin:/usr/local/dcdev/bin:/usr/local/sh/bin:/usr/local/sh-elf/bin:/usr/local/sh-hitachi-elf/bin:/usr/local/dc/sh-elf/bin:/usr/local/dc/sh-hitachi-elf/bin" + +# search for an SH4 cross compiler + +if test -z "$DCC"; then + # Extract the first word of "dc-gcc", so it can be a program name with args. +set dummy dc-gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:536: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_DCC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$DCC" in + /*) + ac_cv_path_DCC="$DCC" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_DCC="$DCC" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$TRYPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_DCC="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +DCC="$ac_cv_path_DCC" +if test -n "$DCC"; then + echo "$ac_t""$DCC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$DCC"; then + # Extract the first word of "dc-elf-gcc", so it can be a program name with args. +set dummy dc-elf-gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:573: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_DCC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$DCC" in + /*) + ac_cv_path_DCC="$DCC" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_DCC="$DCC" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$TRYPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_DCC="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +DCC="$ac_cv_path_DCC" +if test -n "$DCC"; then + echo "$ac_t""$DCC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$DCC"; then + # Extract the first word of "sh-gcc", so it can be a program name with args. +set dummy sh-gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:610: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_DCC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$DCC" in + /*) + ac_cv_path_DCC="$DCC" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_DCC="$DCC" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$TRYPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_DCC="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +DCC="$ac_cv_path_DCC" +if test -n "$DCC"; then + echo "$ac_t""$DCC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$DCC"; then + # Extract the first word of "sh-elf-gcc", so it can be a program name with args. +set dummy sh-elf-gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:647: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_DCC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$DCC" in + /*) + ac_cv_path_DCC="$DCC" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_DCC="$DCC" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$TRYPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_DCC="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +DCC="$ac_cv_path_DCC" +if test -n "$DCC"; then + echo "$ac_t""$DCC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$DCC"; then + # Extract the first word of "sh-hitachi-elf-gcc", so it can be a program name with args. +set dummy sh-hitachi-elf-gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:684: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_DCC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$DCC" in + /*) + ac_cv_path_DCC="$DCC" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_DCC="$DCC" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$TRYPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_DCC="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +DCC="$ac_cv_path_DCC" +if test -n "$DCC"; then + echo "$ac_t""$DCC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$DCC"; then + { echo "configure: error: *** SH-4 cross-compiler not found." 1>&2; exit 1; } +fi + +# check which arguments to include + +echo $ac_n "checking whether $DCC accepts -ml""... $ac_c" 1>&6 +echo "configure:724: checking whether $DCC accepts -ml" >&5 +if eval "test \"`echo '$''{'iv_ccc_ml'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`$DCC -ml -c conftest.c 2>&1`"; then + iv_ccc_ml=yes +else + iv_ccc_ml=no +fi +rm -f conftest.c conftest.o + +fi + +echo "$ac_t""$iv_ccc_ml" 1>&6 +# -mhitachi is sometimes less effecient than GNU +# AC_CHECK_COMPILER_ARG($DCC, -mhitachi, iv_ccc_mhitachi) +echo $ac_n "checking whether $DCC accepts -m4-single-only""... $ac_c" 1>&6 +echo "configure:742: checking whether $DCC accepts -m4-single-only" >&5 +if eval "test \"`echo '$''{'iv_ccc_m4_single_only'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`$DCC -m4-single-only -c conftest.c 2>&1`"; then + iv_ccc_m4_single_only=yes +else + iv_ccc_m4_single_only=no +fi +rm -f conftest.c conftest.o + +fi + +echo "$ac_t""$iv_ccc_m4_single_only" 1>&6 +# -fno-delayed-branch may fix a bug, but generates slower code +# AC_CHECK_COMPILER_ARG($DCC, -fno-delayed-branch, iv_ccc_fno_delayed_branch) +# causes gcc to crash for some reason +# AC_CHECK_COMPILER_ARG($DCC, -mrelax, iv_ccc_mrelax) +# AC_CHECK_COMPILER_ARG($DCC, -O2, iv_ccc_optimize) +echo $ac_n "checking whether $DCC accepts -O2""... $ac_c" 1>&6 +echo "configure:763: checking whether $DCC accepts -O2" >&5 +if eval "test \"`echo '$''{'iv_ccc_optimize'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`$DCC -O2 -c conftest.c 2>&1`"; then + iv_ccc_optimize=yes +else + iv_ccc_optimize=no +fi +rm -f conftest.c conftest.o + +fi + +echo "$ac_t""$iv_ccc_optimize" 1>&6 +echo $ac_n "checking whether $DCC accepts -fomit-frame-pointer""... $ac_c" 1>&6 +echo "configure:779: checking whether $DCC accepts -fomit-frame-pointer" >&5 +if eval "test \"`echo '$''{'iv_ccc_fomit_frame_pointer'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`$DCC -fomit-frame-pointer -c conftest.c 2>&1`"; then + iv_ccc_fomit_frame_pointer=yes +else + iv_ccc_fomit_frame_pointer=no +fi +rm -f conftest.c conftest.o + +fi + +echo "$ac_t""$iv_ccc_fomit_frame_pointer" 1>&6 +echo $ac_n "checking whether $DCC accepts -ffast-math""... $ac_c" 1>&6 +echo "configure:795: checking whether $DCC accepts -ffast-math" >&5 +if eval "test \"`echo '$''{'iv_ccc_ffast_math'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`$DCC -ffast-math -c conftest.c 2>&1`"; then + iv_ccc_ffast_math=yes +else + iv_ccc_ffast_math=no +fi +rm -f conftest.c conftest.o + +fi + +echo "$ac_t""$iv_ccc_ffast_math" 1>&6 +echo $ac_n "checking whether $DCC accepts -fno-builtin""... $ac_c" 1>&6 +echo "configure:811: checking whether $DCC accepts -fno-builtin" >&5 +if eval "test \"`echo '$''{'iv_ccc_fno_builtin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`$DCC -fno-builtin -c conftest.c 2>&1`"; then + iv_ccc_fno_builtin=yes +else + iv_ccc_fno_builtin=no +fi +rm -f conftest.c conftest.o + +fi + +echo "$ac_t""$iv_ccc_fno_builtin" 1>&6 +echo $ac_n "checking whether $DCC accepts -Wall""... $ac_c" 1>&6 +echo "configure:827: checking whether $DCC accepts -Wall" >&5 +if eval "test \"`echo '$''{'iv_ccc_wall'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`$DCC -Wall -c conftest.c 2>&1`"; then + iv_ccc_wall=yes +else + iv_ccc_wall=no +fi +rm -f conftest.c conftest.o + +fi + +echo "$ac_t""$iv_ccc_wall" 1>&6 + +CC=$DCC + +# construct compiler flags +if test "x$iv_ccc_ml" = "xyes"; then + CFLAGS="$CFLAGS -ml" +fi +if test "x$iv_ccc_mhitachi" = "xyes"; then + CFLAGS="$CFLAGS -mhitachi" +fi +if test "x$iv_ccc_m4_single_only" = "xyes"; then + CFLAGS="$CFLAGS -m4-single-only" +fi +if test "x$iv_ccc_fno_delayed_branch" = "xyes"; then + CFLAGS="$CFLAGS -fno-delayed-branch" +fi +if test "x$iv_ccc_mrelax" = "xyes"; then + CFLAGS="$CFLAGS -mrelax" +fi +if test "x$iv_ccc_optimize" = "xyes"; then + CFLAGS="$CFLAGS -O2" +fi +if test "x$iv_ccc_fomit_frame_pointer" = "xyes"; then + CFLAGS="$CFLAGS -fomit-frame-pointer" +fi +if test "x$iv_ccc_ffast_math" = "xyes"; then + CFLAGS="$CFLAGS -ffast-math" +fi +if test "x$iv_ccc_fno_builtin" = "xyes"; then + CFLAGS="$CFLAGS -fno-builtin" +fi +if test "x$iv_ccc_wall" = "xyes"; then + CFLAGS="$CFLAGS -Wall" +fi + + +# Check for linker + +if test -z "$DLD"; then + # Extract the first word of "dc-ld", so it can be a program name with args. +set dummy dc-ld; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:884: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_DLD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$DLD" in + /*) + ac_cv_path_DLD="$DLD" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_DLD="$DLD" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$TRYPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_DLD="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +DLD="$ac_cv_path_DLD" +if test -n "$DLD"; then + echo "$ac_t""$DLD" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$DLD"; then + # Extract the first word of "dc-elf-ld", so it can be a program name with args. +set dummy dc-elf-ld; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:921: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_DLD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$DLD" in + /*) + ac_cv_path_DLD="$DLD" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_DLD="$DLD" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$TRYPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_DLD="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +DLD="$ac_cv_path_DLD" +if test -n "$DLD"; then + echo "$ac_t""$DLD" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$DLD"; then + # Extract the first word of "sh-ld", so it can be a program name with args. +set dummy sh-ld; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_DLD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$DLD" in + /*) + ac_cv_path_DLD="$DLD" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_DLD="$DLD" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$TRYPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_DLD="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +DLD="$ac_cv_path_DLD" +if test -n "$DLD"; then + echo "$ac_t""$DLD" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$DLD"; then + # Extract the first word of "sh-elf-ld", so it can be a program name with args. +set dummy sh-elf-ld; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:995: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_DLD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$DLD" in + /*) + ac_cv_path_DLD="$DLD" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_DLD="$DLD" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$TRYPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_DLD="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +DLD="$ac_cv_path_DLD" +if test -n "$DLD"; then + echo "$ac_t""$DLD" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$DLD"; then + # Extract the first word of "sh-hitachi-elf-ld", so it can be a program name with args. +set dummy sh-hitachi-elf-ld; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1032: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_DLD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$DLD" in + /*) + ac_cv_path_DLD="$DLD" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_DLD="$DLD" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$TRYPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_DLD="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +DLD="$ac_cv_path_DLD" +if test -n "$DLD"; then + echo "$ac_t""$DLD" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$DLD"; then + { echo "configure: error: *** SH-4 cross-linker not found." 1>&2; exit 1; } +fi + +LD=$DLD + +# Check for objcopy + +if test -z "$DOBJCOPY"; then + # Extract the first word of "dc-objcopy", so it can be a program name with args. +set dummy dc-objcopy; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1077: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_DOBJCOPY'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$DOBJCOPY" in + /*) + ac_cv_path_DOBJCOPY="$DOBJCOPY" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_DOBJCOPY="$DOBJCOPY" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$TRYPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_DOBJCOPY="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +DOBJCOPY="$ac_cv_path_DOBJCOPY" +if test -n "$DOBJCOPY"; then + echo "$ac_t""$DOBJCOPY" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$DOBJCOPY"; then + # Extract the first word of "dc-elf-objcopy", so it can be a program name with args. +set dummy dc-elf-objcopy; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1114: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_DOBJCOPY'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$DOBJCOPY" in + /*) + ac_cv_path_DOBJCOPY="$DOBJCOPY" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_DOBJCOPY="$DOBJCOPY" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$TRYPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_DOBJCOPY="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +DOBJCOPY="$ac_cv_path_DOBJCOPY" +if test -n "$DOBJCOPY"; then + echo "$ac_t""$DOBJCOPY" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$DOBJCOPY"; then + # Extract the first word of "sh-objcopy", so it can be a program name with args. +set dummy sh-objcopy; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1151: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_DOBJCOPY'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$DOBJCOPY" in + /*) + ac_cv_path_DOBJCOPY="$DOBJCOPY" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_DOBJCOPY="$DOBJCOPY" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$TRYPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_DOBJCOPY="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +DOBJCOPY="$ac_cv_path_DOBJCOPY" +if test -n "$DOBJCOPY"; then + echo "$ac_t""$DOBJCOPY" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$DOBJCOPY"; then + # Extract the first word of "sh-elf-objcopy", so it can be a program name with args. +set dummy sh-elf-objcopy; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1188: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_DOBJCOPY'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$DOBJCOPY" in + /*) + ac_cv_path_DOBJCOPY="$DOBJCOPY" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_DOBJCOPY="$DOBJCOPY" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$TRYPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_DOBJCOPY="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +DOBJCOPY="$ac_cv_path_DOBJCOPY" +if test -n "$DOBJCOPY"; then + echo "$ac_t""$DOBJCOPY" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$DOBJCOPY"; then + # Extract the first word of "sh-hitachi-elf-objcopy", so it can be a program name with args. +set dummy sh-hitachi-elf-objcopy; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1225: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_DOBJCOPY'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$DOBJCOPY" in + /*) + ac_cv_path_DOBJCOPY="$DOBJCOPY" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_DOBJCOPY="$DOBJCOPY" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$TRYPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_DOBJCOPY="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +DOBJCOPY="$ac_cv_path_DOBJCOPY" +if test -n "$DOBJCOPY"; then + echo "$ac_t""$DOBJCOPY" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$DOBJCOPY"; then + { echo "configure: error: *** SH-4 cross-objcopy not found." 1>&2; exit 1; } +fi + +OBJCOPY=$DOBJCOPY + +# check for some other programs + +# AC_PROG_INSTALL +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:1268: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + + +# make the substitutions in the Makefiles + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@DCC@%$DCC%g +s%@DLD@%$DLD%g +s%@DOBJCOPY@%$DOBJCOPY%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@LD@%$LD%g +s%@OBJCOPY@%$OBJCOPY%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/POWERVR/SRCS/palenforcer/configure.in b/POWERVR/SRCS/palenforcer/configure.in new file mode 100644 index 00000000..6126c013 --- /dev/null +++ b/POWERVR/SRCS/palenforcer/configure.in @@ -0,0 +1,142 @@ +# Process this file with autoconf to produce a configure script + +# initialize + +AC_INIT(main.c) +# AM_INIT_AUTOMAKE(palenforcer, 1.0.0) +# AM_CONFIG_HEADER(config.h) + +TRYPATH="$PATH:/usr/local/dc/bin:/usr/local/dcdev/bin:/usr/local/sh/bin:/usr/local/sh-elf/bin:/usr/local/sh-hitachi-elf/bin:/usr/local/dc/sh-elf/bin:/usr/local/dc/sh-hitachi-elf/bin" + +# search for an SH4 cross compiler + +if test -z "$DCC"; then + AC_PATH_PROG(DCC, dc-gcc,,$TRYPATH) +fi +if test -z "$DCC"; then + AC_PATH_PROG(DCC, dc-elf-gcc,,$TRYPATH) +fi +if test -z "$DCC"; then + AC_PATH_PROG(DCC, sh-gcc,,$TRYPATH) +fi +if test -z "$DCC"; then + AC_PATH_PROG(DCC, sh-elf-gcc,,$TRYPATH) +fi +if test -z "$DCC"; then + AC_PATH_PROG(DCC, sh-hitachi-elf-gcc,,$TRYPATH) +fi +if test -z "$DCC"; then + AC_ERROR([*** SH-4 cross-compiler not found.]) +fi + +CC=$DCC + +# check which arguments to include + +AC_CHECK_COMPILER_ARG($DCC, -ml, iv_ccc_ml) +# -mhitachi is sometimes less effecient than GNU +# AC_CHECK_COMPILER_ARG($DCC, -mhitachi, iv_ccc_mhitachi) +AC_CHECK_COMPILER_ARG($DCC, -m4-single-only, iv_ccc_m4_single_only) +# -fno-delayed-branch may fix a bug, but generates slower code +# AC_CHECK_COMPILER_ARG($DCC, -fno-delayed-branch, iv_ccc_fno_delayed_branch) +# causes gcc to crash for some reason +# AC_CHECK_COMPILER_ARG($DCC, -mrelax, iv_ccc_mrelax) +AC_CHECK_COMPILER_ARG($DCC, -O2, iv_ccc_optimize) +AC_CHECK_COMPILER_ARG($DCC, -fomit-frame-pointer, iv_ccc_fomit_frame_pointer) +AC_CHECK_COMPILER_ARG($DCC, -ffast-math, iv_ccc_ffast_math) +AC_CHECK_COMPILER_ARG($DCC, -fno-builtin, iv_ccc_fno_builtin) +AC_CHECK_COMPILER_ARG($DCC, -Wall, iv_ccc_wall) + +# construct compiler flags +if test "x$iv_ccc_ml" = "xyes"; then + CFLAGS="$CFLAGS -ml" +fi +if test "x$iv_ccc_mhitachi" = "xyes"; then + CFLAGS="$CFLAGS -mhitachi" +fi +if test "x$iv_ccc_m4_single_only" = "xyes"; then + CFLAGS="$CFLAGS -m4-single-only" +fi +if test "x$iv_ccc_fno_delayed_branch" = "xyes"; then + CFLAGS="$CFLAGS -fno-delayed-branch" +fi +if test "x$iv_ccc_mrelax" = "xyes"; then + CFLAGS="$CFLAGS -mrelax" +fi +if test "x$iv_ccc_optimize" = "xyes"; then + CFLAGS="$CFLAGS -O2" +fi +if test "x$iv_ccc_fomit_frame_pointer" = "xyes"; then + CFLAGS="$CFLAGS -fomit-frame-pointer" +fi +if test "x$iv_ccc_ffast_math" = "xyes"; then + CFLAGS="$CFLAGS -ffast-math" +fi +if test "x$iv_ccc_fno_builtin" = "xyes"; then + CFLAGS="$CFLAGS -fno-builtin" +fi +if test "x$iv_ccc_wall" = "xyes"; then + CFLAGS="$CFLAGS -Wall" +fi + + +# Check for linker + +if test -z "$DLD"; then + AC_PATH_PROG(DLD, dc-ld,,$TRYPATH) +fi +if test -z "$DLD"; then + AC_PATH_PROG(DLD, dc-elf-ld,,$TRYPATH) +fi +if test -z "$DLD"; then + AC_PATH_PROG(DLD, sh-ld,,$TRYPATH) +fi +if test -z "$DLD"; then + AC_PATH_PROG(DLD, sh-elf-ld,,$TRYPATH) +fi +if test -z "$DLD"; then + AC_PATH_PROG(DLD, sh-hitachi-elf-ld,,$TRYPATH) +fi +if test -z "$DLD"; then + AC_ERROR([*** SH-4 cross-linker not found.]) +fi + +LD=$DLD + +# Check for objcopy + +if test -z "$DOBJCOPY"; then + AC_PATH_PROG(DOBJCOPY, dc-objcopy,,$TRYPATH) +fi +if test -z "$DOBJCOPY"; then + AC_PATH_PROG(DOBJCOPY, dc-elf-objcopy,,$TRYPATH) +fi +if test -z "$DOBJCOPY"; then + AC_PATH_PROG(DOBJCOPY, sh-objcopy,,$TRYPATH) +fi +if test -z "$DOBJCOPY"; then + AC_PATH_PROG(DOBJCOPY, sh-elf-objcopy,,$TRYPATH) +fi +if test -z "$DOBJCOPY"; then + AC_PATH_PROG(DOBJCOPY, sh-hitachi-elf-objcopy,,$TRYPATH) +fi +if test -z "$DOBJCOPY"; then + AC_ERROR([*** SH-4 cross-objcopy not found.]) +fi + +OBJCOPY=$DOBJCOPY + +# check for some other programs + +# AC_PROG_INSTALL +AC_PROG_MAKE_SET + + +# make the substitutions in the Makefiles + +AC_SUBST(CC) +AC_SUBST(CFLAGS) +AC_SUBST(LD) +AC_SUBST(OBJCOPY) + +AC_OUTPUT(Makefile) diff --git a/POWERVR/SRCS/palenforcer/crt0.S b/POWERVR/SRCS/palenforcer/crt0.S new file mode 100644 index 00000000..d917af66 --- /dev/null +++ b/POWERVR/SRCS/palenforcer/crt0.S @@ -0,0 +1,121 @@ +! This is from dcload by Andrew Kieschnick + + .section .text + .global start + .global ___exit + .global _atexit +start: + mov.l setup_cache_k,r0 + mov.l p2_mask,r1 + or r1,r0 + jmp @r0 + nop +setup_cache: + mov.l ccr_addr,r0 + mov.w ccr_data,r1 + mov.l r1,@r0 + mov.l start_2_k,r0 + nop + nop + nop + nop + nop + nop + nop + jmp @r0 + nop +start_2: + mov.l old_stack_k,r14 + mov.l r15,@r14 + mov.l old_pr_k,r14 + sts pr,r15 + mov.l r15,@r14 + mov.l stack_k,r15 + + ! zero out bss + mov.l edata_k,r0 + mov.l end_k,r1 + mov #0,r2 +start_l: + mov.l r2,@r0 + add #4,r0 + cmp/ge r0,r1 + bt start_l + +#if defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY) + mov.l set_fpscr_k, r1 + jsr @r1 + mov #0,r4 + lds r3,fpscr +#endif /* defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__) */ + + ! call the mainline + mov.l main_k,r0 + jsr @r0 + or r0,r0 + + ! call exit + mov r0,r4 + mov.l exit_k,r0 + jsr @r0 + or r0,r0 + +___exit: + mov.l old_pr_k,r14 + mov.l @r14,r15 + lds r15,pr + mov.l old_stack_k,r14 + mov.l @r14,r15 + rts + nop + +_atexit: + rts + nop + + .align 4 +#if defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__) +set_fpscr_k: + .long ___set_fpscr +#endif /* defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(SH4_SINGLE_ONLY) */ +stack_k: + .long _stack +edata_k: + .long _edata +end_k: + .long _end +main_k: + .long _main +exit_k: + .long _exit + +old_stack_k: + .long _old_stack +old_pr_k: + .long _old_pr + +_old_stack: + .long 0 +_old_pr: + .long 0 + +setup_cache_k: + .long setup_cache +start_2_k: + .long start_2 +p2_mask: + .long 0xa0000000 +ccr_addr: + .long 0xff00001c +ccr_data: + .word 0x090b + + .align 4 + +#ifdef __ELF__ + .section .stack,"aw" +#else + .section .stack +#endif +! _stack: .long 0xdeaddead + diff --git a/POWERVR/SRCS/palenforcer/dc.x b/POWERVR/SRCS/palenforcer/dc.x new file mode 100644 index 00000000..5f915102 --- /dev/null +++ b/POWERVR/SRCS/palenforcer/dc.x @@ -0,0 +1,228 @@ +/* Sega Dreamcast linker script */ + +OUTPUT_FORMAT("elf32-shl", "elf32-shl", + "elf32-shl") +OUTPUT_ARCH(sh) +ENTRY(start) + SEARCH_DIR(/usr/local/dc/lib); +/* Do we need any of these for elf? + __DYNAMIC = 0; */ + +MEMORY +{ + ram (rwx) : ORIGIN = 0x8c010000, LENGTH = 0xfe0000 +} + +SECTIONS +{ + /* Read-only sections, merged into text segment: */ +/* . = 0x1000;*/ + .interp : { *(.interp) } + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + .rel.init : { *(.rel.init) } + .rela.init : { *(.rela.init) } + .rel.text : + { + *(.rel.text) + *(.rel.text.*) + *(.rel.gnu.linkonce.t*) + } + .rela.text : + { + *(.rela.text) + *(.rela.text.*) + *(.rela.gnu.linkonce.t*) + } + .rel.fini : { *(.rel.fini) } + .rela.fini : { *(.rela.fini) } + .rel.rodata : + { + *(.rel.rodata) + *(.rel.rodata.*) + *(.rel.gnu.linkonce.r*) + } + .rela.rodata : + { + *(.rela.rodata) + *(.rela.rodata.*) + *(.rela.gnu.linkonce.r*) + } + .rel.data : + { + *(.rel.data) + *(.rel.data.*) + *(.rel.gnu.linkonce.d*) + } + .rela.data : + { + *(.rela.data) + *(.rela.data.*) + *(.rela.gnu.linkonce.d*) + } + .rel.ctors : { *(.rel.ctors) } + .rela.ctors : { *(.rela.ctors) } + .rel.dtors : { *(.rel.dtors) } + .rela.dtors : { *(.rela.dtors) } + .rel.got : { *(.rel.got) } + .rela.got : { *(.rela.got) } + .rel.sdata : + { + *(.rel.sdata) + *(.rel.sdata.*) + *(.rel.gnu.linkonce.s*) + } + .rela.sdata : + { + *(.rela.sdata) + *(.rela.sdata.*) + *(.rela.gnu.linkonce.s*) + } + .rel.sbss : { *(.rel.sbss) } + .rela.sbss : { *(.rela.sbss) } + .rel.bss : { *(.rel.bss) } + .rela.bss : { *(.rela.bss) } + .rel.plt : { *(.rel.plt) } + .rela.plt : { *(.rela.plt) } + .init : + { + KEEP (*(.init)) + } =0 + .plt : { *(.plt) } + .text : + { + *(.text) + *(.text.*) + *(.stub) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + } =0 + _etext = .; + PROVIDE (etext = .); + .fini : + { + KEEP (*(.fini)) + } =0 + .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) } + .rodata1 : { *(.rodata1) } + /* Adjust the address for the data segment. We want to adjust up to + the same address within the page on the next page up. */ + . = ALIGN(128) + (. & (128 - 1)); + .data : + { + *(.data) + *(.data.*) + *(.gnu.linkonce.d*) + SORT(CONSTRUCTORS) + } + .data1 : { *(.data1) } + .eh_frame : { *(.eh_frame) } + .gcc_except_table : { *(.gcc_except_table) } + .ctors ALIGN(4): + { + ___ctors = .; + /* gcc uses crtbegin.o to find the start of + the constructors, so we make sure it is + first. Because this is a wildcard, it + doesn't matter if the user does not + actually link against crtbegin.o; the + linker won't look for a file to match a + wildcard. The wildcard also means that it + doesn't matter which directory crtbegin.o + is in. */ + KEEP (*crtbegin.o(.ctors)) + /* We don't want to include the .ctor section from + from the crtend.o file until after the sorted ctors. + The .ctor section from the crtend file contains the + end of ctors marker and it must be last */ + KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + ___ctors_end = .; + } + .dtors : + { + ___dtors = .; + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + ___dtors_end = .; + } + .got : { *(.got.plt) *(.got) } + .dynamic : { *(.dynamic) } + /* We want the small data sections together, so single-instruction offsets + can access them all, and initialized data all before uninitialized, so + we can shorten the on-disk segment size. */ + .sdata : + { + *(.sdata) + *(.sdata.*) + *(.gnu.linkonce.s.*) + } + _edata = .; + PROVIDE (edata = .); + __bss_start = .; + .sbss : + { + *(.dynsbss) + *(.sbss) + *(.sbss.*) + *(.scommon) + } + .bss : + { + *(.dynbss) + *(.bss) + *(.bss.*) + *(COMMON) + /* Align here to ensure that the .bss section occupies space up to + _end. Align after .bss to ensure correct alignment even if the + .bss section disappears because there are no input sections. */ + . = ALIGN(32 / 8); + } + . = ALIGN(32 / 8); + _end = .; + PROVIDE (end = .); + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } +/* .stack 0x8c00f400 : { _stack = .; *(.stack) }*/ + /* These must appear regardless of . */ +_stack = 0x8d000000; +} diff --git a/POWERVR/SRCS/palenforcer/handler.c b/POWERVR/SRCS/palenforcer/handler.c new file mode 100644 index 00000000..9a6cf61b --- /dev/null +++ b/POWERVR/SRCS/palenforcer/handler.c @@ -0,0 +1,47 @@ +/* handler.c - prevent the changing of the vertical frequency */ + +#include "types.h" + +void break_handler(void); + +void +break_handler() +{ + + register uint32 val = *(uint32 *)0xa05f80d8; + register uint32 val2 = (val>>16) & 0x03ff; + + /* acknowledge break */ + *(uint32 *)0xff200020 |= (1<<14) | (1<<15); + + if ((val2 > 500) && (val2 < 550)) { + /* NTSC, interlace */ + val = (624<<16) | 863; /* set PAL, interlace */ + } + else if ((val2 > 210) && (val2 < 300)) { + /* NTSC, non-interlace */ + val = (312<<16) | 863; /* set PAL, non-interlace */ + } else { + goto alldone; + } + + *(uint32 *)0xff200008 = 0; + __asm__("nop"); + __asm__("nop"); + __asm__("nop"); + __asm__("nop"); + __asm__("nop"); + __asm__("nop"); + __asm__("nop"); + __asm__("nop"); + __asm__("nop"); + __asm__("nop"); + __asm__("nop"); + *(uint32 *)0xa05f80d8 = val; + *(uint32 *)0xff200008 = (2<<4) | (2<<2); + +alldone: + __asm__("rte"); + __asm__("nop"); + +} diff --git a/POWERVR/SRCS/palenforcer/handler.x b/POWERVR/SRCS/palenforcer/handler.x new file mode 100644 index 00000000..bb2f462d --- /dev/null +++ b/POWERVR/SRCS/palenforcer/handler.x @@ -0,0 +1,3 @@ +SECTIONS { + .handlerdata : { _break_handler = . ; *(.data) } +} diff --git a/POWERVR/SRCS/palenforcer/image.raw b/POWERVR/SRCS/palenforcer/image.raw new file mode 100644 index 00000000..86920276 Binary files /dev/null and b/POWERVR/SRCS/palenforcer/image.raw differ diff --git a/POWERVR/SRCS/palenforcer/image.x b/POWERVR/SRCS/palenforcer/image.x new file mode 100644 index 00000000..bd439a63 --- /dev/null +++ b/POWERVR/SRCS/palenforcer/image.x @@ -0,0 +1,3 @@ +SECTIONS { + .imagedata : { _image = . ; *(.data) } +} diff --git a/POWERVR/SRCS/palenforcer/main.c b/POWERVR/SRCS/palenforcer/main.c new file mode 100644 index 00000000..5d7b1a62 --- /dev/null +++ b/POWERVR/SRCS/palenforcer/main.c @@ -0,0 +1,271 @@ +/* main.c - main routines */ + +#include "types.h" + +#define BARA *(volatile uint32 *)0xff200000 +#define BAMRA *(volatile uint8 *)0xff200004 +#define BBRA *(volatile uint16 *)0xff200008 +#define BASRA *(volatile uint8 *)0xff000014 +#define BARB *(volatile uint32 *)0xff20000c +#define BAMRB *(volatile uint8 *)0xff200010 +#define BBRB *(volatile uint16 *)0xff200014 +#define BASRB *(volatile uint8 *)0xff000018 +#define BDRB *(volatile uint32 *)0xff200018 +#define BDRMB *(volatile uint32 *)0xff20001c +#define BRCR *(volatile uint16 *)0xff200020 + +#define HANDLER_ADDR 0x8c004000 +#define HANDLER_SIZE 124 + +#define IMAGE_SIZE (640*3)*512 +#define IMAGE2_SIZE (640*4)*512 + +/* prototypes */ +sint32 enable_gdrom(void); +sint32 exec_cmd(uint32, void *); +void install_handler(void *, uint32); +void init_dbr(void); +void patch_c000(void); +void patch_regioncode(void); +void show_image(void); +void hide_image(void); +void reboot(void); +void wait_gdrom(void); +sint32 get_status(void); + +extern void break_handler(void); +extern void __exit(sint32); + +static const char id[] = + "PAL-enforcer $Id: main.c,v 1.0 2001/06/30 02:51:32 ejstans Exp $"; + +extern void *image; + +void +exit(status) + sint32 status; +{ + __exit(status); +} + +sint32 +main() +{ + enable_gdrom(); + install_handler((void *)break_handler, HANDLER_SIZE); + init_dbr(); + patch_c000(); + patch_regioncode(); + show_image(); + wait_gdrom(); + hide_image(); + reboot(); + return (0); +} + +sint32 +enable_gdrom() +{ + + uint32 i; + volatile uint32 *p = (volatile uint32 *)0xa0000000; + void (*p2)(uint32, uint32, uint32, uint32) = (void *)*(uint32 *)0x8c0000bc; + + *((volatile uint32 *)0xa05f74e4) = 0x001fffff; + + /* do the checksum on bootrom */ + for (i = 0; i < 0x00200000/4; i++) { + (void)*(p++); + } + + /* gdrom online again...reinit */ + (*p2)(0, 0, 0, 3); + + /* slight delay */ + for (i = 0; i < 1000000; i++); + + /* try to run INIT command */ + for (i = 0; i < 10; i++) { + if (exec_cmd(24, NULL) == 0) { + return (0); + } + } + + return (-1); + +} + +sint32 +exec_cmd(cmd, param) + uint32 cmd; + void *param; +{ + + sint32 (*p)(uint32, void *, uint32, uint32) = (void *)*(uint32 *)0x8c0000bc; + sint32 status[4]; + sint32 gdhn; + sint32 i = 0; + + gdhn = (*p)(cmd, param, 0, 0); + + do { + (*p)(0, NULL, 0, 2); + } while ((i = (*p)(gdhn, status, 0, 1)) == 1); + + if (i != 2) { + return (-1); + } + + return (0); + +} + +void +install_handler(handler, size) + void *handler; + uint32 size; +{ + uint32 i; + uint8 *d = (uint8 *)HANDLER_ADDR; + uint8 *s = (uint8 *)handler; + + for (i = 0; i < size; i++) { + *(d++) = *(s++); + } + + /* should flush cache here to be 100% correct but not really needed */ + +} + +void +init_dbr() +{ + + /* set DBR here */ + __asm__("ldc %0,dbr" :: "r" (HANDLER_ADDR) ); + + /* set BARA to the address we want to break on */ + BARA = 0xa05f80d8; /* sync_load register */ + + /* set BAMRA to include all bits in BARA and ignore ASID */ + BAMRA = 0x00; + + /* set BBRA to break on write, no size comparison */ + BBRA = (2<<4) | (2<<2); + + /* set BRCR to use the User Debug Function */ + BRCR = 1; + +} + +void +patch_c000() +{ + + uint16 *d = (uint16 *)0x8c00c000; + + *(d++) = 0x000b; + *(d++) = 0x0009; + + /* should flush cache here */ + +} + +void +patch_regioncode() +{ + + uint16 *d = (uint16 *)0x8c000506; + + /* skipping region checking code... + I only have a japanese bootROM v1.004 handy so this is + only known to work on this particular version... */ + *(d++) = 0x890a; + +} + +void +show_image() +{ + + uint32 *d = (uint32 *)0xa5000000; + uint32 *s = (uint32 *)ℑ + uint32 i; + + /* disable display */ + *(volatile uint32 *)0xa05f8044 &= ~((3<<2) | 1); + + /* upload image to framebuffer */ + for (i = 0; i < IMAGE_SIZE/4; i++) { + *(d++) = *(s++); + } + + /* set videoregs */ + *(uint32 *)0xa05f8040 = 0x000000000; + *(uint32 *)0xa05f8048 = (4<<0); + *(uint32 *)0xa05f8050 = 0x00000000; + *(uint32 *)0xa05f8054 = 0x00000000 + (640*3); + *(uint32 *)0xa05f805c = ((((640*3)/4)+1)<<20) | (((512/2)-1)<<10) + | (((640*3)/4) - 1); + *(uint32 *)0xa05f80d0 = (*(volatile uint32 *)0xa05f80d0 & ~(3<<6)) + | (1<<6); + *(uint32 *)0xa05f80d4 = (116<<16) | 843; + *(uint32 *)0xa05f80d8 = (624<<16) | (863); + *(uint32 *)0xa05f80dc = (44<<16) | 620; + *(uint32 *)0xa05f80e0 = (0x1f<<22) | (362<<12) | (5<<8) | (0x3f); + *(uint32 *)0xa05f80ec = 174; + *(uint32 *)0xa05f80f0 = (18<<16) | 18; + + /* re-enable display (and set RGB888-mode) */ + *(uint32 *)0xa05f8044 |= ((2<<2) | 1); + +} + +void +hide_image() +{ + + uint32 *d = (uint32 *)0xa5000000; + uint32 i; + + /* disable display */ + *(volatile uint32 *)0xa05f8044 &= ~((3<<2) | 1); + + /* blank out image from framebuffer */ + for (i = 0; i < IMAGE2_SIZE/4; i++) { + *(d++) = 0xc0c0c0c0; + } + + /* dont bother with enabling display since bootROM will do it */ + +} + +void +wait_gdrom() +{ + /* wait for lid to open */ + while (get_status() != 6); + + /* wait for lid to close (and a proper disc inserted) */ + while (get_status() != 1); +} + +sint32 +get_status() +{ + + sint32 (*p)(void *, uint32, uint32, uint32) = (void *)*(uint32 *)0x8c0000bc; + uint32 buf[4]; + + (*p)(buf, 0, 0, 4); + + return (buf[0]); + +} + +void +reboot() +{ + void (*p)(sint32) = (void *)*(uint32 *)0x8c0000e0; + (*p)(-3); +} diff --git a/POWERVR/SRCS/palenforcer/types.h b/POWERVR/SRCS/palenforcer/types.h new file mode 100644 index 00000000..203ef44a --- /dev/null +++ b/POWERVR/SRCS/palenforcer/types.h @@ -0,0 +1,22 @@ +/* types.h */ + +#ifndef _TYPES_H_ +#define _TYPES_H_ + +#ifndef NULL +#define NULL ((void *)0) +#endif /* NULL */ + +typedef unsigned char uint8; +typedef signed char sint8; +typedef unsigned short uint16; +typedef signed short sint16; +typedef unsigned int uint32; +typedef signed int sint32; + +typedef enum { + FALSE = 0, + TRUE = 1, +} bool; + +#endif /* _TYPES_H_ */