├── .github ├── resources │ └── transparent.png └── workflows │ ├── build.yml │ └── build_pr.yml ├── .gitignore ├── .gitmodules ├── .vscode └── c_cpp_properties.json ├── README.md ├── checksum.sha1 ├── config ├── pr2.proto.yaml ├── reloc_addrs.txt ├── symbol_addrs.txt └── undefined_syms.txt ├── configure.py ├── decomp.yaml ├── diff_settings.py ├── include ├── common.h ├── dbug │ ├── dbgmsg.h │ ├── dbug.h │ ├── msg8x8data.h │ ├── syori.h │ └── vramsave.h ├── gcc │ ├── _G_config.h │ ├── _ansi.h │ ├── _syslist.h │ ├── ar.h │ ├── assert.h │ ├── ctype.h │ ├── dirent.h │ ├── errno.h │ ├── fastmath.h │ ├── fcntl.h │ ├── gcc-lib │ │ ├── README │ │ ├── exception │ │ ├── float.h │ │ ├── iso646.h │ │ ├── limits.h │ │ ├── new │ │ ├── new.h │ │ ├── proto.h │ │ ├── stdarg.h │ │ ├── stdbool.h │ │ ├── stddef.h │ │ ├── syslimits.h │ │ ├── typeinfo │ │ └── va-mips.h │ ├── grp.h │ ├── ieeefp.h │ ├── locale.h │ ├── machine │ │ ├── fastmath.h │ │ ├── ieeefp.h │ │ ├── regdef.h │ │ ├── setjmp-dj.h │ │ ├── setjmp.h │ │ ├── time.h │ │ └── types.h │ ├── malloc.h │ ├── math.h │ ├── paths.h │ ├── process.h │ ├── pwd.h │ ├── reent.h │ ├── regdef.h │ ├── setjmp.h │ ├── signal.h │ ├── stdio.h │ ├── stdlib.h │ ├── string.h │ ├── sys │ │ ├── _types.h │ │ ├── config.h │ │ ├── dirent.h │ │ ├── errno.h │ │ ├── fcntl.h │ │ ├── file.h │ │ ├── param.h │ │ ├── reent.h │ │ ├── resource.h │ │ ├── signal.h │ │ ├── stat-dj.h │ │ ├── stat.h │ │ ├── time.h │ │ ├── timeb.h │ │ ├── times.h │ │ ├── types.h │ │ ├── unistd.h │ │ ├── utime.h │ │ └── wait.h │ ├── termios.h │ ├── time.h │ ├── unctrl.h │ ├── unistd.h │ ├── utime.h │ └── utmp.h ├── include_asm.h ├── iop_mdl │ ├── tapctrl_rpc.h │ └── wp2cd_rpc.h ├── macro.inc ├── main │ ├── cdctrl.h │ ├── cmnfile.h │ ├── commake.h │ ├── drawctrl.h │ ├── effect.h │ ├── etc.h │ ├── fadectrl.h │ ├── main.h │ ├── mbar.h │ ├── mcctrl.h │ ├── p3str.h │ ├── pack.h │ ├── scrctrl.h │ ├── sprite.h │ ├── stdat.h │ ├── subt.h │ └── wipe.h ├── menu │ ├── memc.h │ ├── menu.h │ ├── menu_mdl.h │ ├── menudata.h │ ├── menufont.h │ ├── menusub.h │ ├── mntm2hed.h │ ├── p3mc.h │ └── pksprite.h ├── os │ ├── cmngifpk.h │ ├── mtc.h │ ├── syssub.h │ ├── system.h │ ├── tim2.h │ └── usrmem.h ├── prlib │ └── prlib.h └── sdk │ ├── ee │ ├── devvif0.h │ ├── devvu0.h │ ├── eekernel.h │ ├── eeregs.h │ ├── eestruct.h │ ├── eetypes.h │ ├── libdma.h │ ├── libgifpk.h │ ├── libgraph.h │ ├── libmc.h │ ├── libpad.h │ ├── libpad2.h │ ├── libvu0.h │ ├── sifcmd.h │ ├── sifdev.h │ └── sifrpc.h │ └── libcdvd.h ├── progress ├── dbug_progress.json ├── iop_mdl_progress.json ├── main_progress.json ├── menu_progress.json ├── nalib_progress.json ├── os_progress.json ├── prlib_progress.json ├── report.json └── total_progress.json ├── requirements.txt ├── src ├── dbug │ ├── dbgmsg.c │ ├── syori.c │ └── vramsave.c ├── iop_mdl │ ├── tapctrl_rpc.c │ └── wp2cd_rpc.c ├── main │ ├── cdctrl.c │ ├── cmnfile.c │ ├── commake.c │ ├── drawctrl.c │ ├── effect.c │ ├── etc.c │ ├── fadectrl.c │ ├── main.c │ ├── mbar.c │ ├── mcctrl.c │ ├── p3str.c │ ├── pack.c │ ├── scrctrl.c │ ├── sprite.c │ ├── stdat.c │ ├── subt.c │ └── wipe.c ├── menu │ ├── memc.c │ ├── menu.c │ ├── menu_mdl.c │ ├── menudata.c │ ├── menufont.c │ ├── menusub.c │ ├── mntm2hed.c │ ├── p3mc.c │ └── pksprite.c ├── nalib │ ├── namatrix.h │ └── navector.h ├── os │ ├── cmngifpk.c │ ├── mtc.c │ ├── syssub.c │ ├── system.c │ ├── tim2.c │ └── usrmem.c └── prlib │ ├── animation.cpp │ ├── animation.h │ ├── billboard.cpp │ ├── camera.cpp │ ├── camera.h │ ├── cluster.cpp │ ├── contour.cpp │ ├── database.cpp │ ├── database.h │ ├── depthfield.cpp │ ├── dma.cpp │ ├── dma.h │ ├── dmaqueue.cpp │ ├── dmaqueue.h │ ├── gifreg.cpp │ ├── menderer.cpp │ ├── mendereralpha.cpp │ ├── mendererawful.cpp │ ├── menderercreate.cpp │ ├── mendererdata.cpp │ ├── mfifo.cpp │ ├── microprogram.cpp │ ├── microprogram.h │ ├── model.cpp │ ├── model.h │ ├── old │ ├── animation.h │ ├── database.h │ ├── model.h │ ├── prlib.cpp │ ├── prpriv.h │ ├── renderstuff.h │ └── scene.h │ ├── prlib.cpp │ ├── prpriv.h │ ├── random.cpp │ ├── random.h │ ├── render.cpp │ ├── renderee.cpp │ ├── renderstuff.cpp │ ├── renderstuff.h │ ├── scene.cpp │ ├── scene.h │ ├── setpointer.cpp │ ├── shape.cpp │ ├── spadata.cpp │ ├── spadata.h │ ├── spram.cpp │ ├── tim2.cpp │ ├── tim2.h │ ├── transition.cpp │ ├── utility.cpp │ ├── utility.h │ ├── vram.cpp │ └── wave.cpp └── tools ├── buildtools └── elf_patcher.py ├── cc └── ee-gcc2.96 │ ├── bin │ └── ee-gcc │ ├── ee │ └── bin │ │ └── as │ └── lib │ └── gcc-lib │ └── ee │ └── 2.9-ee-991111-01 │ ├── cc1 │ ├── cc1plus │ └── cpp ├── coddog ├── diff.py ├── first_diff.py ├── objdiff-cli ├── ps2gfxdis.py └── report_progress.py /.github/resources/transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parappadev/parappa2/7c3f7d367adc1153143169e53e6373f93f25ce53/.github/resources/transparent.png -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: 4 | push: 5 | branches: [ main, develop ] 6 | pull_request: 7 | branches: [ main ] 8 | 9 | jobs: 10 | build: 11 | if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push' }} 12 | runs-on: ubuntu-22.04 13 | steps: 14 | - name: Checkout main repository 15 | uses: actions/checkout@v3 16 | with: 17 | submodules: recursive 18 | 19 | - name: Checkout binaries 20 | uses: actions/checkout@v3 21 | with: 22 | repository: polybiusproxy/p3_binaries 23 | token: ${{ secrets.BINARY_ACCESS_TOKEN }} 24 | path: iso 25 | 26 | - name: Setup Python 27 | uses: actions/setup-python@v4 28 | with: 29 | python-version: "3.10" 30 | 31 | - name: Upgrade pip 32 | run: python3 -m pip install --upgrade pip setuptools wheel 33 | 34 | - name: Decrypt ELF 35 | run: echo ${{ secrets.PROTO_ENCRYPTION_KEY }} | openssl enc -d -aes-256-cbc -pass stdin -pbkdf2 -in iso/SCPS_150.17.aes -out iso/SCPS_150.17 36 | 37 | - name: Add i686 architecture 38 | run: sudo dpkg --add-architecture i386 39 | 40 | - name: Install Ubuntu packages 41 | run: sudo apt-get update && sudo apt-get install -y gcc-mipsel-linux-gnu binutils-mips-linux-gnu ninja-build libc6:i386 libncurses5:i386 libstdc++6:i386 42 | 43 | - name: Install Python modules 44 | run: python3 -m pip install --upgrade -r requirements.txt 45 | 46 | - name: Configure 47 | run: python3 ./configure.py -c 48 | 49 | - name: Compile 50 | run: ninja 51 | 52 | - name: Upload progress report 53 | uses: actions/upload-artifact@v4 54 | with: 55 | name: ntscj_july12_report 56 | path: ./progress/report.json -------------------------------------------------------------------------------- /.github/workflows/build_pr.yml: -------------------------------------------------------------------------------- 1 | name: build_pr 2 | 3 | on: 4 | pull_request_target: 5 | branches: [ main ] 6 | 7 | jobs: 8 | build: 9 | if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push' }} 10 | runs-on: ubuntu-22.04 11 | steps: 12 | - name: Checkout main repository 13 | uses: actions/checkout@v3 14 | with: 15 | submodules: recursive 16 | 17 | - name: Checkout binaries 18 | uses: actions/checkout@v3 19 | with: 20 | repository: polybiusproxy/p3_binaries 21 | ssh-key: ${{ secrets.BINARY_ACCESS_TOKEN }} 22 | path: iso 23 | 24 | - name: Setup Python 25 | uses: actions/setup-python@v4 26 | with: 27 | python-version: "3.10" 28 | 29 | - name: Upgrade pip 30 | run: python3 -m pip install --upgrade pip setuptools wheel 31 | 32 | - name: Decrypt ELF 33 | run: echo ${{ secrets.PROTO_ENCRYPTION_KEY }} | openssl enc -d -aes-256-cbc -pass stdin -pbkdf2 -in iso/SCPS_150.17.aes -out iso/SCPS_150.17 34 | 35 | - name: Add i686 architecture 36 | run: sudo dpkg --add-architecture i386 37 | 38 | - name: Install Ubuntu packages 39 | run: sudo apt-get update && sudo apt-get install -y gcc-mipsel-linux-gnu binutils-mips-linux-gnu ninja-build libc6:i386 libncurses5:i386 libstdc++6:i386 40 | 41 | - name: Install Python modules 42 | run: python3 -m pip install --upgrade -r requirements.txt 43 | 44 | - name: Configure 45 | run: python3 ./configure.py -c 46 | 47 | - name: Compile 48 | run: ninja 49 | 50 | - name: Upload progress report 51 | uses: actions/upload-artifact@v4 52 | with: 53 | name: ntscj_july12_report 54 | path: ./progress/report.json 55 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__/ 2 | asm/ 3 | assets/ 4 | build/ 5 | 6 | permuter_settings.toml 7 | undefined_syms_auto.txt 8 | undefined_funcs_auto.txt 9 | 10 | .ninja_log 11 | .ninja_deps 12 | .splache 13 | .cache 14 | build.ninja 15 | iso/ 16 | SLPS_150.17* 17 | 18 | compile_commands.json 19 | 20 | *.bin 21 | *.ld 22 | *.o 23 | ctx.c 24 | ctx.c.m2c 25 | 26 | output/ 27 | .vscode/launch.json 28 | .vscode/settings.json 29 | objdiff.json 30 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "tools/decomp-permuter"] 2 | path = tools/decomp-permuter 3 | url = https://github.com/simonlindholm/decomp-permuter 4 | -------------------------------------------------------------------------------- /.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Linux-GCC", 5 | "includePath": [ 6 | "${workspaceFolder}/include/**" 7 | ], 8 | "compilerPath": "${workspaceFolder}/tools/cc/ee-gcc2.96/bin/ee-gcc", 9 | "cStandard": "c89", 10 | "cppStandard": "c++98" 11 | } 12 | ], 13 | "version": 4 14 | } -------------------------------------------------------------------------------- /checksum.sha1: -------------------------------------------------------------------------------- 1 | fa7b1d19c68c4d4f06cf3047a05f2b5daaae2a1e build/SCPS_150.17 -------------------------------------------------------------------------------- /config/reloc_addrs.txt: -------------------------------------------------------------------------------- 1 | // sdk/crt0.s: _start 2 | rom:0x1034 symbol:_gp reloc:MIPS_HI16 3 | rom:0x1048 symbol:_gp reloc:MIPS_LO16 4 | 5 | // os/mtc.c: MtcInit 6 | rom:0x2660 symbol:_gp reloc:MIPS_HI16 7 | rom:0x2664 symbol:_gp reloc:MIPS_LO16 8 | 9 | // os/mtc.c: MtcExec 10 | rom:0x278c symbol:_gp reloc:MIPS_HI16 11 | rom:0x2790 symbol:_gp reloc:MIPS_LO16 12 | 13 | // os/cdctrl.c: PackIntDecode 14 | rom:0x61d0 symbol:none reloc:MIPS_NONE 15 | rom:0x6238 symbol:none reloc:MIPS_NONE 16 | 17 | // os/cdctrl.c: PackIntDecodeWait 18 | rom:0x6354 symbol:none reloc:MIPS_NONE 19 | rom:0x63c8 symbol:none reloc:MIPS_NONE 20 | 21 | // sdk/thread.c: InitThread 22 | rom:0x6225c symbol:_gp reloc:MIPS_HI16 23 | rom:0x62268 symbol:_gp reloc:MIPS_LO16 24 | 25 | // sdk/eecdvd.c: sceCdInitEeCB 26 | rom:0x63664 symbol:_gp reloc:MIPS_HI16 27 | rom:0x63670 symbol:_gp reloc:MIPS_LO16 28 | -------------------------------------------------------------------------------- /config/undefined_syms.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parappadev/parappa2/7c3f7d367adc1153143169e53e6373f93f25ce53/config/undefined_syms.txt -------------------------------------------------------------------------------- /decomp.yaml: -------------------------------------------------------------------------------- 1 | name: PaRappa the Rapper 2 2 | platform: ps2 3 | versions: 4 | - name: proto 5 | fullname: July 12 prototype 6 | paths: 7 | baserom: "iso/SCPS_150.17" 8 | build: "build/SCPS_150.17" 9 | asm: "asm" 10 | nonmatchings: "asm/nonmatchings" 11 | map: "build/SCPS_150.17.map" 12 | elf: "build/SCPS_150.17" 13 | tools: -------------------------------------------------------------------------------- /diff_settings.py: -------------------------------------------------------------------------------- 1 | def apply(config, args): 2 | config["arch"] = "mipsee" 3 | config["baseimg"] = f"iso/SCPS_150.17" 4 | config["myimg"] = f"build/SCPS_150.17" 5 | config["mapfile"] = f"build/SCPS_150.17.map" 6 | config["source_directories"] = [ 7 | "src", 8 | "asm", 9 | "include", 10 | "assets", 11 | ] 12 | config["make_command"] = ["ninja"] 13 | config["expected_dir"] = f"expected/" -------------------------------------------------------------------------------- /include/common.h: -------------------------------------------------------------------------------- 1 | #ifndef COMMON_H 2 | #define COMMON_H 3 | 4 | #include "include_asm.h" 5 | 6 | typedef char s8; 7 | typedef short s16; 8 | typedef int s32; 9 | typedef long s64; 10 | 11 | typedef unsigned char u8; 12 | typedef unsigned short u16; 13 | typedef unsigned int u32; 14 | typedef unsigned long u64; 15 | 16 | typedef float f32; 17 | 18 | #define UNK_TYPE s32 19 | #define UNK_PTR void* 20 | #define UNK_RET void 21 | #define UNK_FUN_ARG void(*)(void) 22 | #define UNK_FUN_PTR(name) void(*name)(void) 23 | #define UNK_ARGS 24 | 25 | #ifndef NULL 26 | #define NULL 0 27 | #endif 28 | #ifndef TRUE 29 | #define TRUE 1 30 | #endif 31 | #ifndef FALSE 32 | #define FALSE 0 33 | #endif 34 | 35 | #define GS_X_COORD(x) ((2048 - (640 / 2) + x) << 4) 36 | #define GS_Y_COORD(y) ((2048 - (224 / 2) + y) << 4) 37 | 38 | #define PR_EXTERN extern "C" 39 | 40 | #define PR_SIZEOF(x) (int)(sizeof(x)) 41 | #define PR_ARRAYSIZEU(arr) (sizeof(arr) / sizeof(arr[0])) 42 | #define PR_ARRAYSIZE(arr) (s32)(sizeof(arr) / sizeof(arr[0])) 43 | #define PR_CLEAR(x) { u_int i; char *p = (char*)&x; for (i = 0; i < sizeof(x); i++) *p++ = 0; } 44 | #define PR_CONCAT(x, y) ((x << 16) | (y)) 45 | #define PR_BIT(x) (1 << x) 46 | 47 | #define PR_SCOPE { 48 | #define PR_SCOPEEND } 49 | 50 | #define PR_ALIGNU(size, align) ((u_int)(size + (align - 1)) & ~(align - 1)) 51 | #define PR_ALIGN(size, align) ((size + (align - 1)) & ~(align - 1)) 52 | 53 | #define PR_ALIGNED(x) __attribute__((aligned(x))) 54 | 55 | #define PR_UNCACHED(addr) ((u_int)(addr) | 0x20000000) 56 | #define PR_UNCACHEDACCEL(addr) ((u_int)(addr) | 0x30000000) 57 | 58 | #endif /* COMMON_H */ -------------------------------------------------------------------------------- /include/dbug/dbgmsg.h: -------------------------------------------------------------------------------- 1 | #ifndef DBGMSG_H 2 | #define DBGMSG_H 3 | 4 | #include "common.h" 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include "os/tim2.h" 11 | 12 | void DbgMsgInit(void); 13 | void DbgMsgClear(void); 14 | void DbgMsgFlash(void); 15 | 16 | void DbgMsgSetColor(u_char r, u_char g, u_char b); 17 | void DbgMsgSetSize(u_short sw, u_short sh); 18 | 19 | void DbgMsgPrint(u_char* m_pp, u_short x, u_short y); 20 | void DbgMsgPrintUserPkt(u_char* m_pp, u_short x, u_short y, sceGifPacket* usrPacket_pp); 21 | void DbgMsgClearUserPkt(sceGifPacket* usrPacket_pp); 22 | 23 | void DbgMsgSetColorUserPkt(u_char r, u_char g, u_char b, sceGifPacket* usrPacket_pp); 24 | void DbgMsgSetZ(int z); 25 | 26 | #endif -------------------------------------------------------------------------------- /include/dbug/dbug.h: -------------------------------------------------------------------------------- 1 | #ifndef DBUG_H 2 | #define DBUG_H 3 | 4 | #include 5 | 6 | typedef struct { // 0x10 7 | /* 0x0 */ int debug_on; 8 | /* 0x4 */ int use_line; 9 | /* 0x8 */ int score_updown; 10 | /* 0xc */ int non_play; 11 | } DBG_SELECT_STR; 12 | 13 | typedef struct { // 0x14 14 | /* 0x00 */ u_char *msg_pp; 15 | /* 0x04 */ int *set_pp; 16 | /* 0x08 */ int min; 17 | /* 0x0c */ int max; 18 | /* 0x10 */ u_char **selmsg_pp; 19 | } DBG_MODE_STR; 20 | 21 | #endif -------------------------------------------------------------------------------- /include/dbug/syori.h: -------------------------------------------------------------------------------- 1 | #ifndef SYORI_H 2 | #define SYORI_H 3 | 4 | #include "common.h" 5 | 6 | void SyoriLineInit(int bar_size); 7 | void SyoriLineReset(void); 8 | int SyoriLineCnt(int num); 9 | void SyoriLineDisp(short xp, short yp); 10 | 11 | #endif -------------------------------------------------------------------------------- /include/dbug/vramsave.h: -------------------------------------------------------------------------------- 1 | #ifndef VRAMSAVE_H 2 | #define VRAMSAVE_H 3 | 4 | #include "common.h" 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #include "os/tim2.h" 13 | 14 | #define BMP(x) ((BMP_HEADER*)x) 15 | 16 | typedef struct { // 0x38 17 | /* 0x00 */ u_char pad[2]; 18 | /* 0x02 */ u_char id[2]; 19 | /* 0x04 */ u_int tsize; 20 | /* 0x08 */ u_short reserved[2]; 21 | /* 0x0c */ u_int ofsbit; 22 | /* 0x10 */ u_int header; 23 | /* 0x14 */ u_int imageW; 24 | /* 0x18 */ u_int imageH; 25 | /* 0x1c */ u_short planes; 26 | /* 0x1e */ u_short bitPerPixel; 27 | /* 0x20 */ u_int compression; 28 | /* 0x24 */ u_int imageSize; 29 | /* 0x28 */ u_int XpixcelPerMeter; 30 | /* 0x2c */ u_int YpixcelPerMeter; 31 | /* 0x30 */ u_int numberOfColors; 32 | /* 0x34 */ u_int colorsImportant; 33 | /* 0x38 */ u_char imageData[0]; 34 | } BMP_HEADER; 35 | 36 | void VramSave(u_char *fname, int wsize, int hsize, int id); 37 | void VramSaveBMP(u_char *fname, int wsize, int hsize, int id); 38 | void VramSaveBMPDouble(u_char *fname, int wsize, int hsize, int id); 39 | void VramTmpSave(u_char *save_pp, int wsize, int hsize, int id); 40 | void VramTmpSaveOutBMP(u_char *fname, int wsize, int hsize, int id, u_char *dst1_pp, u_char *dst2_pp); 41 | 42 | #endif // VRAMSAVE_H -------------------------------------------------------------------------------- /include/gcc/_G_config.h: -------------------------------------------------------------------------------- 1 | /* AUTOMATICALLY GENERATED; DO NOT EDIT! */ 2 | #ifndef _G_config_h 3 | #define _G_config_h 4 | #define _G_LIB_VERSION "2.8-ee-991111" 5 | #define _G_NAMES_HAVE_UNDERSCORE 0 6 | #define _G_VTABLE_LABEL_HAS_LENGTH 1 7 | #define _G_VTABLE_LABEL_PREFIX "_vt$" 8 | #define _G_HAVE_ST_BLKSIZE 1 9 | 10 | #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) 11 | typedef int _G_int8_t __attribute__((__mode__(__QI__))); 12 | typedef unsigned int _G_uint8_t __attribute__((__mode__(__QI__))); 13 | typedef int _G_int16_t __attribute__((__mode__(__HI__))); 14 | typedef unsigned int _G_uint16_t __attribute__((__mode__(__HI__))); 15 | typedef int _G_int32_t __attribute__((__mode__(__SI__))); 16 | typedef unsigned int _G_uint32_t __attribute__((__mode__(__SI__))); 17 | typedef int _G_int64_t __attribute__((__mode__(__DI__))); 18 | typedef unsigned int _G_uint64_t __attribute__((__mode__(__DI__))); 19 | #if __GNUC__ > 2 || __GNUC_MINOR__ >= 8 20 | __extension__ typedef long long _G_llong; 21 | __extension__ typedef unsigned long long _G_ullong; 22 | #endif 23 | #else 24 | typedef short /* deduced */ _G_int16_t; 25 | typedef unsigned short /* deduced */ _G_uint16_t; 26 | typedef int /* deduced */ _G_int32_t; 27 | typedef unsigned int /* deduced */ _G_uint32_t; 28 | #endif 29 | 30 | typedef unsigned long _G_clock_t; 31 | typedef short _G_dev_t; 32 | typedef long _G_fpos_t; 33 | typedef unsigned short _G_gid_t; 34 | typedef unsigned short _G_ino_t; 35 | typedef int /* default */ _G_mode_t; 36 | typedef unsigned short _G_nlink_t; 37 | typedef long _G_off_t; 38 | typedef int _G_pid_t; 39 | #ifndef __PTRDIFF_TYPE__ 40 | #define __PTRDIFF_TYPE__ int 41 | #endif 42 | typedef __PTRDIFF_TYPE__ _G_ptrdiff_t; 43 | typedef unsigned long _G_sigset_t; 44 | #ifndef __SIZE_TYPE__ 45 | #define __SIZE_TYPE__ unsigned int 46 | #endif 47 | typedef __SIZE_TYPE__ _G_size_t; 48 | typedef long _G_time_t; 49 | typedef unsigned short _G_uid_t; 50 | typedef int _G_wchar_t; 51 | 52 | #define _G_BUFSIZ 1024 53 | #define _G_FOPEN_MAX 20 54 | #define _G_FILENAME_MAX 1024 55 | #if defined (__cplusplus) || defined (__STDC__) 56 | #define _G_ARGS(ARGLIST) ARGLIST 57 | #else 58 | #define _G_ARGS(ARGLIST) () 59 | #endif 60 | #if !defined (__GNUG__) || defined (__STRICT_ANSI__) 61 | #define _G_NO_NRV 62 | #endif 63 | #if !defined (__GNUG__) 64 | #define _G_NO_EXTERN_TEMPLATES 65 | #endif 66 | typedef long _G_ssize_t; 67 | typedef unsigned int _G_wint_t; 68 | typedef char * _G_va_list; 69 | #define _G_signal_return_type void 70 | #define _G_sprintf_return_type int 71 | #define _G_HAVE_ATEXIT 0 72 | #define _G_HAVE_SYS_RESOURCE 0 73 | #define _G_HAVE_SYS_TIMES 1 74 | #define _G_HAVE_SYS_SOCKET 0 75 | #define _G_HAVE_SYS_CDEFS 0 76 | #define _G_HAVE_SYS_WAIT 1 77 | #define _G_HAVE_UNISTD 1 78 | #define _G_HAVE_DIRENT 0 79 | #define _G_HAVE_CURSES 0 80 | #define _G_MATH_H_INLINES 0 81 | #define _G_HAVE_BOOL 1 82 | #define _G_HAVE_PRINTF_FP 0 83 | #define _G_HAVE_LONG_DOUBLE_IO 0 84 | #undef NULL 85 | #define __need_NULL 86 | #include 87 | #endif /* !_G_config_h */ 88 | -------------------------------------------------------------------------------- /include/gcc/_ansi.h: -------------------------------------------------------------------------------- 1 | /* Provide support for both ANSI and non-ANSI environments. */ 2 | 3 | /* Some ANSI environments are "broken" in the sense that __STDC__ cannot be 4 | relied upon to have it's intended meaning. Therefore we must use our own 5 | concoction: _HAVE_STDC. Always use _HAVE_STDC instead of __STDC__ in newlib 6 | sources! 7 | 8 | To get a strict ANSI C environment, define macro __STRICT_ANSI__. This will 9 | "comment out" the non-ANSI parts of the ANSI header files (non-ANSI header 10 | files aren't affected). */ 11 | 12 | #ifndef _ANSIDECL_H_ 13 | #define _ANSIDECL_H_ 14 | 15 | #include 16 | 17 | /* First try to figure out whether we really are in an ANSI C environment. */ 18 | /* FIXME: This probably needs some work. Perhaps sys/config.h can be 19 | prevailed upon to give us a clue. */ 20 | 21 | #ifdef __STDC__ 22 | #define _HAVE_STDC 23 | #endif 24 | 25 | #ifdef _HAVE_STDC 26 | #define _PTR void * 27 | #define _AND , 28 | #define _NOARGS void 29 | #define _CONST const 30 | #define _VOLATILE volatile 31 | #define _SIGNED signed 32 | #define _DOTS , ... 33 | #define _VOID void 34 | #define _EXFUN(name, proto) name proto 35 | #define _DEFUN(name, arglist, args) name(args) 36 | #define _DEFUN_VOID(name) name(_NOARGS) 37 | #define _CAST_VOID (void) 38 | #ifndef _LONG_DOUBLE 39 | #define _LONG_DOUBLE long double 40 | #endif 41 | #ifndef _PARAMS 42 | #define _PARAMS(paramlist) paramlist 43 | #endif 44 | #else 45 | #define _PTR char * 46 | #define _AND ; 47 | #define _NOARGS 48 | #define _CONST 49 | #define _VOLATILE 50 | #define _SIGNED 51 | #define _DOTS 52 | #define _VOID void 53 | #define _EXFUN(name, proto) name() 54 | #define _DEFUN(name, arglist, args) name arglist args; 55 | #define _DEFUN_VOID(name) name() 56 | #define _CAST_VOID 57 | #define _LONG_DOUBLE double 58 | #ifndef _PARAMS 59 | #define _PARAMS(paramlist) () 60 | #endif 61 | #endif 62 | 63 | /* Support gcc's __attribute__ facility. */ 64 | 65 | #ifdef __GNUC__ 66 | #define _ATTRIBUTE(attrs) __attribute__ (attrs) 67 | #else 68 | #define _ATTRIBUTE(attrs) 69 | #endif 70 | 71 | #endif /* _ANSIDECL_H_ */ 72 | -------------------------------------------------------------------------------- /include/gcc/_syslist.h: -------------------------------------------------------------------------------- 1 | /* internal use only -- mapping of "system calls" for libraries that lose 2 | and only provide C names, so that we end up in violation of ANSI */ 3 | #ifndef __SYSLIST_H 4 | #define __SYSLIST_H 5 | #ifdef MISSING_SYSCALL_NAMES 6 | #define _close close 7 | #define _execve execve 8 | #define _fcntl fcntl 9 | #define _fork fork 10 | #define _fstat fstat 11 | #define _getpid getpid 12 | #define _gettimeofday gettimeofday 13 | #define _kill kill 14 | #define _link link 15 | #define _lseek lseek 16 | #define _open open 17 | #define _read read 18 | #define _sbrk sbrk 19 | #define _stat stat 20 | #define _times times 21 | #define _unlink unlink 22 | #define _wait wait 23 | #define _write write 24 | /* functions not yet sysfaked */ 25 | #define _opendir opendir 26 | #define _readdir readdir 27 | #define _closedir closedir 28 | #endif 29 | #endif 30 | -------------------------------------------------------------------------------- /include/gcc/ar.h: -------------------------------------------------------------------------------- 1 | /* $NetBSD: ar.h,v 1.4 1994/10/26 00:55:43 cgd Exp $ */ 2 | 3 | /*- 4 | * Copyright (c) 1991, 1993 5 | * The Regents of the University of California. All rights reserved. 6 | * (c) UNIX System Laboratories, Inc. 7 | * All or some portions of this file are derived from material licensed 8 | * to the University of California by American Telephone and Telegraph 9 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with 10 | * the permission of UNIX System Laboratories, Inc. 11 | * 12 | * This code is derived from software contributed to Berkeley by 13 | * Hugh Smith at The University of Guelph. 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in the 22 | * documentation and/or other materials provided with the distribution. 23 | * 3. All advertising materials mentioning features or use of this software 24 | * must display the following acknowledgement: 25 | * This product includes software developed by the University of 26 | * California, Berkeley and its contributors. 27 | * 4. Neither the name of the University nor the names of its contributors 28 | * may be used to endorse or promote products derived from this software 29 | * without specific prior written permission. 30 | * 31 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 32 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 33 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 34 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 35 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 36 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 37 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 38 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 39 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 40 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 41 | * SUCH DAMAGE. 42 | * 43 | * @(#)ar.h 8.2 (Berkeley) 1/21/94 44 | */ 45 | 46 | #ifndef _AR_H_ 47 | #define _AR_H_ 48 | 49 | /* Pre-4BSD archives had these magic numbers in them. */ 50 | #define OARMAG1 0177555 51 | #define OARMAG2 0177545 52 | 53 | #define ARMAG "!\n" /* ar "magic number" */ 54 | #define SARMAG 8 /* strlen(ARMAG); */ 55 | 56 | #define AR_EFMT1 "#1/" /* extended format #1 */ 57 | 58 | struct ar_hdr { 59 | char ar_name[16]; /* name */ 60 | char ar_date[12]; /* modification time */ 61 | char ar_uid[6]; /* user id */ 62 | char ar_gid[6]; /* group id */ 63 | char ar_mode[8]; /* octal file permissions */ 64 | char ar_size[10]; /* size in bytes */ 65 | #define ARFMAG "`\n" 66 | char ar_fmag[2]; /* consistency check */ 67 | }; 68 | 69 | #endif /* !_AR_H_ */ 70 | -------------------------------------------------------------------------------- /include/gcc/assert.h: -------------------------------------------------------------------------------- 1 | /* 2 | assert.h 3 | */ 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #include "_ansi.h" 10 | 11 | #undef assert 12 | 13 | #ifdef NDEBUG /* required by ANSI standard */ 14 | #define assert(p) ((void)0) 15 | #else 16 | 17 | #ifdef __STDC__ 18 | #define assert(e) ((e) ? (void)0 : __assert(__FILE__, __LINE__, #e)) 19 | #else /* PCC */ 20 | #define assert(e) ((e) ? (void)0 : __assert(__FILE__, __LINE__, "e")) 21 | #endif 22 | 23 | #endif /* NDEBUG */ 24 | 25 | void _EXFUN(__assert,(const char *, int, const char *)); 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /include/gcc/ctype.h: -------------------------------------------------------------------------------- 1 | #ifndef _CTYPE_H_ 2 | #ifdef __cplusplus 3 | extern "C" { 4 | #endif 5 | #define _CTYPE_H_ 6 | 7 | #include "_ansi.h" 8 | 9 | int _EXFUN(isalnum, (int __c)); 10 | int _EXFUN(isalpha, (int __c)); 11 | int _EXFUN(iscntrl, (int __c)); 12 | int _EXFUN(isdigit, (int __c)); 13 | int _EXFUN(isgraph, (int __c)); 14 | int _EXFUN(islower, (int __c)); 15 | int _EXFUN(isprint, (int __c)); 16 | int _EXFUN(ispunct, (int __c)); 17 | int _EXFUN(isspace, (int __c)); 18 | int _EXFUN(isupper, (int __c)); 19 | int _EXFUN(isxdigit,(int __c)); 20 | int _EXFUN(tolower, (int __c)); 21 | int _EXFUN(toupper, (int __c)); 22 | 23 | #ifndef __STRICT_ANSI__ 24 | int _EXFUN(isascii, (int __c)); 25 | int _EXFUN(toascii, (int __c)); 26 | int _EXFUN(_tolower, (int __c)); 27 | int _EXFUN(_toupper, (int __c)); 28 | #endif 29 | 30 | #define _U 01 31 | #define _L 02 32 | #define _N 04 33 | #define _S 010 34 | #define _P 020 35 | #define _C 040 36 | #define _X 0100 37 | #define _B 0200 38 | 39 | #if !defined(__CYGWIN32__) || defined(__INSIDE_CYGWIN__) || defined(_COMPILING_NEWLIB) 40 | extern _CONST char _ctype_[]; 41 | #else 42 | extern _CONST char _ctype_[] __declspec(dllimport); 43 | #endif 44 | 45 | #define isalpha(c) ((_ctype_+1)[(unsigned)(c)]&(_U|_L)) 46 | #define isupper(c) ((_ctype_+1)[(unsigned)(c)]&_U) 47 | #define islower(c) ((_ctype_+1)[(unsigned)(c)]&_L) 48 | #define isdigit(c) ((_ctype_+1)[(unsigned)(c)]&_N) 49 | #define isxdigit(c) ((_ctype_+1)[(unsigned)(c)]&(_X|_N)) 50 | #define isspace(c) ((_ctype_+1)[(unsigned)(c)]&_S) 51 | #define ispunct(c) ((_ctype_+1)[(unsigned)(c)]&_P) 52 | #define isalnum(c) ((_ctype_+1)[(unsigned)(c)]&(_U|_L|_N)) 53 | #define isprint(c) ((_ctype_+1)[(unsigned)(c)]&(_P|_U|_L|_N|_B)) 54 | #define isgraph(c) ((_ctype_+1)[(unsigned)(c)]&(_P|_U|_L|_N)) 55 | #define iscntrl(c) ((_ctype_+1)[(unsigned)(c)]&_C) 56 | /* Non-gcc versions will get the library versions, and will be 57 | slightly slower */ 58 | #ifdef __GNUC__ 59 | # define toupper(c) \ 60 | ({ int __x = (c); islower(__x) ? (__x - 'a' + 'A') : __x;}) 61 | # define tolower(c) \ 62 | ({ int __x = (c); isupper(__x) ? (__x - 'A' + 'a') : __x;}) 63 | #endif 64 | 65 | #ifndef __STRICT_ANSI__ 66 | #define isascii(c) ((unsigned)(c)<=0177) 67 | #define toascii(c) ((c)&0177) 68 | #endif 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | #endif /* _CTYPE_H_ */ 74 | -------------------------------------------------------------------------------- /include/gcc/dirent.h: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | extern "C" { 3 | #endif 4 | #include 5 | #ifdef __cplusplus 6 | } 7 | #endif 8 | -------------------------------------------------------------------------------- /include/gcc/errno.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /include/gcc/fastmath.h: -------------------------------------------------------------------------------- 1 | #ifndef _FASTMATH_H_ 2 | #ifdef __cplusplus 3 | extern "C" { 4 | #endif 5 | #define _FASTMATH_H_ 6 | 7 | #include 8 | #include 9 | 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | #endif /* _FASTMATH_H_ */ 14 | -------------------------------------------------------------------------------- /include/gcc/fcntl.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /include/gcc/gcc-lib/README: -------------------------------------------------------------------------------- 1 | This README file is copied into the directory for GCC-only header files 2 | when fixincludes is run by the makefile for GCC. 3 | 4 | Many of the files in this directory were made from the standard system 5 | header files of this system by the shell script `fixincludes'. 6 | They are system-specific, and will not work on any other kind of system. 7 | They are also not part of GCC. The reason for making the files here 8 | is to fix the places in the header files which use constructs 9 | that are incompatible with ANSI C. 10 | -------------------------------------------------------------------------------- /include/gcc/gcc-lib/exception: -------------------------------------------------------------------------------- 1 | // Exception Handling support header for -*- C++ -*- 2 | // Copyright (C) 1995, 96-97, 1998 Free Software Foundation 3 | 4 | #ifndef __EXCEPTION__ 5 | #define __EXCEPTION__ 6 | 7 | #pragma interface "exception" 8 | 9 | extern "C++" { 10 | 11 | namespace std { 12 | 13 | class exception { 14 | public: 15 | exception () { } 16 | virtual ~exception () { } 17 | virtual const char* what () const; 18 | }; 19 | 20 | class bad_exception : public exception { 21 | public: 22 | bad_exception () { } 23 | virtual ~bad_exception () { } 24 | }; 25 | 26 | typedef void (*terminate_handler) (); 27 | typedef void (*unexpected_handler) (); 28 | 29 | terminate_handler set_terminate (terminate_handler); 30 | void terminate () __attribute__ ((__noreturn__)); 31 | unexpected_handler set_unexpected (unexpected_handler); 32 | void unexpected () __attribute__ ((__noreturn__)); 33 | bool uncaught_exception (); 34 | 35 | } // namespace std 36 | 37 | } // extern "C++" 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /include/gcc/gcc-lib/float.h: -------------------------------------------------------------------------------- 1 | /* float.h for target with IEEE 32 bit and 64 bit floating point formats */ 2 | #ifndef _FLOAT_H_ 3 | #define _FLOAT_H_ 4 | /* Produced by enquire version 4.3, CWI, Amsterdam */ 5 | 6 | /* Radix of exponent representation */ 7 | #undef FLT_RADIX 8 | #define FLT_RADIX 2 9 | /* Number of base-FLT_RADIX digits in the significand of a float */ 10 | #undef FLT_MANT_DIG 11 | #define FLT_MANT_DIG 24 12 | /* Number of decimal digits of precision in a float */ 13 | #undef FLT_DIG 14 | #define FLT_DIG 6 15 | /* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown */ 16 | #undef FLT_ROUNDS 17 | #define FLT_ROUNDS 1 18 | /* Difference between 1.0 and the minimum float greater than 1.0 */ 19 | #undef FLT_EPSILON 20 | #define FLT_EPSILON 1.19209290e-07F 21 | /* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */ 22 | #undef FLT_MIN_EXP 23 | #define FLT_MIN_EXP (-125) 24 | /* Minimum normalised float */ 25 | #undef FLT_MIN 26 | #define FLT_MIN 1.17549435e-38F 27 | /* Minimum int x such that 10**x is a normalised float */ 28 | #undef FLT_MIN_10_EXP 29 | #define FLT_MIN_10_EXP (-37) 30 | /* Maximum int x such that FLT_RADIX**(x-1) is a representable float */ 31 | #undef FLT_MAX_EXP 32 | #define FLT_MAX_EXP 128 33 | /* Maximum float */ 34 | #undef FLT_MAX 35 | #define FLT_MAX 3.40282347e+38F 36 | /* Maximum int x such that 10**x is a representable float */ 37 | #undef FLT_MAX_10_EXP 38 | #define FLT_MAX_10_EXP 38 39 | 40 | /* Number of base-FLT_RADIX digits in the significand of a double */ 41 | #undef DBL_MANT_DIG 42 | #define DBL_MANT_DIG 53 43 | /* Number of decimal digits of precision in a double */ 44 | #undef DBL_DIG 45 | #define DBL_DIG 15 46 | /* Difference between 1.0 and the minimum double greater than 1.0 */ 47 | #undef DBL_EPSILON 48 | #define DBL_EPSILON 2.2204460492503131e-16 49 | /* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */ 50 | #undef DBL_MIN_EXP 51 | #define DBL_MIN_EXP (-1021) 52 | /* Minimum normalised double */ 53 | #undef DBL_MIN 54 | #define DBL_MIN 2.2250738585072014e-308 55 | /* Minimum int x such that 10**x is a normalised double */ 56 | #undef DBL_MIN_10_EXP 57 | #define DBL_MIN_10_EXP (-307) 58 | /* Maximum int x such that FLT_RADIX**(x-1) is a representable double */ 59 | #undef DBL_MAX_EXP 60 | #define DBL_MAX_EXP 1024 61 | /* Maximum double */ 62 | #undef DBL_MAX 63 | #define DBL_MAX 1.7976931348623157e+308 64 | /* Maximum int x such that 10**x is a representable double */ 65 | #undef DBL_MAX_10_EXP 66 | #define DBL_MAX_10_EXP 308 67 | 68 | /* Number of base-FLT_RADIX digits in the significand of a long double */ 69 | #undef LDBL_MANT_DIG 70 | #define LDBL_MANT_DIG 53 71 | /* Number of decimal digits of precision in a long double */ 72 | #undef LDBL_DIG 73 | #define LDBL_DIG 15 74 | /* Difference between 1.0 and the minimum long double greater than 1.0 */ 75 | #undef LDBL_EPSILON 76 | #define LDBL_EPSILON 2.2204460492503131e-16L 77 | /* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */ 78 | #undef LDBL_MIN_EXP 79 | #define LDBL_MIN_EXP (-1021) 80 | /* Minimum normalised long double */ 81 | #undef LDBL_MIN 82 | #define LDBL_MIN 2.2250738585072014e-308L 83 | /* Minimum int x such that 10**x is a normalised long double */ 84 | #undef LDBL_MIN_10_EXP 85 | #define LDBL_MIN_10_EXP (-307) 86 | /* Maximum int x such that FLT_RADIX**(x-1) is a representable long double */ 87 | #undef LDBL_MAX_EXP 88 | #define LDBL_MAX_EXP 1024 89 | /* Maximum long double */ 90 | #undef LDBL_MAX 91 | #define LDBL_MAX 1.7976931348623157e+308L 92 | /* Maximum int x such that 10**x is a representable long double */ 93 | #undef LDBL_MAX_10_EXP 94 | #define LDBL_MAX_10_EXP 308 95 | 96 | #endif /* _FLOAT_H_ */ 97 | -------------------------------------------------------------------------------- /include/gcc/gcc-lib/iso646.h: -------------------------------------------------------------------------------- 1 | /* Macros for C programs written in national variants of ISO 646. */ 2 | 3 | #ifndef __cplusplus 4 | #define and && 5 | #define and_eq &= 6 | #define bitand & 7 | #define bitor | 8 | #define compl ~ 9 | #define not ! 10 | #define not_eq != 11 | #define or || 12 | #define or_eq |= 13 | #define xor ^ 14 | #define xor_eq ^= 15 | #endif 16 | -------------------------------------------------------------------------------- /include/gcc/gcc-lib/limits.h: -------------------------------------------------------------------------------- 1 | #ifndef _LIMITS_H___ 2 | #ifndef _MACH_MACHLIMITS_H_ 3 | 4 | /* _MACH_MACHLIMITS_H_ is used on OSF/1. */ 5 | #define _LIMITS_H___ 6 | #define _MACH_MACHLIMITS_H_ 7 | 8 | /* Number of bits in a `char'. */ 9 | #undef CHAR_BIT 10 | #define CHAR_BIT 8 11 | 12 | /* Maximum length of a multibyte character. */ 13 | #ifndef MB_LEN_MAX 14 | #define MB_LEN_MAX 1 15 | #endif 16 | 17 | /* Minimum and maximum values a `signed char' can hold. */ 18 | #undef SCHAR_MIN 19 | #define SCHAR_MIN (-128) 20 | #undef SCHAR_MAX 21 | #define SCHAR_MAX 127 22 | 23 | /* Maximum value an `unsigned char' can hold. (Minimum is 0). */ 24 | #undef UCHAR_MAX 25 | #define UCHAR_MAX 255 26 | 27 | /* Minimum and maximum values a `char' can hold. */ 28 | #ifdef __CHAR_UNSIGNED__ 29 | #undef CHAR_MIN 30 | #define CHAR_MIN 0 31 | #undef CHAR_MAX 32 | #define CHAR_MAX 255 33 | #else 34 | #undef CHAR_MIN 35 | #define CHAR_MIN (-128) 36 | #undef CHAR_MAX 37 | #define CHAR_MAX 127 38 | #endif 39 | 40 | /* Minimum and maximum values a `signed short int' can hold. */ 41 | #undef SHRT_MIN 42 | /* For the sake of 16 bit hosts, we may not use -32768 */ 43 | #define SHRT_MIN (-32767-1) 44 | #undef SHRT_MAX 45 | #define SHRT_MAX 32767 46 | 47 | /* Maximum value an `unsigned short int' can hold. (Minimum is 0). */ 48 | #undef USHRT_MAX 49 | #define USHRT_MAX 65535 50 | 51 | /* Minimum and maximum values a `signed int' can hold. */ 52 | #ifndef __INT_MAX__ 53 | #define __INT_MAX__ 2147483647 54 | #endif 55 | #undef INT_MIN 56 | #define INT_MIN (-INT_MAX-1) 57 | #undef INT_MAX 58 | #define INT_MAX __INT_MAX__ 59 | 60 | /* Maximum value an `unsigned int' can hold. (Minimum is 0). */ 61 | #undef UINT_MAX 62 | #define UINT_MAX (INT_MAX * 2U + 1) 63 | 64 | /* Minimum and maximum values a `signed long int' can hold. 65 | (Same as `int'). */ 66 | #ifndef __LONG_MAX__ 67 | #if defined (__alpha__) || defined (__sparc_v9__) || defined (__sparcv9) 68 | #define __LONG_MAX__ 9223372036854775807L 69 | #else 70 | #define __LONG_MAX__ 2147483647L 71 | #endif /* __alpha__ || sparc64 */ 72 | #endif 73 | #undef LONG_MIN 74 | #define LONG_MIN (-LONG_MAX-1) 75 | #undef LONG_MAX 76 | #define LONG_MAX __LONG_MAX__ 77 | 78 | /* Maximum value an `unsigned long int' can hold. (Minimum is 0). */ 79 | #undef ULONG_MAX 80 | #define ULONG_MAX (LONG_MAX * 2UL + 1) 81 | 82 | #if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__) 83 | /* Minimum and maximum values a `signed long long int' can hold. */ 84 | #ifndef __LONG_LONG_MAX__ 85 | #define __LONG_LONG_MAX__ 9223372036854775807LL 86 | #endif 87 | #undef LONG_LONG_MIN 88 | #define LONG_LONG_MIN (-LONG_LONG_MAX-1) 89 | #undef LONG_LONG_MAX 90 | #define LONG_LONG_MAX __LONG_LONG_MAX__ 91 | 92 | /* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */ 93 | #undef ULONG_LONG_MAX 94 | #define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1) 95 | #endif 96 | 97 | #endif /* _MACH_MACHLIMITS_H_ */ 98 | #endif /* _LIMITS_H___ */ 99 | -------------------------------------------------------------------------------- /include/gcc/gcc-lib/new: -------------------------------------------------------------------------------- 1 | /* CYGNUS LOCAL Embedded C++ whole file */ 2 | // The -*- C++ -*- dynamic memory management header. 3 | // Copyright (C) 1994, 96-97, 1998 Free Software Foundation 4 | 5 | #ifndef __NEW__ 6 | #define __NEW__ 7 | 8 | #pragma interface "new" 9 | #include 10 | 11 | #ifndef __EMBEDDED_CXX__ 12 | // Exception Handling is forbidden in Embedded C++. 13 | #include 14 | #define __THROW(what) throw (what) 15 | #define __nothing 16 | #else 17 | #define __THROW(what) 18 | #endif 19 | 20 | extern "C++" { 21 | 22 | namespace std { 23 | 24 | #ifndef __EMBEDDED_CXX__ 25 | class bad_alloc : public exception { 26 | public: 27 | virtual const char* what() const throw() { return "bad_alloc"; } 28 | }; 29 | #endif 30 | 31 | struct nothrow_t {}; 32 | extern const nothrow_t nothrow; 33 | 34 | typedef void (*new_handler)(); 35 | new_handler set_new_handler (new_handler); 36 | 37 | } // namespace std 38 | 39 | // replaceable signatures 40 | void *operator new (size_t) __THROW (std::bad_alloc); 41 | void *operator new[] (size_t) __THROW (std::bad_alloc); 42 | void operator delete (void *) __THROW(__nothing); 43 | void operator delete[] (void *) __THROW(__nothing); 44 | void *operator new (size_t, const nothrow_t&) __THROW(__nothing); 45 | void *operator new[] (size_t, const nothrow_t&) __THROW(__nothing); 46 | void operator delete (void *, const nothrow_t&) __THROW(__nothing); 47 | void operator delete[] (void *, const nothrow_t&) __THROW(__nothing); 48 | 49 | // default placement versions of operator new 50 | inline void *operator new(size_t, void *place) __THROW(__nothing) { 51 | return place; 52 | } 53 | inline void *operator new[](size_t, void *place) __THROW(__nothing) { 54 | return place; 55 | } 56 | 57 | } // extern "C++" 58 | 59 | #endif 60 | /* END CYGNUS LOCAL */ 61 | -------------------------------------------------------------------------------- /include/gcc/gcc-lib/new.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- forwarding header. 2 | 3 | #ifndef __NEW_H__ 4 | #define __NEW_H__ 5 | 6 | #include 7 | 8 | using std::new_handler; 9 | using std::set_new_handler; 10 | 11 | #endif // __NEW_H__ 12 | -------------------------------------------------------------------------------- /include/gcc/gcc-lib/proto.h: -------------------------------------------------------------------------------- 1 | /* This header file is to avoid trouble with semi-ANSI header files 2 | on the Convex in system version 8.0. */ 3 | 4 | #define _PROTO(list) () 5 | -------------------------------------------------------------------------------- /include/gcc/gcc-lib/stdbool.h: -------------------------------------------------------------------------------- 1 | /* stdbool.h for GNU. */ 2 | #ifndef __STDBOOL_H__ 3 | #define __STDBOOL_H__ 1 4 | 5 | /* The type `bool' must promote to `int' or `unsigned int'. The constants 6 | `true' and `false' must have the value 0 and 1 respectively. */ 7 | typedef enum 8 | { 9 | false = 0, 10 | true = 1 11 | } bool; 12 | 13 | /* The names `true' and `false' must also be made available as macros. */ 14 | #define false false 15 | #define true true 16 | 17 | /* Signal that all the definitions are present. */ 18 | #define __bool_true_false_are_defined 1 19 | 20 | #endif /* stdbool.h */ 21 | -------------------------------------------------------------------------------- /include/gcc/gcc-lib/syslimits.h: -------------------------------------------------------------------------------- 1 | /* syslimits.h stands for the system's own limits.h file. 2 | If we can use it ok unmodified, then we install this text. 3 | If fixincludes fixes it, then the fixed version is installed 4 | instead of this text. */ 5 | 6 | #define _GCC_NEXT_LIMITS_H /* tell gcc's limits.h to recurse */ 7 | #include_next 8 | #undef _GCC_NEXT_LIMITS_H 9 | -------------------------------------------------------------------------------- /include/gcc/gcc-lib/typeinfo: -------------------------------------------------------------------------------- 1 | // RTTI support for -*- C++ -*- 2 | // Copyright (C) 1994, 95-97, 1998 Free Software Foundation 3 | 4 | #ifndef __TYPEINFO__ 5 | #define __TYPEINFO__ 6 | 7 | #pragma interface "typeinfo" 8 | 9 | #include 10 | 11 | extern "C++" { 12 | 13 | namespace std { 14 | 15 | class type_info { 16 | private: 17 | // assigning type_info is not supported. made private. 18 | type_info& operator= (const type_info&); 19 | type_info (const type_info&); 20 | 21 | protected: 22 | explicit type_info (const char *n): _name (n) { } 23 | 24 | const char *_name; 25 | 26 | public: 27 | // destructor 28 | virtual ~type_info (); 29 | 30 | bool before (const type_info& arg) const; 31 | const char* name () const 32 | { return _name; } 33 | bool operator== (const type_info& arg) const; 34 | bool operator!= (const type_info& arg) const; 35 | }; 36 | 37 | inline bool type_info:: 38 | operator!= (const type_info& arg) const 39 | { 40 | return !operator== (arg); 41 | } 42 | 43 | class bad_cast : public exception { 44 | public: 45 | bad_cast() { } 46 | virtual ~bad_cast() { } 47 | }; 48 | 49 | class bad_typeid : public exception { 50 | public: 51 | bad_typeid () { } 52 | virtual ~bad_typeid () { } 53 | }; 54 | 55 | } // namespace std 56 | 57 | } // extern "C++" 58 | #endif 59 | -------------------------------------------------------------------------------- /include/gcc/grp.h: -------------------------------------------------------------------------------- 1 | /* $NetBSD: grp.h,v 1.7 1995/04/29 05:30:40 cgd Exp $ */ 2 | 3 | /*- 4 | * Copyright (c) 1989, 1993 5 | * The Regents of the University of California. All rights reserved. 6 | * (c) UNIX System Laboratories, Inc. 7 | * All or some portions of this file are derived from material licensed 8 | * to the University of California by American Telephone and Telegraph 9 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with 10 | * the permission of UNIX System Laboratories, Inc. 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions 14 | * are met: 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright 18 | * notice, this list of conditions and the following disclaimer in the 19 | * documentation and/or other materials provided with the distribution. 20 | * 3. All advertising materials mentioning features or use of this software 21 | * must display the following acknowledgement: 22 | * This product includes software developed by the University of 23 | * California, Berkeley and its contributors. 24 | * 4. Neither the name of the University nor the names of its contributors 25 | * may be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 29 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 30 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 31 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 32 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 37 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 38 | * SUCH DAMAGE. 39 | * 40 | * @(#)grp.h 8.2 (Berkeley) 1/21/94 41 | */ 42 | 43 | #ifndef _GRP_H_ 44 | #define _GRP_H_ 45 | 46 | #include 47 | 48 | #if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE) 49 | #define _PATH_GROUP "/etc/group" 50 | #endif 51 | 52 | struct group { 53 | char *gr_name; /* group name */ 54 | char *gr_passwd; /* group password */ 55 | int gr_gid; /* group id */ 56 | char **gr_mem; /* group members */ 57 | }; 58 | 59 | 60 | #ifdef __cplusplus 61 | extern "C" { 62 | #endif 63 | 64 | struct group *getgrgid (gid_t); 65 | struct group *getgrnam (const char *); 66 | #ifndef _POSIX_SOURCE 67 | struct group *getgrent (void); 68 | void setgrent (void); 69 | void endgrent (void); 70 | void setgrfile (const char *); 71 | #ifndef _XOPEN_SOURCE 72 | char *group_from_gid (gid_t, int); 73 | int setgroupent (int); 74 | #endif /* !_XOPEN_SOURCE */ 75 | #endif /* !_POSIX_SOURCE */ 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | 81 | #endif /* !_GRP_H_ */ 82 | -------------------------------------------------------------------------------- /include/gcc/locale.h: -------------------------------------------------------------------------------- 1 | /* 2 | locale.h 3 | Values appropriate for the formatting of monetary and other 4 | numberic quantities. 5 | */ 6 | 7 | #ifndef _LOCALE_H_ 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | #define _LOCALE_H_ 12 | 13 | #include "_ansi.h" 14 | 15 | #ifndef NULL 16 | #define NULL 0L 17 | #endif 18 | 19 | #define LC_ALL 0 20 | #define LC_COLLATE 1 21 | #define LC_CTYPE 2 22 | #define LC_MONETARY 3 23 | #define LC_NUMERIC 4 24 | #define LC_TIME 5 25 | 26 | struct lconv 27 | { 28 | char *decimal_point; 29 | char *thousands_sep; 30 | char *grouping; 31 | char *int_curr_symbol; 32 | char *currency_symbol; 33 | char *mon_decimal_point; 34 | char *mon_thousands_sep; 35 | char *mon_grouping; 36 | char *positive_sign; 37 | char *negative_sign; 38 | char int_frac_digits; 39 | char frac_digits; 40 | char p_cs_precedes; 41 | char p_sep_by_space; 42 | char n_cs_precedes; 43 | char n_sep_by_space; 44 | char p_sign_posn; 45 | char n_sign_posn; 46 | }; 47 | 48 | #ifndef _REENT_ONLY 49 | char *_EXFUN(setlocale,(int category, const char *locale)); 50 | struct lconv *_EXFUN(localeconv,(void)); 51 | #endif 52 | 53 | struct _reent; 54 | char *_EXFUN(_setlocale_r,(struct _reent *, int category, const char *locale)); 55 | struct lconv *_EXFUN(_localeconv_r,(struct _reent *)); 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | #endif /* _LOCALE_H_ */ 61 | -------------------------------------------------------------------------------- /include/gcc/machine/ieeefp.h: -------------------------------------------------------------------------------- 1 | #ifndef __IEEE_BIG_ENDIAN 2 | #ifndef __IEEE_LITTLE_ENDIAN 3 | 4 | #if defined(__arm__) || defined(__thumb__) 5 | /* ARM always has big-endian words. Within those words the byte ordering 6 | appears to be big or little endian. Newlib doesn't seem to care about 7 | the byte ordering within words. */ 8 | #define __IEEE_BIG_ENDIAN 9 | #endif 10 | 11 | #ifdef __hppa__ 12 | #define __IEEE_BIG_ENDIAN 13 | #endif 14 | 15 | #ifdef __sparc__ 16 | #ifdef __LITTLE_ENDIAN_DATA__ 17 | #define __IEEE_LITTLE_ENDIAN 18 | #else 19 | #define __IEEE_BIG_ENDIAN 20 | #endif 21 | #endif 22 | 23 | #if defined(__m68k__) || defined(__mc68000__) 24 | #define __IEEE_BIG_ENDIAN 25 | #endif 26 | 27 | #if defined (__H8300__) || defined (__H8300H__) || defined (__H8300S__) 28 | #define __IEEE_BIG_ENDIAN 29 | #define __SMALL_BITFIELDS 30 | #define _DOUBLE_IS_32BITS 31 | #endif 32 | 33 | #ifdef __H8500__ 34 | #define __IEEE_BIG_ENDIAN 35 | #define __SMALL_BITFIELDS 36 | #define _DOUBLE_IS_32BITS 37 | #endif 38 | 39 | #ifdef __sh__ 40 | #ifdef __LITTLE_ENDIAN__ 41 | #define __IEEE_LITTLE_ENDIAN 42 | #else 43 | #define __IEEE_BIG_ENDIAN 44 | #endif 45 | #if defined(__SH3E__) || defined(__SH4_SINGLE_ONLY__) 46 | #define _DOUBLE_IS_32BITS 47 | #endif 48 | #endif 49 | 50 | #ifdef _AM29K 51 | #define __IEEE_BIG_ENDIAN 52 | #endif 53 | 54 | #ifdef __i386__ 55 | #define __IEEE_LITTLE_ENDIAN 56 | #endif 57 | 58 | #ifdef __i960__ 59 | #define __IEEE_LITTLE_ENDIAN 60 | #endif 61 | 62 | #ifdef __M32R__ 63 | #define __IEEE_BIG_ENDIAN 64 | #endif 65 | 66 | #ifdef __TIC80__ 67 | #define __IEEE_LITTLE_ENDIAN 68 | #endif 69 | 70 | #ifdef __MIPSEL__ 71 | #define __IEEE_LITTLE_ENDIAN 72 | #endif 73 | #ifdef __MIPSEB__ 74 | #define __IEEE_BIG_ENDIAN 75 | #endif 76 | 77 | /* necv70 was __IEEE_LITTLE_ENDIAN. */ 78 | 79 | #ifdef __W65__ 80 | #define __IEEE_LITTLE_ENDIAN 81 | #define __SMALL_BITFIELDS 82 | #define _DOUBLE_IS_32BITS 83 | #endif 84 | 85 | #if defined(__Z8001__) || defined(__Z8002__) 86 | #define __IEEE_BIG_ENDIAN 87 | #endif 88 | 89 | #ifdef __m88k__ 90 | #define __IEEE_BIG_ENDIAN 91 | #endif 92 | 93 | #ifdef __mn10300__ 94 | #define __IEEE_LITTLE_ENDIAN 95 | #endif 96 | 97 | #ifdef __mn10200__ 98 | #define __IEEE_LITTLE_ENDIAN 99 | #define __SMALL_BITFIELDS 100 | #define _DOUBLE_IS_32BITS 101 | #endif 102 | 103 | #ifdef __v800 104 | #define __IEEE_LITTLE_ENDIAN 105 | #endif 106 | 107 | #ifdef __v850 108 | #define __IEEE_LITTLE_ENDIAN 109 | #endif 110 | 111 | #ifdef __D10V__ 112 | #define __IEEE_BIG_ENDIAN 113 | #define _DOUBLE_IS_32BITS 114 | #define __SMALL_BITFIELDS 115 | #endif 116 | 117 | #ifdef __PPC__ 118 | #if (defined(_BIG_ENDIAN) && _BIG_ENDIAN) || (defined(_AIX) && _AIX) 119 | #define __IEEE_BIG_ENDIAN 120 | #else 121 | #if (defined(_LITTLE_ENDIAN) && _LITTLE_ENDIAN) || (defined(__sun__) && __sun__) || (defined(_WIN32) && _WIN32) 122 | #define __IEEE_LITTLE_ENDIAN 123 | #endif 124 | #endif 125 | #endif 126 | 127 | #ifdef __arc__ 128 | #ifdef __big_endian__ 129 | #define __IEEE_BIG_ENDIAN 130 | #else 131 | #define __IEEE_LITTLE_ENDIAN 132 | #endif 133 | #endif 134 | 135 | #ifdef __fr30__ 136 | #define __IEEE_BIG_ENDIAN 137 | #endif 138 | 139 | #ifndef __IEEE_BIG_ENDIAN 140 | #ifndef __IEEE_LITTLE_ENDIAN 141 | #error Endianess not declared!! 142 | #endif /* not __IEEE_LITTLE_ENDIAN */ 143 | #endif /* not __IEEE_BIG_ENDIAN */ 144 | 145 | #endif /* not __IEEE_LITTLE_ENDIAN */ 146 | #endif /* not __IEEE_BIG_ENDIAN */ 147 | 148 | -------------------------------------------------------------------------------- /include/gcc/machine/regdef.h: -------------------------------------------------------------------------------- 1 | /* regdef.h -- define MIPS register names. */ 2 | 3 | #ifndef mips_regdef_h 4 | 5 | #define zero $0 6 | #define v0 $2 7 | #define v1 $3 8 | #define a0 $4 9 | #define a1 $5 10 | #define a2 $6 11 | #define a3 $7 12 | #define t0 $8 13 | #define t1 $9 14 | #define t2 $10 15 | #define t3 $11 16 | #define t4 $12 17 | #define t5 $13 18 | #define t6 $14 19 | #define t7 $15 20 | #define s0 $16 21 | #define s1 $17 22 | #define s2 $18 23 | #define s3 $19 24 | #define s4 $20 25 | #define s5 $21 26 | #define s6 $22 27 | #define s7 $23 28 | #define t8 $24 29 | #define t9 $25 30 | #define k0 $26 31 | #define k1 $27 32 | #define gp $gp 33 | #define sp $sp 34 | #define s8 $30 35 | #define ra $31 36 | #define pc $pc 37 | 38 | #endif /* mips_regdef_h */ 39 | -------------------------------------------------------------------------------- /include/gcc/machine/setjmp-dj.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 3 | ** 4 | ** This file is distributed under the terms listed in the document 5 | ** "copying.dj", available from DJ Delorie at the address above. 6 | ** A copy of "copying.dj" should accompany this file; if not, a copy 7 | ** should be available from where this file was obtained. This file 8 | ** may not be distributed without a verbatim copy of "copying.dj". 9 | ** 10 | ** This file is distributed WITHOUT ANY WARRANTY; without even the implied 11 | ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | */ 13 | 14 | /* Modified to use SETJMP_DJ_H rather than SETJMP_H to avoid 15 | conflicting with setjmp.h. Ian Taylor, Cygnus support, April, 16 | 1993. */ 17 | 18 | #ifndef _SETJMP_DJ_H_ 19 | #define _SETJMP_DJ_H_ 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | typedef struct { 26 | unsigned long eax; 27 | unsigned long ebx; 28 | unsigned long ecx; 29 | unsigned long edx; 30 | unsigned long esi; 31 | unsigned long edi; 32 | unsigned long ebp; 33 | unsigned long esp; 34 | unsigned long eip; 35 | } jmp_buf[1]; 36 | 37 | extern int setjmp(jmp_buf); 38 | extern void longjmp(jmp_buf, int); 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /include/gcc/machine/setjmp.h: -------------------------------------------------------------------------------- 1 | #if defined(__arm__) || defined(__thumb__) 2 | /* 3 | * All callee preserved registers: 4 | * v1 - v7, fp, ip, sp, lr, f4, f5, f6, f7 5 | */ 6 | #define _JBLEN 23 7 | #endif 8 | 9 | #ifdef __sparc__ 10 | /* 11 | * onsstack,sigmask,sp,pc,npc,psr,g1,o0,wbcnt (sigcontext). 12 | * All else recovered by under/over(flow) handling. 13 | */ 14 | #define _JBLEN 13 15 | #endif 16 | 17 | /* necv70 was 9 as well. */ 18 | 19 | #ifdef __mc68000__ 20 | /* 21 | * onsstack,sigmask,sp,pc,psl,d2-d7,a2-a6, 22 | * fp2-fp7 for 68881. 23 | * All else recovered by under/over(flow) handling. 24 | */ 25 | #define _JBLEN 34 26 | #endif 27 | 28 | #if defined(__Z8001__) || defined(__Z8002__) 29 | /* 16 regs + pc */ 30 | #define _JBLEN 20 31 | #endif 32 | 33 | #ifdef _AM29K 34 | /* 35 | * onsstack,sigmask,sp,pc,npc,psr,g1,o0,wbcnt (sigcontext). 36 | * All else recovered by under/over(flow) handling. 37 | */ 38 | #define _JBLEN 9 39 | #endif 40 | 41 | #ifdef __i386__ 42 | #ifdef __unix__ 43 | # define _JBLEN 36 44 | #elif defined(_WIN32) 45 | #define _JBLEN (13 * 4) 46 | #else 47 | #include "setjmp-dj.h" 48 | #endif 49 | #endif 50 | 51 | #ifdef __i960__ 52 | #define _JBLEN 35 53 | #endif 54 | 55 | #ifdef __M32R__ 56 | /* Only 8 words are currently needed. 10 gives us some slop if we need 57 | to expand. */ 58 | #define _JBLEN 10 59 | #endif 60 | 61 | #ifdef __mips__ 62 | #define _JBLEN 11 63 | #endif 64 | 65 | #ifdef __m88000__ 66 | #define _JBLEN 21 67 | #endif 68 | 69 | #ifdef __H8300__ 70 | #define _JBLEN 5 71 | typedef int jmp_buf[_JBLEN]; 72 | #endif 73 | 74 | #ifdef __H8300H__ 75 | /* same as H8/300 but registers are twice as big */ 76 | #define _JBLEN 5 77 | #define _JBTYPE long 78 | #endif 79 | 80 | #ifdef __H8300S__ 81 | /* same as H8/300 but registers are twice as big */ 82 | #define _JBLEN 5 83 | #define _JBTYPE long 84 | #endif 85 | 86 | #ifdef __H8500__ 87 | #define _JBLEN 4 88 | #endif 89 | 90 | #ifdef __sh__ 91 | #define _JBLEN 20 92 | #endif 93 | 94 | #ifdef __v800 95 | #define _JBLEN 28 96 | #endif 97 | 98 | #ifdef __PPC__ 99 | #define _JBLEN 32 100 | #define _JBTYPE double 101 | #endif 102 | 103 | #ifdef __hppa__ 104 | /* %r30, %r2-%r18, %r27, pad, %fr12-%fr15. 105 | Note space exists for the FP registers, but they are not 106 | saved. */ 107 | #define _JBLEN 28 108 | #endif 109 | 110 | #if defined(__mn10300__) || defined(__mn10200__) 111 | /* A guess */ 112 | #define _JBLEN 10 113 | #endif 114 | 115 | #ifdef __v850 116 | /* I think our setjmp is saving 15 regs at the moment. Gives us one word 117 | slop if we need to expand. */ 118 | #define _JBLEN 16 119 | #endif 120 | 121 | #ifdef __TIC80__ 122 | #define _JBLEN 13 123 | #endif 124 | 125 | #ifdef __D10V__ 126 | #define _JBLEN 8 127 | #endif 128 | 129 | #ifdef __D30V__ 130 | #define _JBLEN ((64 /* GPR */ + (2*2) /* ACs */ + 18 /* CRs */) / 2) 131 | #define _JBTYPE double 132 | #endif 133 | 134 | #ifdef __fr30__ 135 | #define _JBLEN 10 136 | #endif 137 | 138 | #ifdef _JBLEN 139 | #ifdef _JBTYPE 140 | typedef _JBTYPE jmp_buf[_JBLEN]; 141 | #else 142 | typedef int jmp_buf[_JBLEN]; 143 | #endif 144 | 145 | #ifdef __CYGWIN32__ 146 | #include 147 | 148 | /* POSIX sigsetjmp/siglongjmp macros */ 149 | typedef int sigjmp_buf[_JBLEN+2]; 150 | 151 | #define _SAVEMASK _JBLEN 152 | #define _SIGMASK (_JBLEN+1) 153 | 154 | #define sigsetjmp(env, savemask) (env[_SAVEMASK] = savemask,\ 155 | sigprocmask (SIG_SETMASK, 0, (sigset_t *) &env[_SIGMASK]),\ 156 | setjmp (env)) 157 | 158 | #define siglongjmp(env, val) (((env[_SAVEMASK])?\ 159 | sigprocmask (SIG_SETMASK, (sigset_t *) &env[_SIGMASK], 0):0),\ 160 | longjmp (env, val)) 161 | 162 | #endif /* __CYGWIN32__*/ 163 | #endif 164 | -------------------------------------------------------------------------------- /include/gcc/machine/time.h: -------------------------------------------------------------------------------- 1 | #ifndef _MACHTIME_H_ 2 | #define _MACHTIME_H_ 3 | 4 | #if defined(__arm__) || defined(__thumb__) 5 | #define _CLOCKS_PER_SEC_ 100 6 | #endif 7 | 8 | #endif /* _MACHTIME_H_ */ 9 | 10 | 11 | -------------------------------------------------------------------------------- /include/gcc/machine/types.h: -------------------------------------------------------------------------------- 1 | #ifndef _MACHTYPES_H_ 2 | #define _MACHTYPES_H_ 3 | 4 | #define _CLOCK_T_ unsigned long /* clock() */ 5 | #define _TIME_T_ long /* time() */ 6 | 7 | #endif /* _MACHTYPES_H_ */ 8 | 9 | 10 | -------------------------------------------------------------------------------- /include/gcc/malloc.h: -------------------------------------------------------------------------------- 1 | /* malloc.h -- header file for memory routines. */ 2 | 3 | #ifndef _INCLUDE_MALLOC_H_ 4 | #define _INCLUDE_MALLOC_H_ 5 | 6 | #include <_ansi.h> 7 | #include 8 | 9 | #define __need_size_t 10 | #include 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | /* This version of struct mallinfo must match the one in 17 | libc/stdlib/mallocr.c. */ 18 | 19 | struct mallinfo { 20 | int arena; /* total space allocated from system */ 21 | int ordblks; /* number of non-inuse chunks */ 22 | int smblks; /* unused -- always zero */ 23 | int hblks; /* number of mmapped regions */ 24 | int hblkhd; /* total space in mmapped regions */ 25 | int usmblks; /* unused -- always zero */ 26 | int fsmblks; /* unused -- always zero */ 27 | int uordblks; /* total allocated space */ 28 | int fordblks; /* total non-inuse space */ 29 | int keepcost; /* top-most, releasable (via malloc_trim) space */ 30 | }; 31 | 32 | /* The routines. */ 33 | 34 | extern _PTR malloc _PARAMS ((size_t)); 35 | extern _PTR _malloc_r _PARAMS ((struct _reent *, size_t)); 36 | 37 | extern _VOID free _PARAMS ((_PTR)); 38 | extern _VOID _free_r _PARAMS ((struct _reent *, _PTR)); 39 | 40 | extern _PTR realloc _PARAMS ((_PTR, size_t)); 41 | extern _PTR _realloc_r _PARAMS ((struct _reent *, _PTR, size_t)); 42 | 43 | extern _PTR calloc _PARAMS ((size_t, size_t)); 44 | extern _PTR _calloc_r _PARAMS ((struct _reent *, size_t, size_t)); 45 | 46 | extern _PTR memalign _PARAMS ((size_t, size_t)); 47 | extern _PTR _memalign_r _PARAMS ((struct _reent *, size_t, size_t)); 48 | 49 | extern struct mallinfo mallinfo _PARAMS ((void)); 50 | extern struct mallinfo _mallinfo_r _PARAMS ((struct _reent *)); 51 | 52 | extern void malloc_stats _PARAMS ((void)); 53 | extern void _malloc_stats_r _PARAMS ((struct _reent *)); 54 | 55 | extern int mallopt _PARAMS ((int, int)); 56 | extern int _mallopt_r _PARAMS ((struct _reent *, int, int)); 57 | 58 | extern size_t malloc_usable_size _PARAMS ((_PTR)); 59 | extern size_t _malloc_usable_size_r _PARAMS ((struct _reent *, _PTR)); 60 | 61 | /* These aren't too useful on an embedded system, but we define them 62 | anyhow. */ 63 | 64 | extern _PTR valloc _PARAMS ((size_t)); 65 | extern _PTR _valloc_r _PARAMS ((struct _reent *, size_t)); 66 | 67 | extern _PTR pvalloc _PARAMS ((size_t)); 68 | extern _PTR _pvalloc_r _PARAMS ((struct _reent *, size_t)); 69 | 70 | extern int malloc_trim _PARAMS ((size_t)); 71 | extern int _malloc_trim_r _PARAMS ((struct _reent *, size_t)); 72 | 73 | /* Some systems provide this, so do too for compatibility. */ 74 | 75 | extern void cfree _PARAMS ((_PTR)); 76 | 77 | /* A compatibility routine for an earlier version of the allocator. */ 78 | 79 | extern _VOID mstats _PARAMS ((char *)); 80 | extern _VOID _mstats_r _PARAMS ((struct _reent *, char *)); 81 | 82 | #ifdef __CYGWIN32__ 83 | 84 | /* Cygwin32 needs to be able to copy all the malloc information from 85 | the parent to the child. However, cygwin32 does not normally copy 86 | any data in the DLL data section. This routine handles copying 87 | that information. */ 88 | 89 | extern int __malloc_copy _PARAMS ((int (*) (void *, void *, void *, int), 90 | void *, int)); 91 | #endif /* __CYGWIN32 */ 92 | 93 | #ifdef __cplusplus 94 | } 95 | #endif 96 | 97 | #endif /* _INCLUDE_MALLOC_H_ */ 98 | -------------------------------------------------------------------------------- /include/gcc/paths.h: -------------------------------------------------------------------------------- 1 | #ifndef _PATHS_H_ 2 | #define _PATHS_H_ 3 | 4 | #define _PATH_DEV "/dev/" 5 | #define _PATH_BSHELL "/bin/sh" 6 | 7 | #endif /* _PATHS_H_ */ 8 | -------------------------------------------------------------------------------- /include/gcc/process.h: -------------------------------------------------------------------------------- 1 | /* process.h. This file comes with MSDOS and WIN32 systems. */ 2 | 3 | #ifndef __PROCESS_H_ 4 | #define __PROCESS_H_ 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | int execl(const char *path, const char *argv0, ...); 11 | int execle(const char *path, const char *argv0, ... /*, char * const *envp */); 12 | int execlp(const char *path, const char *argv0, ...); 13 | int execlpe(const char *path, const char *argv0, ... /*, char * const *envp */); 14 | 15 | int execv(const char *path, char * const *argv); 16 | int execve(const char *path, char * const *argv, char * const *envp); 17 | int execvp(const char *path, char * const *argv); 18 | int execvpe(const char *path, char * const *argv, char * const *envp); 19 | 20 | int spawnl(int mode, const char *path, const char *argv0, ...); 21 | int spawnle(int mode, const char *path, const char *argv0, ... /*, char * const *envp */); 22 | int spawnlp(int mode, const char *path, const char *argv0, ...); 23 | int spawnlpe(int mode, const char *path, const char *argv0, ... /*, char * const *envp */); 24 | 25 | int spawnv(int mode, const char *path, const char * const *argv); 26 | int spawnve(int mode, const char *path, char * const *argv, const char * const *envp); 27 | int spawnvp(int mode, const char *path, const char * const *argv); 28 | int spawnvpe(int mode, const char *path, const char * const *argv, const char * const *envp); 29 | 30 | #ifdef __CYGWIN32__ 31 | /* Secure exec() functions family */ 32 | /* The first arg should really be a HANDLE which is a void *. But we 33 | can't include windows.h here so... */ 34 | #include 35 | pid_t sexecl(void *, const char *path, const char *argv0, ...); 36 | pid_t sexecle(void *, const char *path, const char *argv0, ... /*, char * const *envp */); 37 | pid_t sexeclp(void *, const char *path, const char *argv0, ...); 38 | pid_t sexeclpe(void *, const char *path, const char *argv0, ... /*, char * const *envp */); 39 | 40 | pid_t sexecv(void *, const char *path, const char * const *argv); 41 | pid_t sexecve(void *, const char *path, const char * const *argv, const char * const *envp); 42 | pid_t sexecvp(void *, const char *path, const char * const *argv); 43 | pid_t sexecvpe(void *, const char *path, const char * const *argv, const char * const *envp); 44 | #endif 45 | 46 | int cwait(int *, int, int); 47 | 48 | #define _P_WAIT 1 49 | #define _P_NOWAIT 2 /* always generates error */ 50 | #define _P_OVERLAY 3 51 | #define _P_NOWAITO 4 52 | #define _P_DETACH 5 53 | 54 | #define WAIT_CHILD 1 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /include/gcc/pwd.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1989 The Regents of the University of California. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by the University of 16 | * California, Berkeley and its contributors. 17 | * 4. Neither the name of the University nor the names of its contributors 18 | * may be used to endorse or promote products derived from this software 19 | * without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 | * SUCH DAMAGE. 32 | * 33 | * @(#)pwd.h 5.13 (Berkeley) 5/28/91 34 | */ 35 | 36 | #ifndef _PWD_H_ 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | #define _PWD_H_ 41 | 42 | #include 43 | 44 | #ifndef _POSIX_SOURCE 45 | #define _PATH_PASSWD "/etc/passwd" 46 | 47 | #define _PASSWORD_LEN 128 /* max length, not counting NULL */ 48 | #endif 49 | 50 | struct passwd { 51 | char *pw_name; /* user name */ 52 | char *pw_passwd; /* encrypted password */ 53 | int pw_uid; /* user uid */ 54 | int pw_gid; /* user gid */ 55 | char *pw_comment; /* comment */ 56 | char *pw_gecos; /* Honeywell login info */ 57 | char *pw_dir; /* home directory */ 58 | char *pw_shell; /* default shell */ 59 | }; 60 | 61 | struct passwd *getpwuid (uid_t); 62 | struct passwd *getpwnam (const char *); 63 | #ifndef _POSIX_SOURCE 64 | struct passwd *getpwent (void); 65 | void setpwent (void); 66 | void endpwent (void); 67 | #endif 68 | 69 | #ifdef __cplusplus 70 | } 71 | #endif 72 | #endif /* _PWD_H_ */ 73 | -------------------------------------------------------------------------------- /include/gcc/regdef.h: -------------------------------------------------------------------------------- 1 | /* regdef.h -- define register names. */ 2 | 3 | /* This is a standard include file for MIPS targets. Other target 4 | probably don't define it, and attempts to include this file will 5 | fail. */ 6 | 7 | #include 8 | -------------------------------------------------------------------------------- /include/gcc/setjmp.h: -------------------------------------------------------------------------------- 1 | /* 2 | setjmp.h 3 | stubs for future use. 4 | */ 5 | 6 | #ifndef _SETJMP_H_ 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | #define _SETJMP_H_ 11 | 12 | #include "_ansi.h" 13 | #include 14 | 15 | void _EXFUN(longjmp,(jmp_buf __jmpb, int __retval)); 16 | int _EXFUN(setjmp,(jmp_buf __jmpb)); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | #endif /* _SETJMP_H_ */ 22 | 23 | -------------------------------------------------------------------------------- /include/gcc/signal.h: -------------------------------------------------------------------------------- 1 | #ifndef _SIGNAL_H_ 2 | #ifdef __cplusplus 3 | extern "C" { 4 | #endif 5 | #define _SIGNAL_H_ 6 | 7 | #include "_ansi.h" 8 | #include 9 | 10 | typedef int sig_atomic_t; /* Atomic entity type (ANSI) */ 11 | 12 | #define SIG_DFL ((void (*)(int))0) /* Default action */ 13 | #define SIG_IGN ((void (*)(int))1) /* Ignore action */ 14 | #define SIG_ERR ((void (*)(int))-1) /* Error return */ 15 | 16 | typedef void (*_sig_func_ptr) (int); 17 | 18 | struct _reent; 19 | 20 | _sig_func_ptr _EXFUN(_signal_r, (struct _reent *, int, _sig_func_ptr)); 21 | int _EXFUN(_raise_r, (struct _reent *, int)); 22 | 23 | #ifndef _REENT_ONLY 24 | _sig_func_ptr _EXFUN(signal, (int, _sig_func_ptr)); 25 | int _EXFUN(raise, (int)); 26 | #endif 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | #endif /* _SIGNAL_H_ */ 32 | -------------------------------------------------------------------------------- /include/gcc/string.h: -------------------------------------------------------------------------------- 1 | /* 2 | * string.h 3 | * 4 | * Definitions for memory and string functions. 5 | */ 6 | 7 | #ifndef _STRING_H_ 8 | #define _STRING_H_ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "_ansi.h" 15 | #include 16 | 17 | #define __need_size_t 18 | #include 19 | 20 | #ifndef NULL 21 | #define NULL 0L 22 | #endif 23 | 24 | _PTR _EXFUN(memchr,(const _PTR, int, size_t)); 25 | int _EXFUN(memcmp,(const _PTR, const _PTR, size_t)); 26 | _PTR _EXFUN(memcpy,(_PTR, const _PTR, size_t)); 27 | _PTR _EXFUN(memmove,(_PTR, const _PTR, size_t)); 28 | _PTR _EXFUN(memset,(_PTR, int, size_t)); 29 | char *_EXFUN(strcat,(char *, const char *)); 30 | char *_EXFUN(strchr,(const char *, int)); 31 | int _EXFUN(strcmp,(const char *, const char *)); 32 | int _EXFUN(strcoll,(const char *, const char *)); 33 | char *_EXFUN(strcpy,(char *, const char *)); 34 | size_t _EXFUN(strcspn,(const char *, const char *)); 35 | char *_EXFUN(strerror,(int)); 36 | size_t _EXFUN(strlen,(const char *)); 37 | char *_EXFUN(strncat,(char *, const char *, size_t)); 38 | int _EXFUN(strncmp,(const char *, const char *, size_t)); 39 | char *_EXFUN(strncpy,(char *, const char *, size_t)); 40 | char *_EXFUN(strpbrk,(const char *, const char *)); 41 | char *_EXFUN(strrchr,(const char *, int)); 42 | size_t _EXFUN(strspn,(const char *, const char *)); 43 | char *_EXFUN(strstr,(const char *, const char *)); 44 | 45 | #ifndef _REENT_ONLY 46 | char *_EXFUN(strtok,(char *, const char *)); 47 | #endif 48 | 49 | size_t _EXFUN(strxfrm,(char *, const char *, size_t)); 50 | 51 | #ifndef __STRICT_ANSI__ 52 | char *_EXFUN(strtok_r,(char *, const char *, char **)); 53 | 54 | int _EXFUN(bcmp,(const char *, const char *, size_t)); 55 | void _EXFUN(bcopy,(const char *, char *, size_t)); 56 | void _EXFUN(bzero,(char *, size_t)); 57 | int _EXFUN(ffs,(int)); 58 | char *_EXFUN(index,(const char *, int)); 59 | _PTR _EXFUN(memccpy,(_PTR, const _PTR, int, size_t)); 60 | char *_EXFUN(rindex,(const char *, int)); 61 | int _EXFUN(strcasecmp,(const char *, const char *)); 62 | char *_EXFUN(strdup,(const char *)); 63 | char *_EXFUN(_strdup_r,(struct _reent *, const char *)); 64 | int _EXFUN(strncasecmp,(const char *, const char *, size_t)); 65 | char *_EXFUN(strsep,(char **, const char *)); 66 | char *_EXFUN(strlwr,(char *)); 67 | char *_EXFUN(strupr,(char *)); 68 | #ifdef __CYGWIN32__ 69 | char *_EXFUN(strsignal, (int __signo)); 70 | int _EXFUN(strtosigno, (const char *__name)); 71 | #endif 72 | 73 | /* These function names are used on Windows and perhaps other systems. */ 74 | #ifndef strcmpi 75 | #define strcmpi strcasecmp 76 | #endif 77 | #ifndef stricmp 78 | #define stricmp strcasecmp 79 | #endif 80 | #ifndef strncmpi 81 | #define strncmpi strncasecmp 82 | #endif 83 | #ifndef strnicmp 84 | #define strnicmp strncasecmp 85 | #endif 86 | 87 | #endif /* ! __STRICT_ANSI__ */ 88 | 89 | #ifdef __cplusplus 90 | } 91 | #endif 92 | #endif /* _STRING_H_ */ 93 | -------------------------------------------------------------------------------- /include/gcc/sys/_types.h: -------------------------------------------------------------------------------- 1 | /* ANSI C namespace clean utility typedefs */ 2 | 3 | /* This file defines various typedefs needed by the system calls that support 4 | the C library. Basically, they're just the POSIX versions with an '_' 5 | prepended. This file lives in the `sys' directory so targets can provide 6 | their own if desired (or they can put target dependant conditionals here). 7 | */ 8 | 9 | #ifndef _SYS__TYPES_H 10 | #define _SYS__TYPES_H 11 | 12 | typedef long _off_t; 13 | typedef long _ssize_t; 14 | 15 | #endif /* _SYS__TYPES_H */ 16 | -------------------------------------------------------------------------------- /include/gcc/sys/config.h: -------------------------------------------------------------------------------- 1 | #ifndef __SYS_CONFIG_H__ 2 | #define __SYS_CONFIG_H__ 3 | 4 | /* exceptions first */ 5 | /* ??? Why is much of this stuff duplicated with machine/ieeefp.h? */ 6 | #if defined(__H8300__) || defined(__H8500__) || defined (__H8300H__) || defined(__W65__) || defined (__H8300S__) 7 | #define _FLOAT_ARG float 8 | #define __SMALL_BITFIELDS 9 | #define _DOUBLE_IS_32BITS 10 | #define __IEEE_BIG_ENDIAN 11 | /* ??? This conditional is true for the h8500 and the w65, defining H8300 12 | in those cases probably isn't the right thing to do. */ 13 | #define H8300 1 14 | #endif 15 | 16 | #ifdef __W65__ 17 | #define _DOUBLE_IS_32BITS 18 | #define __SMALL_BITFIELDS 19 | #define __IEEE_BIG_ENDIAN 20 | #undef INT_MAX 21 | #undef UINT_MAX 22 | #define INT_MAX 32767 23 | #define UINT_MAX 65535 24 | 25 | #endif 26 | 27 | /* 16 bit integer machines */ 28 | #if defined(__Z8001__) || defined(__Z8002__) || defined(__H8300__) || defined(__H8500__) || defined(__W65__) || defined (__H8300H__) || defined (__H8300S__) || defined (__mn10200__) 29 | 30 | #undef INT_MAX 31 | #undef UINT_MAX 32 | #define INT_MAX 32767 33 | #define UINT_MAX 65535 34 | #endif 35 | 36 | #if defined(__D10V__) 37 | #undef INT_MAX 38 | #undef UINT_MAX 39 | #define INT_MAX __INT_MAX__ 40 | #define UINT_MAX (__INT_MAX__ * 2U + 1) 41 | #define _DOUBLE_IS_32BITS 42 | #define _POINTER_INT short 43 | #define __IEEE_BIG_ENDIAN 44 | #endif 45 | 46 | #ifdef ___AM29K__ 47 | #define _FLOAT_RET double 48 | #endif 49 | 50 | #ifdef __i386__ 51 | #ifndef __unix__ 52 | /* in other words, go32 */ 53 | #define _FLOAT_RET double 54 | #endif 55 | #endif 56 | 57 | #ifdef __M32R__ 58 | #define __IEEE_BIG_ENDIAN 59 | #endif 60 | 61 | #ifdef __m68k__ 62 | /* This is defined in machine/ieeefp.h; need to check is it redundant here? */ 63 | #define __IEEE_BIG_ENDIAN 64 | #endif 65 | 66 | #ifdef __mn10300__ 67 | #define __IEEE_LITTLE_ENDIAN 68 | #endif 69 | 70 | #ifdef __mn10200__ 71 | #define _DOUBLE_IS_32BITS 72 | #define __SMALL_BITFIELDS 73 | #define __IEEE_LITTLE_ENDIAN 74 | #endif 75 | 76 | #ifdef __TIC80__ 77 | #define __IEEE_LITTLE_ENDIAN 78 | #endif 79 | 80 | #ifdef __v850 81 | #define __IEEE_LITTLE_ENDIAN 82 | #define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__sda__)) 83 | #endif 84 | 85 | #ifdef __D30V__ 86 | #define __IEEE_BIG_ENDIAN 87 | #endif 88 | 89 | /* For the PowerPC eabi, force the _impure_ptr to be in .sdata */ 90 | #if defined(__PPC__) && defined(_CALL_SYSV) 91 | #define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata"))) 92 | #endif 93 | 94 | #ifdef __sparc__ 95 | #ifdef __LITTLE_ENDIAN_DATA__ 96 | #define __IEEE_LITTLE_ENDIAN 97 | #else 98 | #define __IEEE_BIG_ENDIAN 99 | #endif 100 | #endif 101 | 102 | #if INT_MAX == 32767 103 | typedef long int __int32_t; 104 | typedef unsigned long int __uint32_t; 105 | #else 106 | typedef int __int32_t; 107 | typedef unsigned int __uint32_t; 108 | #endif 109 | 110 | #ifndef _POINTER_INT 111 | #define _POINTER_INT long 112 | #endif 113 | 114 | #ifdef __R5900__ 115 | /* The malloc package we currently use has problems if size_t 116 | is smaller than a long. This flag alerts the code. */ 117 | #define SIZE_T_SMALLER_THAN_LONG 118 | #endif 119 | #endif /* __SYS_CONFIG_H__ */ 120 | -------------------------------------------------------------------------------- /include/gcc/sys/dirent.h: -------------------------------------------------------------------------------- 1 | /* includes , which is this file. On a 2 | system which supports , this file is overridden by 3 | dirent.h in the libc/sys/.../sys directory. On a system which does 4 | not support , we will get this file which tries to find 5 | any other which may be lurking around. If there isn't 6 | one, the user will get an error indicating that there is no 7 | . */ 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | #include_next 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | -------------------------------------------------------------------------------- /include/gcc/sys/file.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | -------------------------------------------------------------------------------- /include/gcc/sys/param.h: -------------------------------------------------------------------------------- 1 | /* This is a dummy file, not customized for any 2 | particular system. If there is a param.h in libc/sys/SYSDIR/sys, 3 | it will override this one. */ 4 | 5 | #ifndef _SYS_PARAM_H 6 | # define _SYS_PARAM_H 7 | 8 | # define HZ (60) 9 | # define NOFILE (60) 10 | # define PATHSIZE (1024) 11 | 12 | #ifdef __i386__ 13 | #define BIG_ENDIAN 4321 14 | #define LITTLE_ENDIAN 1234 15 | #define BYTE_ORDER LITTLE_ENDIAN 16 | #endif 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /include/gcc/sys/resource.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_RESOURCE_H_ 2 | #define _SYS_RESOURCE_H_ 3 | 4 | #include 5 | 6 | #define RUSAGE_SELF 0 /* calling process */ 7 | #define RUSAGE_CHILDREN -1 /* terminated child processes */ 8 | 9 | struct rusage { 10 | struct timeval ru_utime; /* user time used */ 11 | struct timeval ru_stime; /* system time used */ 12 | }; 13 | 14 | #endif 15 | 16 | -------------------------------------------------------------------------------- /include/gcc/sys/stat-dj.h: -------------------------------------------------------------------------------- 1 | /* This is file STAT.H */ 2 | /* 3 | ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 4 | ** 5 | ** This file is distributed under the terms listed in the document 6 | ** "copying.dj", available from DJ Delorie at the address above. 7 | ** A copy of "copying.dj" should accompany this file; if not, a copy 8 | ** should be available from where this file was obtained. This file 9 | ** may not be distributed without a verbatim copy of "copying.dj". 10 | ** 11 | ** This file is distributed WITHOUT ANY WARRANTY; without even the implied 12 | ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 | */ 14 | 15 | #ifndef _STAT_H_ 16 | #define _STAT_H_ 17 | 18 | struct stat { 19 | short st_dev; 20 | short st_ino; 21 | unsigned short st_mode; 22 | short st_nlink; 23 | short st_uid; 24 | short st_gid; 25 | short st_rdev; 26 | short st_align_for_word32; 27 | long st_size; 28 | long st_atime; 29 | long st_mtime; 30 | long st_ctime; 31 | long st_blksize; 32 | }; 33 | 34 | #define S_IFMT 0xF000 /* file type mask */ 35 | #define S_IFDIR 0x4000 /* directory */ 36 | #define S_IFIFO 0x1000 /* FIFO special */ 37 | #define S_IFCHR 0x2000 /* character special */ 38 | #define S_IFBLK 0x3000 /* block special */ 39 | #define S_IFREG 0x8000 /* or just 0x0000, regular */ 40 | #define S_IREAD 0x0100 /* owner may read */ 41 | #define S_IWRITE 0x0080 /* owner may write */ 42 | #define S_IEXEC 0x0040 /* owner may execute */ 43 | 44 | #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) 45 | #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) 46 | #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) 47 | #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) 48 | #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) 49 | 50 | #ifdef __cplusplus 51 | extern "C" { 52 | #endif 53 | int stat(const char *, struct stat *); 54 | int fstat(int, struct stat *); 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /include/gcc/sys/time.h: -------------------------------------------------------------------------------- 1 | /* time.h -- An implementation of the standard Unix file. 2 | Written by Geoffrey Noer 3 | Public domain; no rights reserved. */ 4 | 5 | #ifndef _SYS_TIME_H_ 6 | #define _SYS_TIME_H_ 7 | 8 | #include <_ansi.h> 9 | #include 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | #ifndef _WINSOCK_H 16 | struct timeval { 17 | long tv_sec; 18 | long tv_usec; 19 | }; 20 | 21 | struct timezone { 22 | int tz_minuteswest; 23 | int tz_dsttime; 24 | }; 25 | 26 | #ifdef __CYGWIN32__ 27 | #include 28 | #endif /* __CYGWIN32__ */ 29 | 30 | #endif /* _WINSOCK_H */ 31 | 32 | #define ITIMER_REAL 0 33 | #define ITIMER_VIRTUAL 1 34 | #define ITIMER_PROF 2 35 | 36 | struct itimerval { 37 | struct timeval it_interval; 38 | struct timeval it_value; 39 | }; 40 | 41 | int _EXFUN(gettimeofday, (struct timeval *__p, struct timezone *__z)); 42 | int _EXFUN(settimeofday, (const struct timeval *, const struct timezone *)); 43 | int _EXFUN(utimes, (const char *__path, struct timeval *__tvp)); 44 | int _EXFUN(getitimer, (int __which, struct itimerval *__value)); 45 | int _EXFUN(setitimer, (int __which, const struct itimerval *__value, 46 | struct itimerval *__ovalue)); 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | #endif /* _SYS_TIME_H_ */ 52 | -------------------------------------------------------------------------------- /include/gcc/sys/timeb.h: -------------------------------------------------------------------------------- 1 | /* timeb.h -- An implementation of the standard Unix file. 2 | Written by Ian Lance Taylor 3 | Public domain; no rights reserved. 4 | 5 | declares the structure used by the ftime function, as 6 | well as the ftime function itself. Newlib does not provide an 7 | implementation of ftime. */ 8 | 9 | #ifndef _SYS_TIMEB_H 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | #define _SYS_TIMEB_H 16 | 17 | #include <_ansi.h> 18 | #include 19 | 20 | #ifndef __time_t_defined 21 | typedef _TIME_T_ time_t; 22 | #define __time_t_defined 23 | #endif 24 | 25 | struct timeb 26 | { 27 | time_t time; 28 | unsigned short millitm; 29 | short timezone; 30 | short dstflag; 31 | }; 32 | 33 | extern int ftime _PARAMS ((struct timeb *)); 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif /* ! defined (_SYS_TIMEB_H) */ 40 | -------------------------------------------------------------------------------- /include/gcc/sys/times.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_TIMES_H 2 | #ifdef __cplusplus 3 | extern "C" { 4 | #endif 5 | #define _SYS_TIMES_H 6 | 7 | #include <_ansi.h> 8 | #include 9 | 10 | #ifndef __clock_t_defined 11 | typedef _CLOCK_T_ clock_t; 12 | #define __clock_t_defined 13 | #endif 14 | 15 | struct tms { 16 | clock_t tms_utime; /* user time */ 17 | clock_t tms_stime; /* system time */ 18 | clock_t tms_cutime; /* user time, children */ 19 | clock_t tms_cstime; /* system time, children */ 20 | }; 21 | 22 | clock_t _EXFUN(times,(struct tms *)); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif /* !_SYS_TIMES_H */ 28 | -------------------------------------------------------------------------------- /include/gcc/sys/utime.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_UTIME_H 2 | #define _SYS_UTIME_H 3 | 4 | /* This is a dummy file, not customized for any 5 | particular system. If there is a utime.h in libc/sys/SYSDIR/sys, 6 | it will override this one. */ 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | struct utimbuf 13 | { 14 | time_t actime; 15 | time_t modtime; 16 | }; 17 | 18 | #ifdef __cplusplus 19 | }; 20 | #endif 21 | 22 | #endif /* _SYS_UTIME_H */ 23 | -------------------------------------------------------------------------------- /include/gcc/sys/wait.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_WAIT_H 2 | #define _SYS_WAIT_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | #define WNOHANG 1 11 | #define WUNTRACED 2 12 | 13 | /* A status looks like: 14 | <2 bytes info> <2 bytes code> 15 | 16 | == 0, child has exited, info is the exit value 17 | == 1..7e, child has exited, info is the signal number. 18 | == 7f, child has stopped, info was the signal number. 19 | == 80, there was a core dump. 20 | */ 21 | 22 | #define WIFEXITED(w) (((w) & 0xff) == 0) 23 | #define WIFSIGNALED(w) (((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f)) 24 | #define WIFSTOPPED(w) (((w) & 0xff) == 0x7f) 25 | #define WEXITSTATUS(w) (((w) >> 8) & 0xff) 26 | #define WTERMSIG(w) ((w) & 0x7f) 27 | #define WSTOPSIG WEXITSTATUS 28 | 29 | pid_t wait (int *); 30 | pid_t waitpid (pid_t, int *, int); 31 | 32 | /* Provide prototypes for most of the _ names that are 33 | provided in newlib for some compilers. */ 34 | pid_t _wait (int *); 35 | 36 | #ifdef __cplusplus 37 | }; 38 | #endif 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /include/gcc/termios.h: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | extern "C" { 3 | #endif 4 | #include 5 | #ifdef __cplusplus 6 | } 7 | #endif 8 | -------------------------------------------------------------------------------- /include/gcc/time.h: -------------------------------------------------------------------------------- 1 | /* 2 | * time.h 3 | * 4 | * Struct and function declarations for dealing with time. 5 | */ 6 | 7 | #ifndef _TIME_H_ 8 | #define _TIME_H_ 9 | 10 | #include "_ansi.h" 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | #ifndef NULL 17 | #define NULL 0L 18 | #endif 19 | 20 | /* Get _CLOCKS_PER_SEC_ */ 21 | #include 22 | 23 | #ifndef _CLOCKS_PER_SEC_ 24 | #define _CLOCKS_PER_SEC_ 1000 25 | #endif 26 | 27 | #define CLOCKS_PER_SEC _CLOCKS_PER_SEC_ 28 | #define CLK_TCK CLOCKS_PER_SEC 29 | #define __need_size_t 30 | #include 31 | 32 | /* Get _CLOCK_T_ and _TIME_T_. */ 33 | #include 34 | 35 | #ifndef __clock_t_defined 36 | typedef _CLOCK_T_ clock_t; 37 | #define __clock_t_defined 38 | #endif 39 | 40 | #ifndef __time_t_defined 41 | typedef _TIME_T_ time_t; 42 | #define __time_t_defined 43 | #endif 44 | 45 | struct tm 46 | { 47 | int tm_sec; 48 | int tm_min; 49 | int tm_hour; 50 | int tm_mday; 51 | int tm_mon; 52 | int tm_year; 53 | int tm_wday; 54 | int tm_yday; 55 | int tm_isdst; 56 | }; 57 | 58 | clock_t _EXFUN(clock, (void)); 59 | double _EXFUN(difftime, (time_t _time2, time_t _time1)); 60 | time_t _EXFUN(mktime, (struct tm *_timeptr)); 61 | time_t _EXFUN(time, (time_t *_timer)); 62 | #ifndef _REENT_ONLY 63 | char *_EXFUN(asctime, (const struct tm *_tblock)); 64 | char *_EXFUN(ctime, (const time_t *_time)); 65 | struct tm *_EXFUN(gmtime, (const time_t *_timer)); 66 | struct tm *_EXFUN(localtime,(const time_t *_timer)); 67 | #endif 68 | size_t _EXFUN(strftime, (char *_s, size_t _maxsize, const char *_fmt, const struct tm *_t)); 69 | 70 | char *_EXFUN(asctime_r, (const struct tm *, char *)); 71 | char *_EXFUN(ctime_r, (const time_t *, char *)); 72 | struct tm *_EXFUN(gmtime_r, (const time_t *, struct tm *)); 73 | struct tm *_EXFUN(localtime_r, (const time_t *, struct tm *)); 74 | 75 | #ifdef __CYGWIN32__ 76 | #ifndef __STRICT_ANSI__ 77 | extern time_t _timezone __declspec(dllimport); 78 | extern int _daylight __declspec(dllimport); 79 | extern char *_tzname[2] __declspec(dllimport); 80 | 81 | char *_EXFUN(timezone, (void)); 82 | void _EXFUN(tzset, (void)); 83 | #endif 84 | #endif /* __CYGWIN32__ */ 85 | 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | #endif /* _TIME_H_ */ 90 | 91 | -------------------------------------------------------------------------------- /include/gcc/unctrl.h: -------------------------------------------------------------------------------- 1 | /* From curses.h. */ 2 | /* 3 | * Copyright (c) 1981, 1993 4 | * The Regents of the University of California. All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 3. All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed by the University of 17 | * California, Berkeley and its contributors. 18 | * 4. Neither the name of the University nor the names of its contributors 19 | * may be used to endorse or promote products derived from this software 20 | * without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 | * SUCH DAMAGE. 33 | */ 34 | 35 | #ifndef _UNCTRL_H_ 36 | #define _UNCTRL_H_ 37 | 38 | #include <_ansi.h> 39 | 40 | #define unctrl(c) __unctrl[(c) & 0xff] 41 | #define unctrllen(ch) __unctrllen[(ch) & 0xff] 42 | 43 | extern _CONST char * _CONST __unctrl[256]; /* Control strings. */ 44 | extern _CONST char __unctrllen[256]; /* Control strings length. */ 45 | 46 | #endif /* _UNCTRL_H_ */ 47 | -------------------------------------------------------------------------------- /include/gcc/unistd.h: -------------------------------------------------------------------------------- 1 | #ifndef _UNISTD_H_ 2 | #define _UNISTD_H_ 3 | 4 | # include 5 | 6 | #endif /* _UNISTD_H_ */ 7 | -------------------------------------------------------------------------------- /include/gcc/utime.h: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | extern "C" { 3 | #endif 4 | 5 | /* The utime function is defined in libc/sys//sys if it exists. */ 6 | #include 7 | 8 | #ifdef __cplusplus 9 | } 10 | #endif 11 | -------------------------------------------------------------------------------- /include/gcc/utmp.h: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | extern "C" { 3 | #endif 4 | #include 5 | #ifdef __cplusplus 6 | } 7 | #endif 8 | 9 | -------------------------------------------------------------------------------- /include/include_asm.h: -------------------------------------------------------------------------------- 1 | #ifndef INCLUDE_ASM_H 2 | #define INCLUDE_ASM_H 3 | 4 | #if !defined(SPLAT) && !defined(M2CTX) && !defined(PERMUTER) 5 | #ifndef INCLUDE_ASM 6 | #define INCLUDE_ASM(FOLDER, NAME) \ 7 | __asm__( \ 8 | ".section .text\n" \ 9 | " .set noat\n" \ 10 | " .set noreorder\n" \ 11 | " .globl\t" #NAME ".NON_MATCHING\n" \ 12 | " .ent\t" #NAME "\n" #NAME ".NON_MATCHING:\n" \ 13 | " .include \"asm/nonmatchings/" FOLDER "/" #NAME ".s\"\n" \ 14 | " .set reorder\n" \ 15 | " .set at\n" \ 16 | " .end\t" #NAME \ 17 | ); 18 | #endif 19 | #ifndef INCLUDE_RODATA 20 | #define INCLUDE_RODATA(FOLDER, NAME) \ 21 | __asm__( \ 22 | ".section .rodata\n" \ 23 | " .include \"asm/nonmatchings/" FOLDER "/" #NAME ".s\"\n" \ 24 | ".section .text" \ 25 | ) 26 | #endif 27 | __asm__(".include \"include/macro.inc\"\n"); 28 | #else 29 | #ifndef INCLUDE_ASM 30 | #define INCLUDE_ASM(FOLDER, NAME) 31 | #endif 32 | #ifndef INCLUDE_RODATA 33 | #define INCLUDE_RODATA(FOLDER, NAME) 34 | #endif 35 | #endif 36 | 37 | #endif /* INCLUDE_ASM_H */ -------------------------------------------------------------------------------- /include/iop_mdl/tapctrl_rpc.h: -------------------------------------------------------------------------------- 1 | #ifndef TAPCTRL_RPC_H 2 | #define TAPCTRL_RPC_H 3 | 4 | #include "common.h" 5 | 6 | #include 7 | #include 8 | 9 | int TapCtInit(void); 10 | int TapCt(int command, int data1, int data2); 11 | 12 | #endif -------------------------------------------------------------------------------- /include/iop_mdl/wp2cd_rpc.h: -------------------------------------------------------------------------------- 1 | #ifndef WP2CD_RPC_H 2 | #define WP2CD_RPC_H 3 | 4 | #include "common.h" 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | // WP2 commands 15 | #define WP2_NONE (0) 16 | 17 | #define WP2_QUIT 0x0001 /* No args */ 18 | #define WP2_CLOSE 0x0003 /* No args */ 19 | #define WP2_PRELOAD 0x0004 /* No args */ 20 | #define WP2_STOP 0x0006 /* No args */ 21 | #define WP2_SETVOLDIRECT 0x0009 /* Arg -> Direct volume */ 22 | #define WP2_SETMASTERVOL 0x000a /* Arg -> Master volume */ 23 | #define WP2_SDINIT 0x000d /* Arg -> Status */ 24 | #define WP2_INIT 0x000e /* Arg -> Mode */ 25 | #define WP2_SETCHANNEL 0x000f /* Arg -> Channels */ 26 | #define WP2_PRELOADBACK 0x0015 /* No args */ 27 | #define WP2_BGMSETTRPOINT 0x0016 /* Arg -> Transfer pos */ 28 | #define WP2_BGMINIT 0x8000 /* Arg -> Block size */ 29 | #define WP2_START 0x8005 /* Arg -> Seek position */ 30 | #define WP2_SEEK 0x8007 /* No args */ 31 | #define WP2_GETMODE 0x800b /* No args */ 32 | #define WP2_SETMODE 0x800c /* Arg -> Mode */ 33 | #define WP2_GETTIME 0x8010 /* No args */ 34 | #define WP2_GETTIMESAMPLE 0x8011 /* No args */ 35 | #define WP2_OPENFLOC 0x8013 /* Arg -> File name */ 36 | #define WP2_SEEKFLOC 0x8014 /* Arg -> File name */ 37 | #define WP2_READBUF 0x8017 /* No args */ 38 | 39 | /* WP2 modes */ 40 | /* Set */ 41 | #define WP2_MODE_REPEAT_OFF 0x0000 42 | #define WP2_MODE_REPEAT_DEFAULT 0x0001 43 | #define WP2_MODE_REPEAT_FORCED 0x0002 44 | 45 | #define WP2_MODE_STEREO 0x0000 46 | #define WP2_MODE_MONO 0x0010 47 | 48 | /* Get */ 49 | #define WP2_MODE_IDLE 0x0000 50 | #define WP2_MODE_RUNNING 0x1000 51 | #define WP2_MODE_PAUSE 0x2000 52 | #define WP2_MODE_FADE 0x4000 53 | #define WP2_MODE_TERMINATE 0x8000 54 | 55 | /* WaveP2 module ID */ 56 | #define WP2_DEV (0x8800) 57 | 58 | int WP2Init(void); 59 | int WP2Ctrl(int command, int data0); 60 | 61 | #endif -------------------------------------------------------------------------------- /include/macro.inc: -------------------------------------------------------------------------------- 1 | .macro glabel label 2 | .global \label 3 | .type \label, @function 4 | \label: 5 | .endm 6 | 7 | .macro dlabel label 8 | .global \label 9 | \label: 10 | .endm 11 | -------------------------------------------------------------------------------- /include/main/cmnfile.h: -------------------------------------------------------------------------------- 1 | #ifndef CMNFILE_H 2 | #define CMNFILE_H 3 | 4 | #include "common.h" 5 | 6 | #include "os/tim2.h" 7 | 8 | #include 9 | 10 | typedef enum 11 | { 12 | CMN_NONE = 0, // None 13 | CMN_VRAM = 1, // TIM2 textures 14 | CMN_SND = 2, // Sounds 15 | CMN_ONMEM = 3, // Models, animations, etc. to store in the memory pool 16 | CMN_MAX = 4 // N/A 17 | } CMN_FILE_TYPE_ENUM; 18 | 19 | typedef struct { // 0x10 20 | /* 0x0 */ int fnum; 21 | /* 0x4 */ int ftype; 22 | /* 0x8 */ int f_size; 23 | /* 0xc */ int pad; 24 | /* 0x10 */ int adr[0]; 25 | } CMN_FILE_STR; 26 | 27 | int cmnfTim2Trans(void); 28 | void* cmnfGetFileAdrs(int num); 29 | int cmnfGetFileSize(int num); 30 | 31 | #endif -------------------------------------------------------------------------------- /include/main/commake.h: -------------------------------------------------------------------------------- 1 | #ifndef COMMAKE_H 2 | #define COMMAKE_H 3 | 4 | #include "common.h" 5 | 6 | #include 7 | 8 | typedef struct { // 0x4 9 | /* 0x0 */ u_short keyId; 10 | /* 0x2 */ short int timeOfs; 11 | } CM_STR; 12 | 13 | typedef struct { // 0x1c4 14 | /* 0x000 */ CM_STR cm_str_mt[32]; 15 | /* 0x080 */ CM_STR cm_str_now[32]; 16 | /* 0x100 */ CM_STR cm_str_make[32]; 17 | /* 0x180 */ int keyKind; 18 | /* 0x184 */ int keyKindNum; 19 | /* 0x188 */ int keyCnt_mt[7]; 20 | /* 0x1a4 */ int keyCnt_now[7]; 21 | /* 0x1c0 */ int maxBox; 22 | } CM_STR_CTRL; 23 | 24 | #endif -------------------------------------------------------------------------------- /include/main/effect.h: -------------------------------------------------------------------------------- 1 | #ifndef EFFECT_H 2 | #define EFFECT_H 3 | 4 | #include "common.h" 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "os/cmngifpk.h" 12 | 13 | #include 14 | 15 | typedef enum { 16 | WM_WSLICE = 0, 17 | WM_HSLICE = 1, 18 | WM_MAX = 2 19 | } WMODE_ENUM; 20 | 21 | typedef struct { // 0x2c 22 | /* 0x00 */ int wmode; 23 | /* 0x04 */ int linecnt; 24 | /* 0x08 */ short x; 25 | /* 0x0a */ short y; 26 | /* 0x0c */ short sizeW; 27 | /* 0x0e */ short sizeH; 28 | /* 0x10 */ short addW; 29 | /* 0x12 */ short addH; 30 | /* 0x14 */ short u; 31 | /* 0x16 */ short v; 32 | /* 0x18 */ short addU; 33 | /* 0x1a */ short addV; 34 | /* 0x1c */ float mvSize; 35 | /* 0x20 */ float plsAng1line; 36 | /* 0x24 */ float plsAng1time; 37 | /* 0x28 */ float currentAng; 38 | } WAVE_STR; 39 | 40 | typedef struct { // 0x8 41 | /* 0x0 */ float ofs0; 42 | /* 0x4 */ float ofs1; 43 | } PLP_OFS; 44 | 45 | typedef struct { // 0x48 46 | /* 0x00 */ u_char r; 47 | /* 0x01 */ u_char g; 48 | /* 0x02 */ u_char b; 49 | /* 0x03 */ u_char a; 50 | /* 0x04 */ u_char alp; 51 | /* 0x08 */ PLP_OFS xyOfs[4]; 52 | /* 0x28 */ PLP_OFS uvOfs[4]; 53 | } PLH_STR; 54 | 55 | typedef struct { // 0x10 56 | /* 0x0 */ int umsk; 57 | /* 0x4 */ int ufix; 58 | /* 0x8 */ int vmsk; 59 | /* 0xc */ int vfix; 60 | } MOZAIKU_STR; 61 | 62 | typedef struct { // 0x4 63 | /* 0x0 */ u_char r; 64 | /* 0x1 */ u_char g; 65 | /* 0x2 */ u_char b; 66 | /* 0x3 */ u_char alp; 67 | } FADE_MAKE_STR; 68 | 69 | typedef struct { // 0x24 70 | /* 0x00 */ int cntW; 71 | /* 0x04 */ int cntH; 72 | /* 0x08 */ int cnterW; 73 | /* 0x0c */ int cnterH; 74 | /* 0x10 */ float time_lng; 75 | /* 0x14 */ float cycle_lng; 76 | /* 0x18 */ float cycle_w; 77 | /* 0x1c */ u_char r; 78 | /* 0x1d */ u_char g; 79 | /* 0x1e */ u_char b; 80 | /* 0x1f */ u_char a; 81 | /* 0x20 */ int texnum; 82 | } NOODLES_STR; 83 | 84 | typedef struct { // 0x3 85 | /* 0x0 */ u_char pR; 86 | /* 0x1 */ u_char pG; 87 | /* 0x2 */ u_char pB; 88 | } MONOCRO_STR; 89 | 90 | void CG_FadeDisp(FADE_MAKE_STR *fade_pp, int pri, sceGsFrame *texFr_pp); 91 | void UG_MozaikuDisp(MOZAIKU_STR *moz_pp, sceGsFrame *frame_pp, sceGifPacket *mozPkSpr); 92 | 93 | #endif -------------------------------------------------------------------------------- /include/main/fadectrl.h: -------------------------------------------------------------------------------- 1 | #ifndef FADECTRL_H 2 | #define FADECTRL_H 3 | 4 | #include "common.h" 5 | 6 | #include 7 | #include 8 | 9 | #include "os/mtc.h" 10 | #include "main/effect.h" 11 | 12 | typedef enum { 13 | FMODE_BLACK_IN = 0, 14 | FMODE_BLACK_OUT = 256, 15 | FMODE_WHITE_IN = 1, 16 | FMODE_WHITE_OUT = 257 17 | } FADE_MODE; 18 | 19 | typedef struct { // 0xc 20 | /* 0x0 */ FADE_MODE fmode; 21 | /* 0x4 */ int max_time; 22 | /* 0x8 */ int current_time; 23 | } FMODE_CTRL_STR; 24 | 25 | void FadeCtrlMain(void *x); 26 | void FadeCtrlReq(FADE_MODE fmode, int time); 27 | 28 | #endif -------------------------------------------------------------------------------- /include/main/main.h: -------------------------------------------------------------------------------- 1 | #ifndef MAIN_H 2 | #define MAIN_H 3 | 4 | #include "common.h" 5 | 6 | #include "main/etc.h" 7 | #include "main/mcctrl.h" 8 | 9 | #include "menu/menu.h" 10 | 11 | #include 12 | 13 | enum 14 | { 15 | dmyPmTitle = 0, 16 | dmyPmREPLAY = 1, 17 | dmyPmSINGLE = 2, 18 | dmyPmVS_MAN = 3, 19 | dmyPmVS_COM = 4 20 | }; 21 | 22 | typedef struct { // 0x8 23 | /* 0x0 */ int num; 24 | /* 0x4 */ int *data_pp; 25 | } RT2TRANS_STR; 26 | 27 | typedef enum 28 | { 29 | CBE_NORMAL = 0, 30 | CBE_SINGLE = 1, 31 | CBE_VS_MAN = 2, 32 | CBE_VS_COM = 3, 33 | CBE_HOOK = 4, 34 | CBE_MAX = 5 35 | } CANCEL_TYPE_ENUM; 36 | 37 | void mainStart(void* xx); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /include/main/mbar.h: -------------------------------------------------------------------------------- 1 | #ifndef MBAR_H 2 | #define MBAR_H 3 | 4 | #include "common.h" 5 | #include 6 | 7 | #include "main/scrctrl.h" 8 | 9 | typedef enum { 10 | NIKO_KAGE = 0, 11 | NIKO_HALF = 1, 12 | NIKO_MARU = 2, 13 | NIKO_SKIP = 3, 14 | NIKO_MAX = 4 15 | } NIKO_ENUM; 16 | 17 | typedef enum { 18 | MBAR_NONE = 0, 19 | MBAR_TEACHER = 393, 20 | MBAR_PARAPPA = 745, 21 | MBAR_TEACHER_HOOK = 393, 22 | MBAR_PARAPPA_HOOK = 1769, 23 | MBAR_TEACHER_VS = 105, 24 | MBAR_PARAPPA_VS = 553, 25 | MBAR_BOXY_VS = 2089 26 | } MBAR_REQ_ENUM; 27 | 28 | typedef enum { 29 | MBC_NONE = 0, 30 | MBC_OTEHON_TOP = 1, 31 | MBC_TR = 1, 32 | MBC_CI = 2, 33 | MBC_XX = 3, 34 | MBC_SQ = 4, 35 | MBC_LL = 5, 36 | MBC_RR = 6, 37 | MBC_SP = 7, 38 | MBC_OTEHON_M_TOP = 8, 39 | MBC_M_TR = 8, 40 | MBC_M_CI = 9, 41 | MBC_M_XX = 10, 42 | MBC_M_SQ = 11, 43 | MBC_M_LL = 12, 44 | MBC_M_RR = 13, 45 | MBC_M_SP = 14, 46 | MBC_OTEHON_BW_TOP = 15, 47 | MBC_BW_TR = 15, 48 | MBC_BW_CI = 16, 49 | MBC_BW_XX = 17, 50 | MBC_BW_SQ = 18, 51 | MBC_BW_LL = 19, 52 | MBC_BW_RR = 20, 53 | MBC_BW_SP = 21, 54 | MBC_BALL = 22, 55 | MBC_STAR = 23, 56 | MBC_TEA_FACE_TOP = 24, 57 | MBC_NONECUR = 24, 58 | MBC_PARA = 25, 59 | MBC_BOXY = 26, 60 | MBC_STAGE1 = 27, 61 | MBC_STAGE2 = 28, 62 | MBC_STAGE3 = 29, 63 | MBC_STAGE4 = 30, 64 | MBC_STAGE5 = 31, 65 | MBC_STAGE6 = 32, 66 | MBC_STAGE7 = 33, 67 | MBC_STAGE8 = 34, 68 | MBC_FLASH = 35, 69 | MBC_GLINE_P = 36, 70 | MBC_GLINE_T = 37, 71 | MBC_MAX = 38 72 | } MBC_ENUM; 73 | 74 | typedef struct { // 0x38 75 | /* 0x00 */ u_long GsTex0; 76 | /* 0x08 */ u_long GsTex1; 77 | /* 0x10 */ u_int GsRegs; 78 | /* 0x14 */ short x; 79 | /* 0x16 */ short y; 80 | /* 0x18 */ u_short w; 81 | /* 0x1a */ u_short h; 82 | /* 0x1c */ u_short u; 83 | /* 0x1e */ u_short v; 84 | /* 0x20 */ u_short cx; 85 | /* 0x22 */ u_short cy; 86 | /* 0x24 */ u_short alpha; 87 | /* 0x28 */ float scalex; 88 | /* 0x2c */ float scaley; 89 | /* 0x30 */ u_char kido[3]; 90 | } EX_CHAR_DISP; 91 | 92 | typedef struct { // 0x8 93 | /* 0x0 */ u_short xp; 94 | /* 0x2 */ u_short yp; 95 | /* 0x4 */ NIKO_ENUM niko_enum; 96 | } NIKO_CHAN_STR; 97 | 98 | typedef struct { // 0x24 99 | /* 0x00 */ MBAR_REQ_ENUM mbar_req_enum; 100 | /* 0x04 */ TAPSET *tapset_pp; 101 | /* 0x08 */ int current_time; 102 | /* 0x0c */ int scr_tap_memory_cnt; 103 | /* 0x10 */ SCR_TAP_MEMORY *scr_tap_memory_pp; 104 | /* 0x14 */ int lang; 105 | /* 0x18 */ int tapdat_size; 106 | /* 0x1c */ TAPDAT *tapdat_pp; 107 | /* 0x20 */ GUI_CURSOR_ENUM gui_cursor_enum; 108 | } MBAR_REQ_STR; 109 | 110 | typedef struct { // 0x18 111 | /* 0x00 */ MBC_ENUM mbc_enum; 112 | /* 0x04 */ int xp; 113 | /* 0x08 */ int yp; 114 | /* 0x0c */ float sclx; 115 | /* 0x10 */ float scly; 116 | /* 0x14 */ u_char r; 117 | /* 0x15 */ u_char g; 118 | /* 0x16 */ u_char b; 119 | /* 0x17 */ u_char a; 120 | } MBARR_CHR; 121 | 122 | void MbarSetCtrlTime(int mctime); 123 | void MbarReq(MBAR_REQ_ENUM mm_req, TAPSET *ts_pp, int curr_time, SCR_TAP_MEMORY *tm_pp, int tm_cnt, int lang, int tapdat_size, TAPDAT *tapdat_pp, GUI_CURSOR_ENUM guic); 124 | 125 | #endif -------------------------------------------------------------------------------- /include/main/mcctrl.h: -------------------------------------------------------------------------------- 1 | #ifndef MCCTRL_H 2 | #define MCCTRL_H 3 | 4 | #include "common.h" 5 | 6 | #include 7 | 8 | #include "main/etc.h" 9 | 10 | typedef struct { // 0x4 11 | /* 0x0 */ u_int timeP:17; 12 | /* 0x2 */ u_char padId:3; 13 | /* 0x2 */ u_char resT:1; 14 | /* 0x2 */ u_char holdT:1; 15 | /* 0x2 */ u_char ply:2; 16 | /* 0x3 */ u_char useL; 17 | } MC_REP_DAT; 18 | 19 | typedef u_char VSOTHSAVE[32]; 20 | 21 | typedef struct { // 0x10 22 | /* 0x0 */ int now_score; 23 | /* 0x4 */ int exam_score[3]; 24 | } MC_REP_SCR; 25 | 26 | typedef struct { // 0x4528 27 | /* 0x0000 */ PLAY_MODE play_modeS; 28 | /* 0x0004 */ PLAY_TYPE play_typeS; 29 | /* 0x0008 */ TAP_ROUND_ENUM roundS; 30 | /* 0x000c */ PLAY_TABLE_MODE play_table_modeS; 31 | /* 0x0010 */ int play_stageS; 32 | /* 0x0014 */ LEVEL_VS_ENUM level_vs_enumS; 33 | /* 0x0018 */ u_int scoreN_cnt; 34 | /* 0x001c */ MC_REP_SCR mc_rep_scr[256]; 35 | /* 0x101c */ u_int levelN_cnt; 36 | /* 0x1020 */ u_char levelN[128]; 37 | /* 0x10a0 */ u_int mc_rep_dat_cnt; 38 | /* 0x10a4 */ MC_REP_DAT mc_rep_dat[2560]; 39 | /* 0x38a4 */ u_int mc_vsoth_cnt; 40 | /* 0x38a8 */ VSOTHSAVE vsothsave[100]; 41 | } MC_REP_STR; 42 | 43 | typedef struct { // 0x1c 44 | /* 0x00 */ u_int cl_scoreN_cnt; 45 | /* 0x04 */ u_int cl_levelN_cnt; 46 | /* 0x08 */ u_int cl_mc_rep_dat_cnt[4]; 47 | /* 0x18 */ u_int cl_vsoth_cnt; 48 | } MC_REP_CTRL; 49 | 50 | void mccReqLvlSet(u_int lvl); 51 | u_int mccReqLvlGet(void); 52 | 53 | void mccReqVSOTHSAVEset(VSOTHSAVE *sv); 54 | int mccReqVSOTHSAVEget(VSOTHSAVE *sv); 55 | 56 | #endif -------------------------------------------------------------------------------- /include/main/pack.h: -------------------------------------------------------------------------------- 1 | #ifndef PACK_H 2 | #define PACK_H 3 | 4 | #include "common.h" 5 | 6 | #include 7 | 8 | #define PACK(x) ((PACK_STR*)x) 9 | 10 | typedef struct { // 0x10 11 | /* 0x0 */ u_int id; 12 | /* 0x4 */ char version[8]; 13 | /* 0xc */ u_int fcnt; 14 | } PACK_HEADER; 15 | 16 | typedef struct { // 0x30 17 | /* 0x00 */ char fname[40]; 18 | /* 0x28 */ u_int ofs; 19 | /* 0x2c */ u_int size; 20 | } PACK_LIST; 21 | 22 | typedef struct { // 0x10 23 | /* 0x0 */ PACK_HEADER pack_header; 24 | /* 0x10 */ PACK_LIST pack_list[0]; 25 | } PACK_STR; 26 | 27 | #endif -------------------------------------------------------------------------------- /include/main/sprite.h: -------------------------------------------------------------------------------- 1 | #ifndef SPRITE_H 2 | #define SPRITE_H 3 | 4 | #include "common.h" 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #define PR_TEX0(x) (*(sceGsTex0*)&x->GsTex0) 12 | #define PR_TEX1(x) (*(sceGsTex1*)&x->GsTex1) 13 | #define PR_REGS(x) (*(SPR_REGS *)&x->GsRegs) 14 | 15 | typedef struct { // 0x4 16 | /* 0x0 */ u_char r; 17 | /* 0x1 */ u_char g; 18 | /* 0x2 */ u_char b; 19 | /* 0x3 */ u_char a; 20 | } VCLR_PARA; 21 | 22 | typedef struct { // 0xc 23 | /* 0x0 */ u_short u0; 24 | /* 0x2 */ u_short v0; 25 | /* 0x4 */ u_short u1; 26 | /* 0x6 */ u_short v1; 27 | /* 0x8 */ u_short w; 28 | /* 0xa */ u_short h; 29 | } LERO_TIM2_PT; 30 | 31 | enum 32 | { 33 | LERO_ENUM_1 = 0, 34 | LERO_ENUM_2 = 1, 35 | LERO_ENUM_3 = 2, 36 | LERO_ENUM_4 = 3, 37 | LERO_ENUM_5 = 4, 38 | LERO_ENUM_LESSON = 5, 39 | LERO_ENUM_ROUND = 6 40 | }; 41 | 42 | typedef struct { // 0xc 43 | /* 0x0 */ int tim2_num; 44 | /* 0x4 */ int posx; 45 | /* 0x8 */ int posy; 46 | } LERO_POS_STR; 47 | 48 | typedef struct { // 0x20 49 | /* 0x00 */ u_long GsTex0; 50 | /* 0x08 */ u_long GsTex1; 51 | /* 0x10 */ u_int GsRegs; 52 | /* 0x14 */ u_int GsTexClut; 53 | /* 0x18 */ u_short w; 54 | /* 0x1a */ u_short h; 55 | /* 0x1c */ u_short pad[2]; 56 | } TIM2_DAT; 57 | 58 | typedef struct { // 0x18 59 | /* 0x00 */ u_long GsTex0; 60 | /* 0x08 */ u_long GsTex1; 61 | /* 0x10 */ u_int GsRegs; 62 | /* 0x14 */ u_int GsTexClut; 63 | } SPR_DAT; 64 | 65 | typedef struct { // 0x4 66 | /* 0x0 */ u_int ta0:8; 67 | /* 0x1 */ u_int res0:7; 68 | /* 0x1 */ u_int aem:1; 69 | /* 0x2 */ u_int ta1:8; 70 | /* 0x3 */ u_int res1:6; 71 | /* 0x3 */ u_int pabe:1; 72 | /* 0x3 */ u_int fba:1; 73 | } SPR_REGS; 74 | 75 | typedef struct { // 0x10 76 | /* 0x0 */ short x; 77 | /* 0x2 */ short y; 78 | /* 0x4 */ short scalex; 79 | /* 0x6 */ short scaley; 80 | /* 0x8 */ short u; 81 | /* 0xa */ short v; 82 | /* 0xc */ short w; 83 | /* 0xe */ short h; 84 | } SPR_PRIM; 85 | 86 | void SprInit(void); 87 | void SprClear(void); 88 | void SprPackSet(SPR_DAT *spr_pp); 89 | void SprFlash(void); 90 | void SprSetColor(u_char r, u_char g, u_char b, u_char a); 91 | void SprDatPrint(SPR_DAT *spr_pp); 92 | 93 | void SprDisp(SPR_PRIM *prm_pp); 94 | void SprDispAlp(SPR_PRIM *prm_pp); 95 | void SprDispZABnclr(void); 96 | void SprDispZBnclr(void); 97 | void SprDispZcheck(void); 98 | void SprDispAcheck(int flg); 99 | void SprDispAlphaSet(void); 100 | 101 | void SprBox(SPR_PRIM *prm_pp); 102 | void SprWindow(u_int x, u_int y, u_int w, u_int h); 103 | void SprWindowDf(void); 104 | 105 | #endif -------------------------------------------------------------------------------- /include/main/stdat.h: -------------------------------------------------------------------------------- 1 | #ifndef STDAT_H 2 | #define STDAT_H 3 | 4 | #include "common.h" 5 | 6 | #include "main/etc.h" 7 | #include "main/subt.h" 8 | #include "main/cdctrl.h" 9 | #include "main/drawctrl.h" 10 | 11 | struct SCR_MAIN; 12 | 13 | typedef struct { // 0xd0 14 | /* 0x00 */ PLAY_STEP play_step; 15 | /* 0x04 */ char *ply_name; 16 | /* 0x08 */ float tempo; 17 | /* 0x0c */ int stage; 18 | /* 0x10 */ EVENTREC *ev_pp; 19 | /* 0x14 */ struct SCR_MAIN *scr_pp; 20 | /* 0x18 */ JIMAKU_STR *jimaku_str_pp; 21 | /* 0x1c */ FILE_STR intfile; 22 | /* 0x48 */ FILE_STR sndfile[3]; 23 | /* 0xcc */ TAPLVL_STR *taplvl_str_pp; 24 | } STDAT_DAT; 25 | 26 | typedef struct { // 0x38 27 | /* 0x00 */ FILE_STR ovlfile; 28 | /* 0x2c */ int stdat_dat_num; 29 | /* 0x30 */ STDAT_DAT *stdat_dat_pp; 30 | /* 0x34 */ char *strec_name; 31 | } STDAT_REC; 32 | 33 | FILE_STR file_str_logo_file; 34 | FILE_STR file_str_menu_file; 35 | FILE_STR file_str_extra_file[10]; 36 | 37 | STDAT_REC stdat_rec[19]; 38 | 39 | void stDatFirstFileSearch(void); 40 | 41 | #endif -------------------------------------------------------------------------------- /include/main/subt.h: -------------------------------------------------------------------------------- 1 | #ifndef SUBT_H 2 | #define SUBT_H 3 | 4 | #include "common.h" 5 | 6 | #include 7 | 8 | typedef struct { // 0x8 9 | /* 0x0 */ int cnt; 10 | /* 0x4 */ int wsize; 11 | } SUBT_CODE; 12 | 13 | typedef struct { // 0x10 14 | /* 0x0 */ u_int starTime; 15 | /* 0x4 */ u_int endTime; 16 | /* 0x8 */ u_char *txtData[2]; 17 | } JIMAKU_DAT; 18 | 19 | typedef struct { // 0x8 20 | /* 0x0 */ int size; 21 | /* 0x4 */ JIMAKU_DAT *jimaku_dat_pp; 22 | } JIMAKU_STR; 23 | 24 | typedef struct { // 0xa 25 | /* 0x0 */ u_short u; 26 | /* 0x2 */ u_short v; 27 | /* 0x4 */ u_short w; 28 | /* 0x6 */ u_short h; 29 | /* 0x8 */ char adjx; 30 | /* 0x9 */ char adjy; 31 | } MCODE_DAT; 32 | 33 | typedef struct { // 0xc 34 | /* 0x0 */ u_short code; 35 | /* 0x2 */ u_short u; 36 | /* 0x4 */ u_short v; 37 | /* 0x6 */ u_short w; 38 | /* 0x8 */ u_short h; 39 | /* 0xa */ char adjx; 40 | /* 0xb */ char adjy; 41 | } MCODE_KANJI; 42 | 43 | typedef struct { // 0x4 44 | /* 0x0 */ int mcode_max; 45 | /* 0x4 */ MCODE_KANJI mcode_kanji[0]; 46 | } MCODE_STR; 47 | 48 | typedef MCODE_DAT MCODE_ASCII; 49 | typedef u_char *MESS[2]; 50 | 51 | #define CHECK_LANG(lang) (lang == LANG_JAPANESE) 52 | 53 | void SubtInit(void); 54 | void* SubtKanjiSet(void *adrs); 55 | void SubtClear(); 56 | void SubtFlash(); 57 | void SubtMcodeSet(int code); 58 | 59 | // poly: comment this out for the moment 60 | // MCODE_DAT* codeKanjiCheck(u_char dat0, u_char dat1); 61 | 62 | void SubtMsgPrint(u_char *msg_pp, int xp, int yp, int jap_flag, int mline); 63 | void SubtCtrlInit(void *adrs, int ser_f); 64 | void SubtCtrlPrint(JIMAKU_STR *jstr_pp, int line, int time, int lang); 65 | void SubtTapPrint(u_char *tap_msg_pp, int lang); 66 | void SubtMenuCtrlInit(void *adrs); 67 | void SubtMenuCtrlPrint(u_char *msg_pp, int xp, int yp, int lang); 68 | 69 | int SubtMsgDataKaijyouCnt(u_char *msg_pp, int jap_flag); 70 | u_char* SubtMsgDataPos(u_char *msg_pp, int jap_flag, int pos); 71 | 72 | void SubtTapPrintWake(u_char *tap_msg_pp, int lang, int lng, int nowp); 73 | void SubtCtrlPrintBoxyWipe(JIMAKU_STR *jstr_pp, int line, int time, int lang, void *code_pp); 74 | 75 | #endif -------------------------------------------------------------------------------- /include/main/wipe.h: -------------------------------------------------------------------------------- 1 | #ifndef WIPE_H 2 | #define WIPE_H 3 | 4 | #include "common.h" 5 | 6 | #include 7 | 8 | typedef enum { 9 | STW_TURN_IN = 0, 10 | STW_TURN_WAIT = 1, 11 | STW_TURN_OUT = 2, 12 | STW_PARAtoMINI = 3, 13 | STW_PARAtoBIG = 4, 14 | STW_YESNO = 5, 15 | STW_BOXY_IN = 6, 16 | STW_BOXY_WAIT = 7, 17 | STW_MAX = 8 18 | } SNDTAP_WIPE_ENUM; 19 | 20 | typedef enum 21 | { 22 | WIPE_TYPE_LOADING = 0, 23 | WIPE_TYPE_SAME = 1, 24 | WIPE_TYPE_YES_NO = 2, 25 | WIPE_TYPE_PARA = 3, 26 | WIPE_TYPE_BOXY = 4, 27 | WIPE_TYPE_BOXY_WAIT = 5, 28 | WIPE_TYPE_MAX = 6 29 | } WIPE_TYPE; 30 | 31 | typedef struct { // 0x8 32 | /* 0x0 */ int frame; 33 | /* 0x4 */ int data; 34 | } WIPE_SCRATCH_TBL; 35 | 36 | typedef struct { // 0x8 37 | /* 0x0 */ int frt_size; 38 | /* 0x4 */ WIPE_SCRATCH_TBL *frt_pp; 39 | } WIPE_SCRATCH_CTRL; 40 | 41 | typedef enum { 42 | WSHC_IN = 0, 43 | WSHC_LOOP = 1, 44 | WSHC_IN_MOVE = 2, 45 | WSHC_LOOP_MOVE = 3, 46 | WSHC_OUT = 4, 47 | WSHC_OUT_MOVE = 5, 48 | WSHC_MAX = 6 49 | } WSHC_ENUM; 50 | 51 | typedef struct { // 0x20 52 | /* 0x00 */ int spmmap; 53 | /* 0x04 */ int spamap; 54 | /* 0x08 */ int spamapP; 55 | /* 0x0c */ PR_MODELHANDLE spmHdl; 56 | /* 0x10 */ PR_ANIMATIONHANDLE spaHdl; 57 | /* 0x14 */ PR_ANIMATIONHANDLE spaHdlP; 58 | /* 0x18 */ int *frame_pp; 59 | /* 0x1c */ int *frame_ppP; 60 | } LDMAP; 61 | 62 | typedef enum { 63 | LDMAP_TURN = 0, 64 | LDMAP_LOGO = 1, 65 | LDMAP_RECODE = 2, 66 | LDMAP_RECODE_LT = 3, 67 | LDMAP_LABEL = 4 68 | } LDMAP_ENUM; 69 | 70 | typedef struct { // 0x10 71 | /* 0x0 */ void *scene_hdl; 72 | /* 0x4 */ void *spm_hdl; 73 | /* 0x8 */ void *spc_hdl; 74 | /* 0xc */ void *spa_hdl; 75 | } WIPE_PARA_STR; 76 | 77 | void WipeOutReq(void); 78 | int WipeEndCheck(void); 79 | 80 | #endif -------------------------------------------------------------------------------- /include/menu/memc.h: -------------------------------------------------------------------------------- 1 | #ifndef MEMC_H 2 | #define MEMC_H 3 | 4 | #include "common.h" 5 | 6 | #include 7 | #include 8 | 9 | typedef struct { // 0x340 10 | /* 0x000 */ u_int flag; 11 | /* 0x004 */ u_int stat; 12 | /* 0x008 */ int port; 13 | /* 0x00c */ int slot; 14 | /* 0x010 */ int type; 15 | /* 0x014 */ int free; 16 | /* 0x018 */ int cmd; 17 | /* 0x01c */ int func; 18 | /* 0x020 */ int fd; 19 | /* 0x024 */ int retry; 20 | /* 0x028 */ int format; 21 | /* 0x02c */ char *buf; 22 | /* 0x030 */ int size; 23 | /* 0x034 */ int isChange; 24 | /* 0x038 */ int seek; 25 | /* 0x03c */ int size2; 26 | /* 0x040 */ u_int oldOWClust; 27 | /* 0x044 */ u_int sizeOW; 28 | /* 0x048 */ int bChkSys; 29 | /* 0x04c */ int isSyncClose; 30 | /* 0x050 */ char filename[64]; 31 | /* 0x090 */ int fileNo; 32 | /* 0x0c0 */ sceMcTblGetDir curDir[8]; 33 | /* 0x2c0 */ char saveDir[64]; 34 | /* 0x300 */ int iconSize1; 35 | /* 0x304 */ u_char *iconData1; 36 | /* 0x308 */ int iconSize2; 37 | /* 0x30c */ u_char *iconData2; 38 | /* 0x310 */ int iconSize3; 39 | /* 0x314 */ u_char *iconData3; 40 | /* 0x318 */ int sysFileSize; 41 | } MEMC_STAT; 42 | 43 | typedef struct { // 0x18 44 | /* 0x00 */ u_int flag; 45 | /* 0x04 */ int free; 46 | /* 0x08 */ int allfile; 47 | /* 0x0c */ int savefile; 48 | /* 0x10 */ int dirfileMax; 49 | /* 0x14 */ sceMcTblGetDir *dirfile; 50 | } MEMC_INFO; 51 | 52 | void memc_init(void); 53 | 54 | void memc_setDirName(char *name); 55 | void memc_setSaveTitle(char *name, int nLFPos); 56 | void memc_setIconSysHed(void *pIhData, int IhSize); 57 | void memc_setSaveIcon(int no, void *pIconData, int nIconSize); 58 | 59 | char* memc_getfilename(int no); 60 | char* memc_getfilepath(int no); 61 | 62 | int memc_checkFormat(void); 63 | int memc_getChangeState(void); 64 | void memc_setChangeState(int flg); 65 | sceMcTblGetDir* memc_searchDirTbl(char *name, sceMcTblGetDir *dirTbl, int num, int isClose, int cmpSize, int *status); 66 | 67 | int memc_port_info(int port, MEMC_INFO *info); 68 | int memc_del_file(int port, int no); 69 | int memc_load_file(int port, int no, char *buf, int size); 70 | int memc_loadFirst(int port, int no, char *buf, int size); 71 | int memc_save_file(int port, int no, char *buf, int size, int bSysRW); 72 | int memc_seeksave_file(int port, int no, char *buf, int size, int seek, int sizef, int bSysRW); 73 | int memc_save_overwrite(void); 74 | int memc_port_check(int port, int *type, int *free); 75 | int memc_format(int port); 76 | int memc_chg_dir(int port, char *name); 77 | int memc_get_dir(int port, char *name, sceMcTblGetDir *dir, int max); 78 | int memc_get_dir_continue(sceMcTblGetDir *dir, int max); 79 | 80 | int memc_manager(int mode); 81 | 82 | #endif -------------------------------------------------------------------------------- /include/menu/menu.h: -------------------------------------------------------------------------------- 1 | #ifndef MENU_H 2 | #define MENU_H 3 | 4 | #include "common.h" 5 | 6 | #include "main/etc.h" 7 | #include "main/mcctrl.h" 8 | 9 | typedef enum { 10 | SEL_MENU_STAGESEL = 0, 11 | SEL_MENU_SAVE = 1, 12 | SEL_MENU_REPLAY = 2 13 | } SEL_MENU_ENUM; 14 | 15 | typedef struct { // 0xc 16 | /* 0x0 */ GAME_STATUS *game_status_p; 17 | /* 0x4 */ MC_REP_STR *mc_rep_str_p; 18 | /* 0x8 */ SEL_MENU_ENUM sel_menu_enum; 19 | } MENU_STR; 20 | 21 | typedef struct { // 0x188 22 | /* 0x000 */ int nRound; 23 | /* 0x004 */ char name[12]; 24 | /* 0x010 */ char name1[12]; 25 | /* 0x01c */ char name2[12]; 26 | /* 0x028 */ u_int clrFlg[4]; 27 | /* 0x038 */ int clrCount[8]; 28 | /* 0x058 */ int clrVSCOM1[8]; 29 | /* 0x078 */ int clrCOOL[8]; 30 | /* 0x098 */ u_int logCOOL[8]; 31 | /* 0x0b8 */ GAME_STATUS game_status; 32 | } P3LOG_VAL; 33 | 34 | typedef struct { // 0x58 35 | /* 0x00 */ int nStage; 36 | /* 0x04 */ int nMode; 37 | /* 0x08 */ int vsLev; 38 | /* 0x0c */ P3LOG_VAL *pLog; 39 | /* 0x10 */ GAME_STATUS *pGameStatus; 40 | /* 0x14 */ MC_REP_STR *pReplayArea; 41 | /* 0x18 */ int endFlg; 42 | /* 0x1c */ u_int score; 43 | /* 0x20 */ u_int score2P; 44 | /* 0x24 */ u_int bonusG; 45 | /* 0x28 */ int bCoolClr; 46 | /* 0x2c */ int winPlayer; 47 | /* 0x30 */ int endingGame; 48 | /* 0x34 */ int isWipeEnd; 49 | /* 0x38 */ int isState; 50 | /* 0x3c */ short *pAutoMove; 51 | /* 0x40 */ short autoMovePos[10]; 52 | /* 0x54 */ int curRecJacket; 53 | } P3GAMESTATE; 54 | 55 | int MenuMemCardCheck(void); 56 | 57 | #endif -------------------------------------------------------------------------------- /include/menu/menu_mdl.h: -------------------------------------------------------------------------------- 1 | #ifndef MENU_MDL_H 2 | #define MENU_MDL_H 3 | 4 | #include "common.h" 5 | 6 | #include 7 | #include 8 | 9 | typedef struct { // 0x3c 10 | /* 0x00 */ int fn_mdl; 11 | /* 0x04 */ u_short fn_anmm[10]; 12 | /* 0x18 */ u_short fn_anmp[18]; 13 | } MN_MDLTBL; 14 | 15 | typedef struct { // 0x8 16 | /* 0x0 */ MN_MDLTBL *pmtbl; 17 | /* 0x4 */ int *pctbl; 18 | } MN_SCENETBL; 19 | 20 | typedef struct { // 0x4 21 | /* 0x0 */ u_short cflg; 22 | /* 0x2 */ u_short no; 23 | } MNANM_COBJ; 24 | 25 | typedef struct { // 0x20 26 | /* 0x00 */ u_char kind; 27 | /* 0x01 */ u_char aTimNo; 28 | /* 0x02 */ short stime; 29 | /* 0x04 */ short etime; 30 | /* 0x06 */ u_char aSpeed; 31 | /* 0x07 */ u_char pad; 32 | /* 0x08 */ MNANM_COBJ anmCobj[6]; 33 | } MNANM_TBL; 34 | 35 | typedef struct { // 0x14 36 | /* 0x00 */ float x; 37 | /* 0x04 */ float y; 38 | /* 0x08 */ float z; 39 | /* 0x0c */ float dist; 40 | /* 0x10 */ float rly; 41 | } PRPOS; 42 | 43 | typedef struct { // 0x8 44 | /* 0x0 */ PRPOS *ppos; 45 | /* 0x4 */ int npos; 46 | } PRPROOT; 47 | 48 | typedef struct { // 0x90 49 | /* 0x00 */ sceGifTag giftag; 50 | /* 0x10 */ sceGsDrawEnv1 denv1; 51 | } DRAWENV_TAG12; 52 | 53 | typedef struct { // 0x8c 54 | /* 0x00 */ void *spm; 55 | /* 0x04 */ void *spa_m[10]; 56 | /* 0x2c */ void *spa_p[18]; 57 | /* 0x74 */ u_short dspSw; 58 | /* 0x76 */ u_short MAniNo; 59 | /* 0x78 */ u_short PAniNo; 60 | /* 0x7a */ u_short PMovNo; 61 | /* 0x7c */ u_short MvTblNo; 62 | /* 0x7e */ u_short MSpaNo; 63 | /* 0x80 */ u_short PSpaNo; 64 | /* 0x82 */ u_short bABlend; 65 | /* 0x84 */ float ablend_rate; 66 | /* 0x88 */ float ablend_speed; 67 | } MN_HMDL; 68 | 69 | typedef struct { // 0x1154 70 | /* 0x0000 */ u_short isDisp; 71 | /* 0x0002 */ u_short pad; 72 | /* 0x0004 */ void *scene; 73 | /* 0x0008 */ int nmdl; 74 | /* 0x000c */ MN_HMDL mdl[30]; 75 | /* 0x1074 */ int ncam; 76 | /* 0x1078 */ void *spc[14]; 77 | /* 0x10b0 */ int time[10]; 78 | /* 0x10d8 */ void *anime[10]; 79 | /* 0x1100 */ void *cntani[10]; 80 | /* 0x1128 */ int speed[10]; 81 | /* 0x1150 */ short CSpcNo; 82 | /* 0x1152 */ short CAniNo; 83 | } MN_SCENE; 84 | 85 | #endif -------------------------------------------------------------------------------- /include/menu/menudata.h: -------------------------------------------------------------------------------- 1 | #ifndef MENUDATA_H 2 | #define MENUDATA_H 3 | 4 | #include "common.h" 5 | 6 | typedef enum { 7 | MENU_SPU_CHAN = 0, 8 | MENU_SPU_CHAN1 = 1, 9 | MENU_SPU_CHAN2 = 2, 10 | MENU_SPU_MAX = 3 11 | } MENU_SPU_ENUM; 12 | 13 | typedef enum { 14 | MDISK_00 = 0, 15 | MDISK_01 = 1, 16 | MDISK_02 = 2, 17 | MDISK_03 = 3, 18 | MDISK_04 = 4, 19 | MDISK_05 = 5, 20 | MDISK_06 = 6, 21 | MDISK_07 = 7, 22 | MDISK_08 = 8, 23 | MDISK_09 = 9, 24 | MDISK_MAX = 10 25 | } MENU_DISKSND_ENUM; 26 | 27 | void MenuMsgInit(void); 28 | 29 | #endif -------------------------------------------------------------------------------- /include/menu/menufont.h: -------------------------------------------------------------------------------- 1 | #ifndef MENUFONT_H 2 | #define MENUFONT_H 3 | 4 | #include "common.h" 5 | 6 | #include "main/etc.h" 7 | #include "main/subt.h" 8 | 9 | #include "menu/mntm2hed.h" 10 | #include "menu/pksprite.h" 11 | 12 | enum 13 | { 14 | SUBTN_ETC_CODE, 15 | SUBTN_KANJI_CODE, 16 | SUBTN_PADSYM_CODE, 17 | SUBTN_END 18 | }; 19 | 20 | typedef struct { // 0x14 21 | /* 0x00 */ u_short u; 22 | /* 0x02 */ u_short v; 23 | /* 0x04 */ u_short w; 24 | /* 0x06 */ u_short h; 25 | /* 0x08 */ char adjx; 26 | /* 0x09 */ char adjy; 27 | /* 0x0a */ MCODE_DAT apat; 28 | } MCODE_DAT_ANIME; 29 | 30 | typedef struct { // 0x16 31 | /* 0x00 */ u_short code; 32 | /* 0x02 */ u_short u; 33 | /* 0x04 */ u_short v; 34 | /* 0x06 */ u_short w; 35 | /* 0x08 */ u_short h; 36 | /* 0x0a */ char adjx; 37 | /* 0x0b */ char adjy; 38 | /* 0x0c */ MCODE_DAT apat; 39 | } MCODE_KANJI_ANIME; 40 | 41 | typedef struct { // 0x8 42 | /* 0x0 */ int flg; 43 | /* 0x4 */ MCODE_DAT *pmcode; 44 | } MCODE_CHAR; 45 | 46 | typedef struct { // 0x10 47 | /* 0x0 */ u_long tex0; 48 | /* 0x8 */ u_int abgr; 49 | /* 0xc */ u_int pad; 50 | } MNFONT_INFO; 51 | 52 | #endif -------------------------------------------------------------------------------- /include/menu/menusub.h: -------------------------------------------------------------------------------- 1 | #ifndef MENUSUB_H 2 | #define MENUSUB_H 3 | 4 | #include "common.h" 5 | #include 6 | 7 | #include "os/syssub.h" 8 | 9 | #include "menu/menu.h" 10 | #include "menu/pksprite.h" 11 | 12 | typedef struct { // 0x18 13 | /* 0x00 */ int wtim; 14 | /* 0x04 */ short tim; 15 | /* 0x06 */ short dir; 16 | /* 0x08 */ float px; 17 | /* 0x0c */ float py; 18 | /* 0x10 */ float vx; 19 | /* 0x14 */ float vy; 20 | } HOSI_OBJ; 21 | 22 | typedef struct { // 0x4 23 | /* 0x0 */ u_short state; 24 | /* 0x2 */ u_short time; 25 | } TSREPPAD; 26 | 27 | typedef struct { // 0xc 28 | /* 0x0 */ int texNo; 29 | /* 0x4 */ short x; 30 | /* 0x6 */ short y; 31 | /* 0x8 */ short w; 32 | /* 0xa */ short h; 33 | } PATPOS; 34 | 35 | typedef struct { // 0x18 36 | /* 0x00 */ u_long tex0; 37 | /* 0x08 */ float rUsize; 38 | /* 0x0c */ float rVsize; 39 | /* 0x10 */ u_int w; 40 | /* 0x14 */ u_int h; 41 | } TSTEX_INF; 42 | 43 | typedef struct { // 0xc 44 | /* 0x0 */ u_short chan; 45 | /* 0x2 */ u_short tapNo; 46 | /* 0x4 */ int lpTimeF; 47 | /* 0x8 */ int lpTime; 48 | } MAPBGM; 49 | 50 | typedef struct { // 0xc 51 | /* 0x0 */ u_short vol; 52 | /* 0x2 */ short bPause; 53 | /* 0x4 */ int tim; 54 | /* 0x8 */ MAPBGM *pbgm; 55 | } BGMONE; 56 | 57 | typedef struct { // 0xa0 58 | /* 0x00 */ u_short vol; 59 | /* 0x02 */ u_short state; 60 | /* 0x04 */ u_short ttim; 61 | /* 0x06 */ u_short ttim0; 62 | /* 0x08 */ u_short wtLoad; 63 | /* 0x0a */ u_short wtNo; 64 | /* 0x0c */ u_short wtTim; 65 | /* 0x0e */ u_short pad; 66 | /* 0x10 */ u_short chgReq; 67 | /* 0x12 */ u_short sndno; 68 | /* 0x14 */ u_short oldno; 69 | /* 0x16 */ u_short cstate; 70 | /* 0x18 */ u_short ctim; 71 | /* 0x1c */ BGMONE wbgm[11]; 72 | } BGMSTATE; 73 | 74 | void TsMENU_InitSystem(void); 75 | void TsMENU_EndSystem(void); 76 | void TsMenu_RankingClear(void); 77 | 78 | void TsMenu_Init(int iniflg, P3GAMESTATE *pstate); 79 | void TsMenu_End(void); 80 | 81 | void TsMenu_InitFlow(P3GAMESTATE *pstate); 82 | int TsMenuMemcChk_Flow(void); 83 | int TsMenu_Flow(void); 84 | 85 | void TsMenu_Draw(void); 86 | 87 | #endif -------------------------------------------------------------------------------- /include/menu/mntm2hed.h: -------------------------------------------------------------------------------- 1 | #ifndef MNTM2HED_H 2 | #define MNTM2HED_H 3 | 4 | #include "common.h" 5 | #include 6 | 7 | typedef struct { // 0x30 8 | /* 0x00 */ int w; 9 | /* 0x04 */ int h; 10 | /* 0x08 */ int type; 11 | /* 0x0c */ int pad; 12 | /* 0x10 */ u_long GsTex0; 13 | /* 0x18 */ u_long GsTex1; 14 | /* 0x20 */ u_long GsReg; 15 | /* 0x28 */ u_long GsClut; 16 | } MENU_TM2_HED; 17 | 18 | MENU_TM2_HED* TsGetTM2Hed(int no); 19 | 20 | #endif -------------------------------------------------------------------------------- /include/menu/p3mc.h: -------------------------------------------------------------------------------- 1 | #ifndef P3MC_H 2 | #define P3MC_H 3 | 4 | #include "common.h" 5 | 6 | #include 7 | #include 8 | 9 | typedef struct { // 0x14 10 | /* 0x00 */ u_int scDate[2]; 11 | /* 0x08 */ u_char name[8]; 12 | /* 0x10 */ u_int score; 13 | } P3MC_RANKSCORE; 14 | 15 | typedef struct { // 0x4c4 16 | /* 0x000 */ int nSplay; 17 | /* 0x004 */ P3MC_RANKSCORE splay[20]; 18 | /* 0x194 */ int nVplay[4]; 19 | /* 0x1a4 */ P3MC_RANKSCORE vplay[4][10]; 20 | } P3MC_STAGERANK; 21 | 22 | typedef struct { // 0x2664 23 | /* 0x0000 */ char name[12]; 24 | /* 0x000c */ char name1[12]; 25 | /* 0x0018 */ char name2[12]; 26 | /* 0x0024 */ u_short stageNo; 27 | /* 0x0026 */ u_short fileNo; 28 | /* 0x0028 */ u_char flg; 29 | /* 0x0029 */ u_char mode; 30 | /* 0x002a */ u_char isVs; 31 | /* 0x002b */ u_char vsLev; 32 | /* 0x002c */ u_int score; 33 | /* 0x0030 */ u_int score2; 34 | /* 0x0034 */ u_short roundNo; 35 | /* 0x0036 */ u_char winner; 36 | /* 0x0037 */ u_char pads; 37 | /* 0x0038 */ u_int pad[1]; 38 | /* 0x003c */ u_char date_day; 39 | /* 0x003d */ u_char date_month; 40 | /* 0x003e */ u_short date_year; 41 | /* 0x0040 */ u_char date_pad; 42 | /* 0x0041 */ u_char date_second; 43 | /* 0x0042 */ u_char date_minute; 44 | /* 0x0043 */ u_char date_hour; 45 | /* 0x0044 */ P3MC_STAGERANK stageRank[8]; 46 | } USER_DATA; 47 | 48 | typedef struct { // 0x2684 49 | /* 0x0000 */ char header[16]; 50 | /* 0x0010 */ USER_DATA user; 51 | /* 0x2674 */ char footer[16]; 52 | } USER_HEADER; 53 | 54 | typedef struct { // 0x10 55 | /* 0x0 */ char footer[16]; 56 | } USER_FOOTER; 57 | 58 | typedef struct { // 0x1c 59 | /* 0x00 */ u_char *pMemTop; 60 | /* 0x04 */ u_int rwsize; 61 | /* 0x08 */ u_int datasize; 62 | /* 0x0c */ u_int srcsize; 63 | /* 0x10 */ USER_HEADER *pHead; 64 | /* 0x14 */ void *pData; 65 | /* 0x18 */ USER_FOOTER *pFoot; 66 | } MCRWDATA_HDL; 67 | 68 | typedef struct { // 0xc2980 69 | /* 0x00000 */ int nGetUser; 70 | /* 0x00004 */ USER_DATA getUser[81]; 71 | /* 0xc25a8 */ int logPage_flg; 72 | /* 0xc25ac */ int repPage_flg; 73 | /* 0xc25b0 */ int nLogGet; 74 | /* 0xc25b4 */ int nRepGet; 75 | /* 0xc25b8 */ USER_DATA *plog_user[80]; 76 | /* 0xc26f8 */ USER_DATA *prep_user[80]; 77 | /* 0xc2838 */ int nUserMax; 78 | /* 0xc283c */ USER_DATA *pUserTbl[81]; 79 | } P3MC_USRLST; 80 | 81 | typedef struct { // 0x20 82 | /* 0x00 */ int prg; 83 | /* 0x04 */ int dstat; 84 | /* 0x08 */ int data_no; 85 | /* 0x0c */ int data_mode; 86 | /* 0x10 */ int data_stage; 87 | /* 0x14 */ int prgflag; 88 | /* 0x18 */ MCRWDATA_HDL *dhdl; 89 | /* 0x1c */ void *data_cfunc; 90 | } P3MC_WORK; 91 | 92 | typedef int (*P3MCDataCheckFunc)(); 93 | 94 | typedef struct { // 0x3b00 95 | /* 0x0000 */ int curState; 96 | /* 0x0004 */ int curMode; 97 | /* 0x0008 */ int curFno; 98 | /* 0x000c */ int curUserMode; 99 | /* 0x0010 */ int bFirst; 100 | /* 0x0014 */ MCRWDATA_HDL chkData; 101 | /* 0x0030 */ P3MC_USRLST *pUserLst; 102 | /* 0x0034 */ u_char UserHeadTmp[9860]; 103 | /* 0x26c0 */ sceMcTblGetDir dirTable[81]; 104 | } GETUSER_WORK; 105 | 106 | #endif -------------------------------------------------------------------------------- /include/os/cmngifpk.h: -------------------------------------------------------------------------------- 1 | #ifndef CMNGIFPK_H 2 | #define CMNGIFPK_H 3 | 4 | #include "common.h" 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | typedef struct { // 0x8 12 | /* 0x0 */ u_long128 *pBase; 13 | /* 0x4 */ int pri; 14 | } CMNGIF_PRI; 15 | 16 | void CmnGifInit(void *buf_adr, int size); 17 | void CmnGifClear(void); 18 | void CmnGifFlush(void); 19 | 20 | int CmnGifSetData(sceGifPacket *gifpk_pp, int pri); 21 | 22 | int CmnGifOpenCmnPk(sceGifPacket *gifpk_pp); 23 | int CmnGifCloseCmnPk(sceGifPacket *gifpk_pp, int pri); 24 | 25 | u_long128* CmnGifAdrsGet(void); 26 | int CmnGifAdrsEnd(u_long128 *adr); 27 | 28 | void CmnGifADPacketMake(sceGifPacket *gifP_pp, sceGsFrame *gsframe_pp); 29 | void CmnGifADPacketMake2(sceGifPacket *gifP_pp, sceGsFrame *gsframe_pp); 30 | int CmnGifADPacketMakeTrans(sceGifPacket *gifP_pp); 31 | 32 | #endif -------------------------------------------------------------------------------- /include/os/mtc.h: -------------------------------------------------------------------------------- 1 | #ifndef MTC_H 2 | #define MTC_H 3 | 4 | #include "common.h" 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | #include "dbug/syori.h" 12 | 13 | typedef enum { 14 | MTC_TASK_CTRL = 0x0, 15 | MTC_TASK_MAIN = 0x1, 16 | MTC_TASK_02 = 0x2, 17 | MTC_TASK_03 = 0x3, 18 | MTC_TASK_04 = 0x4, 19 | MTC_TASK_05 = 0x5, 20 | MTC_TASK_SCORECTRL = 0x5, 21 | MTC_TASK_06 = 0x6, 22 | MTC_TASK_07 = 0x7, 23 | MTC_TASK_DRAWCTRL = 0x7, 24 | MTC_TASK_08 = 0x8, 25 | MTC_TASK_09 = 0x9, 26 | MTC_TASK_0A = 0x0A, 27 | MTC_TASK_CDCTRL = 0x0A, 28 | MTC_TASK_0B = 0x0B, 29 | MTC_TASK_0C = 0x0C, 30 | MTC_TASK_0D = 0x0D, 31 | MTC_TASK_FACECTRL = 0x0D, /* typo: fadectrl */ 32 | MTC_TASK_0E = 0x0E, 33 | MTC_TASK_0F = 0x0F, 34 | MTC_TASK_WIPECTRL = 0x0F, 35 | MTC_TASK_MAX = 0x10 36 | } MTC_TASK_ENUM; 37 | 38 | typedef enum { 39 | MTC_TASK_SIZE_CTRL = 4096, 40 | MTC_TASK_SIZE_MAIN = 4096, 41 | MTC_TASK_SIZE_02 = 256, 42 | MTC_TASK_SIZE_03 = 2048, 43 | MTC_TASK_SIZE_04 = 4096, 44 | MTC_TASK_SIZE_05 = 16384, 45 | MTC_TASK_SIZE_06 = 256, 46 | MTC_TASK_SIZE_07 = 16384, 47 | MTC_TASK_SIZE_08 = 256, 48 | MTC_TASK_SIZE_09 = 256, 49 | MTC_TASK_SIZE_0A = 4096, 50 | MTC_TASK_SIZE_0B = 256, 51 | MTC_TASK_SIZE_0C = 256, 52 | MTC_TASK_SIZE_0D = 4096, 53 | MTC_TASK_SIZE_0E = 256, 54 | MTC_TASK_SIZE_0F = 4096 55 | } MTC_TASK_SIZE_ENUM; 56 | 57 | typedef enum { 58 | MTC_COND_KILL = 0, 59 | MTC_COND_WAIT = 1, 60 | MTC_COND_EXEC = 2, 61 | MTC_COND_KILL_REQ = 3, 62 | MTC_COND_PAUSE = 32768 63 | } MTC_COND_ENUM; 64 | 65 | typedef enum { 66 | MTC_TOP_PRI = 16, 67 | MTC_CTRL_TOP = 16, 68 | MTC_EACH = 17, 69 | MTC_CTRL_END = 18 70 | } MTC_PRI_ENUM; 71 | 72 | typedef struct { // 0x40 73 | /* 0x00 */ short th_id; 74 | /* 0x04 */ MTC_COND_ENUM status; 75 | /* 0x08 */ long wtime; 76 | /* 0x10 */ struct ThreadParam th_para; 77 | } MTC_TASK_CONB; 78 | 79 | void MtcChangeThCtrl(void* x); 80 | void MtcInit(void); 81 | void MtcQuit(void); 82 | void MtcStart(void* ctrlTh_pp); 83 | void MtcExec(void* prg_pp, long level); 84 | void MtcWait(long wt); 85 | void MtcKill(long level); 86 | void MtcPause(long level); 87 | void MtcContinue(long level); 88 | void MtcExit(void); 89 | int MtcGetCondition(long level); 90 | int MtcResetCheck(void); 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /include/os/system.h: -------------------------------------------------------------------------------- 1 | #ifndef SYSTEM_H 2 | #define SYSTEM_H 3 | 4 | #include "common.h" 5 | 6 | #include "os/mtc.h" 7 | #include "os/syssub.h" 8 | #include "os/cmngifpk.h" 9 | 10 | #include "main/main.h" 11 | #include "main/etc.h" 12 | 13 | #include 14 | #include 15 | #include 16 | #include <../libcdvd.h> 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #define SCREEN_WIDTH 640 25 | #define SCREEN_HEIGHT 448 26 | 27 | extern int outbuf_idx; 28 | 29 | extern sceGsDBuffDc DBufDc; 30 | extern sceGsDrawEnv1* drawEnvP[5]; 31 | extern PADD pad[2]; 32 | 33 | extern GLOBAL_DATA global_data; 34 | extern GAME_STATUS game_status; 35 | extern MC_REP_STR mc_rep_str; 36 | 37 | /* .sdata */ 38 | extern HAT_CHANGE_ENUM hat_change_enum; 39 | 40 | extern INGAME_COMMON_STR ingame_common_str; 41 | 42 | typedef struct { // 0x100 43 | /* 0x00 */ sceDmaTag dmatag; 44 | /* 0x10 */ sceGifTag giftag; 45 | /* 0x20 */ sceGsDrawEnv1 drEnv; 46 | /* 0xa0 */ sceGsClear clear; 47 | } CLEAR_VRAM_DMA; 48 | 49 | int SetIopModule(void); 50 | void initSystem(void); 51 | void exitSystem(void); 52 | void SetOsFuncAddr(void *func_pp); 53 | void osFunc(void); 54 | void systemCtrlMain(void *xx); 55 | void mallocInit(void); 56 | 57 | #endif // SYSTEM_H 58 | -------------------------------------------------------------------------------- /include/os/tim2.h: -------------------------------------------------------------------------------- 1 | #ifndef TIM2_H 2 | #define TIM2_H 3 | 4 | #include "common.h" 5 | 6 | #include 7 | #include 8 | 9 | #include "main/sprite.h" 10 | 11 | #include 12 | #include 13 | 14 | #define TIM2_NONE (0) // For use on ClutType when there is no CLUT data 15 | #define TIM2_RGB16 (1) // 16bit color (used for both ClutType and ImageType) 16 | #define TIM2_RGB24 (2) // 24bit color (only used with ImageType) 17 | #define TIM2_RGB32 (3) // 32bit color (used for both ClutType and ImageType) 18 | #define TIM2_IDTEX4 (4) // 16 color texture (only used with ImageType) 19 | #define TIM2_IDTEX8 (5) // 16 color texture (only used with ImageType) 20 | 21 | #define TIM2(x) ((TIM2_FILEHEADER*)x) 22 | 23 | typedef struct { // 0x10 24 | /* 0x0 */ char FileId[4]; 25 | /* 0x4 */ u_char FormatVersion; 26 | /* 0x5 */ u_char FormatId; 27 | /* 0x6 */ u_short Pictures; 28 | /* 0x8 */ char Reserved[8]; 29 | } TIM2_FILEHEADER; 30 | 31 | typedef struct { // 0x30 32 | /* 0x00 */ u_int TotalSize; 33 | /* 0x04 */ u_int ClutSize; 34 | /* 0x08 */ u_int ImageSize; 35 | /* 0x0c */ u_short HeaderSize; 36 | /* 0x0e */ u_short ClutColors; 37 | /* 0x10 */ u_char PictFormat; 38 | /* 0x11 */ u_char MipMapTextures; 39 | /* 0x12 */ u_char ClutType; 40 | /* 0x13 */ u_char ImageType; 41 | /* 0x14 */ u_short ImageWidth; 42 | /* 0x16 */ u_short ImageHeight; 43 | /* 0x18 */ u_long GsTex0; 44 | /* 0x20 */ u_long GsTex1; 45 | /* 0x28 */ u_int GsRegs; 46 | /* 0x2c */ u_int GsTexClut; 47 | } TIM2_PICTUREHEADER; 48 | 49 | typedef struct { // 0x30 50 | /* 0x00 */ u_long GsMiptbp1; 51 | /* 0x08 */ u_long GsMiptbp2; 52 | /* 0x10 */ u_int Size[7]; 53 | /* 0x2c */ char Reserved[4]; 54 | } TIM2_MIPMAPHEADER; 55 | 56 | typedef struct { // 0x10 57 | /* 0x0 */ char ExHeaderId[4]; 58 | /* 0x4 */ u_int UserSpaceSize; 59 | /* 0x8 */ u_int UserDataSize; 60 | /* 0xc */ u_int Reserved; 61 | } TIM2_EXHEADER; 62 | 63 | typedef struct { // 0x18 64 | /* 0x00 */ TIM2_FILEHEADER *fileH; 65 | /* 0x04 */ TIM2_PICTUREHEADER *picturH; 66 | /* 0x08 */ TIM2_MIPMAPHEADER *mipmapH; 67 | /* 0x0c */ TIM2_EXHEADER *exH; 68 | /* 0x10 */ u_long *clut_pp; 69 | /* 0x14 */ u_long *image_pp; 70 | } TIM2INFO; 71 | 72 | typedef struct { // 0x40 73 | /* 0x00 */ TIM2_FILEHEADER t2h; 74 | /* 0x10 */ TIM2_PICTUREHEADER t2p; 75 | } TIM2SETINFO; 76 | 77 | int SPstrncmp(char *sr1, char *sr2, int num); 78 | int GetTim2Info(void *tim2_pp, TIM2INFO *info_pp, int maxinfo); 79 | 80 | int Tim2SetLoadImageI(TIM2INFO *info_pp, int img_pos, sceGsLoadImage *img_pp, int ofsx, int ofsy); 81 | int Tim2SetLoadImageIX(TIM2INFO *info_pp, int img_pos, sceGsLoadImage *img_pp, TIM2INFO *infoX_pp); 82 | int Tim2SetLoadImageC(TIM2INFO *info_pp, int col_pos, sceGsLoadImage *img_pp, int ofsx, int ofsy); 83 | int Tim2Load(TIM2INFO *info_pp, int img_pos, int col_pos); 84 | 85 | int MODE_TR_P(int mode, int ws, int hs); 86 | 87 | int Tim2LoadSet(TIM2INFO *info_pp); 88 | int Tim2LoadSetX(TIM2INFO *info_pp, TIM2INFO *infoX_pp); 89 | 90 | void Tim2Trans(void *adrs); 91 | int Tim2TransX(void *adrs, int ofs_num); 92 | 93 | void Tim2Trans_TBP_MODE(void *adrs, int tbp, int mode); 94 | void Tim2TransColor_TBP(void *adrs, int tbp); 95 | 96 | #endif // TIM2_H -------------------------------------------------------------------------------- /include/os/usrmem.h: -------------------------------------------------------------------------------- 1 | #ifndef USRMEM_H 2 | #define USRMEM_H 3 | 4 | #include "common.h" 5 | #include 6 | 7 | #include 8 | 9 | void UsrMemClear(void); 10 | void UsrMemClearTop(void); 11 | void UsrMemClearEnd(void); 12 | 13 | u_int UsrMemGetAdr(int id); 14 | u_int UsrMemGetSize(int id); 15 | u_int UsrMemGetEndAdr(int id); 16 | u_int UsrMemGetEndSize(int id); 17 | 18 | u_int UsrMemAllocNext(void); 19 | u_int UsrMemAllocEndNext(void); 20 | 21 | u_int UsrMemAlloc(int size); 22 | u_int UsrMemEndAlloc(int size); 23 | 24 | void UsrMemFree(void); 25 | void UsrMemEndFree(void); 26 | 27 | #endif -------------------------------------------------------------------------------- /include/sdk/ee/devvif0.h: -------------------------------------------------------------------------------- 1 | /* SCE CONFIDENTIAL 2 | "PlayStation 2" Programmer Tool Runtime Library Release 2.5 3 | */ 4 | /* 5 | * Emotion Engine Library 6 | * Version 0.01 7 | * Shift-JIS 8 | * 9 | * Copyright (C) 1998-1999 Sony Computer Entertainment Inc. 10 | * All Rights Reserved. 11 | * 12 | * libdev - devvif0.h 13 | * develop library 14 | * 15 | * Version Date Design Log 16 | * -------------------------------------------------------------------- 17 | * 0.01 Mar,29,1999 shibuya 18 | */ 19 | 20 | #ifndef __devvif0__ 21 | #define __devvif0__ 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | typedef struct{ 28 | u_int row[4]; 29 | u_int col[4]; 30 | u_int mask; 31 | u_int code; 32 | u_int stat; 33 | u_short itop,itops; 34 | u_short mark; 35 | u_short num; 36 | u_char error; 37 | u_char cl,wl; 38 | u_char cmod; 39 | u_char pad; 40 | }sceDevVif0Cnd; 41 | 42 | 43 | void sceDevVif0Reset(void); 44 | 45 | int sceDevVif0Pause(int mode); 46 | 47 | int sceDevVif0Continue(void); 48 | 49 | u_int sceDevVif0PutErr(int interrupt, int miss1, int miss2); 50 | 51 | u_int sceDevVif0GetErr(void); 52 | 53 | int sceDevVif0GetCnd(sceDevVif0Cnd *); 54 | 55 | int sceDevVif0PutFifo(u_long128 *addr, int n); 56 | 57 | 58 | 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /include/sdk/ee/devvu0.h: -------------------------------------------------------------------------------- 1 | /* SCE CONFIDENTIAL 2 | "PlayStation 2" Programmer Tool Runtime Library Release 2.5 3 | */ 4 | /* 5 | * Emotion Engine Library 6 | * Version 0.01 7 | * Shift-JIS 8 | * 9 | * Copyright (C) 1998-1999 Sony Computer Entertainment Inc. 10 | * All Rights Reserved. 11 | * 12 | * libdev - devvu0.h 13 | * develop library 14 | * 15 | * Version Date Design Log 16 | * -------------------------------------------------------------------- 17 | * 0.01 Mar,29,1999 shibuya 18 | */ 19 | 20 | #ifndef __devvu0__ 21 | #define __devvu0__ 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | typedef struct{ 28 | u_long128 vf[32]; 29 | u_int status; 30 | u_int mac; 31 | u_int clipping; 32 | u_int r, i, q; 33 | u_short vi[16]; 34 | }sceDevVu0Cnd; 35 | 36 | void sceDevVu0Reset(void); 37 | 38 | int sceDevVu0Pause(void); 39 | 40 | int sceDevVu0Continue(void); 41 | 42 | void sceDevVu0PutDBit(int bit); 43 | 44 | void sceDevVu0PutTBit(int bit); 45 | 46 | int sceDevVu0GetDBit(void); 47 | 48 | int sceDevVu0GetTBit(void); 49 | 50 | void sceDevVu0Exec(u_short addr); 51 | 52 | u_short sceDevVu0GetTpc(void); 53 | 54 | int sceDevVu0GetCnd(sceDevVu0Cnd *cnd); 55 | 56 | int sceDevVu0PutCnd(sceDevVu0Cnd *cnd); 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /include/sdk/ee/eetypes.h: -------------------------------------------------------------------------------- 1 | /* SCE CONFIDENTIAL 2 | "PlayStation 2" Programmer Tool Runtime Library Release 2.5 3 | */ 4 | /* 5 | * Emotion Engine Library 6 | * Version 0.01 7 | * Shift-JIS 8 | * 9 | * Copyright (C) 1998-1999 Sony Computer Entertainment Inc. 10 | * All Rights Reserved. 11 | * 12 | * eetypes.h 13 | * develop library 14 | * 15 | * Version Date Design Log 16 | * -------------------------------------------------------------------- 17 | * 0.1.0 18 | * 0.3.0 June.05 horikawa required of M.W. 19 | */ 20 | 21 | #ifndef _eetypes_h_ 22 | #define _eetypes_h_ 23 | 24 | #ifndef _SYS_TYPES_H 25 | typedef unsigned char u_char; 26 | typedef unsigned short u_short; 27 | typedef unsigned int u_int; 28 | typedef unsigned long u_long; 29 | #endif 30 | #ifdef __GNUC__ 31 | typedef int long128 __attribute__ ((mode (TI))); 32 | typedef unsigned int u_long128 __attribute__ ((mode (TI))); 33 | #endif 34 | 35 | #ifndef FALSE 36 | #define FALSE 0 37 | #endif 38 | 39 | #ifndef TRUE 40 | #define TRUE (!FALSE) 41 | #endif 42 | 43 | #ifndef NULL 44 | #define NULL 0 45 | #endif 46 | 47 | #endif /* _eetypes_h_ */ 48 | -------------------------------------------------------------------------------- /include/sdk/ee/libgifpk.h: -------------------------------------------------------------------------------- 1 | /* SCEI CONFIDENTIAL 2 | "PlayStation 2" Programmer Tool Runtime Library Release 2.0 3 | */ 4 | /* 5 | * Emotion Engine Library 6 | * Version 0.01 7 | * Shift-JIS 8 | * 9 | * Copyright (C) 1998-1999 Sony Computer Entertainment Inc. 10 | * All Rights Reserved. 11 | * 12 | * libpkt - libgifpk.h 13 | * gif packet support 14 | * 15 | * Version Date Design Log 16 | * -------------------------------------------------------------------- 17 | * 0.01 Mar,26,1999 shibuya 18 | */ 19 | 20 | #ifndef __libgifpk__ 21 | #define __libgifpk__ 22 | 23 | #include 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | typedef struct{ 31 | u_int *pCurrent; 32 | u_long128 *pBase; 33 | u_long128 *pDmaTag; 34 | u_long *pGifTag; 35 | }sceGifPacket; 36 | 37 | 38 | void sceGifPkInit(sceGifPacket *pPacket, u_long128 *pBase); 39 | 40 | void sceGifPkReset(sceGifPacket *pPacket); 41 | u_long128 *sceGifPkTerminate(sceGifPacket *pPacket); 42 | 43 | u_int sceGifPkSize(sceGifPacket *pPacket); 44 | 45 | void sceGifPkCnt(sceGifPacket *pPacket, u_int opt1, u_int opt2, u_int flag); 46 | void sceGifPkRet(sceGifPacket *pPacket, u_int opt1, u_int opt2, u_int flag); 47 | void sceGifPkEnd(sceGifPacket *pPacket, u_int opt1, u_int opt2, u_int flag); 48 | 49 | void sceGifPkNext(sceGifPacket *pPacket, u_long128 *pNext, u_int opt1, u_int opt2, u_int flag); 50 | void sceGifPkCall(sceGifPacket *pPacket, u_long128 *pCall, u_int opt1, u_int opt2, u_int flag); 51 | 52 | void sceGifPkRefe(sceGifPacket *pPacket, u_long128 *pRef, u_int size, u_int opt1, u_int opt2, u_int flag); 53 | void sceGifPkRef(sceGifPacket *pPacket, u_long128 *pRef, u_int size, u_int opt1, u_int opt2, u_int flag); 54 | void sceGifPkRefs(sceGifPacket *pPacket, u_long128 *pRef, u_int size, u_int opt1, u_int opt2, u_int flag); 55 | 56 | u_int *sceGifPkReserve(sceGifPacket *pPacket, u_int count); 57 | 58 | void sceGifPkOpenGifTag(sceGifPacket *pPacket, u_long128 gifTag); 59 | void sceGifPkCloseGifTag(sceGifPacket *pPacket); 60 | 61 | void sceGifPkAddGsData(sceGifPacket *pPacket, u_long data); 62 | void sceGifPkAddGsDataN(sceGifPacket *pPacket, u_long *pData, u_int count); 63 | 64 | void sceGifPkAddGsPacked(sceGifPacket* pPacket, u_long128 data); 65 | void sceGifPkAddGsPackedN(sceGifPacket* pPacket, u_long128* pData, u_int count); 66 | 67 | void sceGifPkAddGsAD(sceGifPacket *pPacket, u_int addr, u_long data); 68 | 69 | void sceGifPkRefLoadImage(sceGifPacket *pPacket, u_short bp, u_char psm, u_short bw, u_long128 *image, u_int size, u_int x, u_int y, u_int w, u_int h); 70 | 71 | 72 | void sceGifPkDump(sceGifPacket *pPacket); 73 | 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | 78 | #endif /* __libgifpk__ */ 79 | -------------------------------------------------------------------------------- /include/sdk/ee/libpad2.h: -------------------------------------------------------------------------------- 1 | /* SCE CONFIDENTIAL 2 | "PlayStation 2" Programmer Tool Runtime Library Release 2.5 3 | */ 4 | /* 5 | * Controller Library 6 | * Version 2.01 7 | * Shift-JIS 8 | * 9 | * Copyright (C) 2001 Sony Computer Entertainment Inc. 10 | * All Rights Reserved. 11 | * 12 | * libpad2 - libpad2.h 13 | * header file of libpad2 14 | * 15 | * Version Date Design Log 16 | * -------------------------------------------------------------------- 17 | * 2.01 2001-03-09 nozomu the first version 18 | * 19 | */ 20 | 21 | #ifndef _LIBPAD2_H_ 22 | #define _LIBPAD2_H_ 23 | 24 | #define SCE_PAD2_DMA_BUFFER_MAX (16) 25 | #define SCE_PAD2_MAX_DEVICE_NAME (16) 26 | 27 | #define SCE_PAD2_PORT_1C (0) 28 | #define SCE_PAD2_PORT_2C (1) 29 | #define SCE_PAD2_PORT_USB (99) 30 | 31 | #define SCE_PAD2_SPECIFIC_PORT ( 1 << 1 ) 32 | #define SCE_PAD2_SPECIFIC_DRIVER_NUMBER ( 1 << 2 ) 33 | #define SCE_PAD2_SPECIFIC_DEVICE_NAME ( 1 << 3 ) 34 | 35 | #define scePad2StateNoLink (0) 36 | #define scePad2StateStable (1) 37 | #define scePad2StateExecCmd (2) 38 | #define scePad2StateError (3) 39 | 40 | #define SCE_PAD2_SELECT (0) 41 | #define SCE_PAD2_L3 (1) 42 | #define SCE_PAD2_R3 (2) 43 | #define SCE_PAD2_START (3) 44 | #define SCE_PAD2_UP (4) 45 | #define SCE_PAD2_RIGHT (5) 46 | #define SCE_PAD2_DOWN (6) 47 | #define SCE_PAD2_LEFT (7) 48 | 49 | #define SCE_PAD2_L2 (8) 50 | #define SCE_PAD2_R2 (9) 51 | #define SCE_PAD2_L1 (10) 52 | #define SCE_PAD2_R1 (11) 53 | #define SCE_PAD2_TRIANGLE (12) 54 | #define SCE_PAD2_CIRCLE (13) 55 | #define SCE_PAD2_CROSS (14) 56 | #define SCE_PAD2_SQUARE (15) 57 | 58 | #define SCE_PAD2_STICK_RX (16) 59 | #define SCE_PAD2_STICK_RY (17) 60 | #define SCE_PAD2_STICK_LX (18) 61 | #define SCE_PAD2_STICK_LY (19) 62 | #define SCE_PAD2_ANALOG_RIGHT (20) 63 | #define SCE_PAD2_ANALOG_LEFT (21) 64 | #define SCE_PAD2_ANALOG_UP (22) 65 | #define SCE_PAD2_ANALOG_DOWN (23) 66 | 67 | #define SCE_PAD2_ANALOG_TRIANGLE (24) 68 | #define SCE_PAD2_ANALOG_CIRCLE (25) 69 | #define SCE_PAD2_ANALOG_CROSS (26) 70 | #define SCE_PAD2_ANALOG_SQUARE (27) 71 | #define SCE_PAD2_ANALOG_L1 (28) 72 | #define SCE_PAD2_ANALOG_R1 (29) 73 | #define SCE_PAD2_ANALOG_L2 (30) 74 | #define SCE_PAD2_ANALOG_R2 (31) 75 | 76 | typedef struct 77 | { 78 | unsigned int option; 79 | int port; 80 | int slot; 81 | int number; 82 | unsigned char name[ SCE_PAD2_MAX_DEVICE_NAME ]; 83 | } scePad2SocketParam; 84 | 85 | #if defined(__LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus) 86 | extern "C" { 87 | #endif 88 | int scePad2Init( int ); 89 | int scePad2End( void ); 90 | int scePad2CreateSocket( scePad2SocketParam*, u_long128* ); 91 | int scePad2DeleteSocket( int ); 92 | int scePad2Read( int, unsigned char* ); 93 | int scePad2GetButtonProfile( int, unsigned char* ); 94 | int scePad2GetState( int ); 95 | int scePad2GetButtonInfo( int, unsigned char*, int ); 96 | void scePad2StateIntToStr( int, unsigned char* ); 97 | #if defined(__LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus) 98 | } 99 | #endif 100 | 101 | #endif /* _LIBPAD2_H_ */ 102 | 103 | -------------------------------------------------------------------------------- /include/sdk/ee/sifcmd.h: -------------------------------------------------------------------------------- 1 | /* SCE CONFIDENTIAL 2 | "PlayStation 2" Programmer Tool Runtime Library Release 2.5 3 | */ 4 | /* 5 | * Emotion Engine Library 6 | * Version 0.1.0 7 | * Shift-JIS 8 | * 9 | * Copyright (C) 1998-1999 Sony Computer Entertainment Inc. 10 | * All Rights Reserved. 11 | * 12 | * sifcmd.h 13 | * develop library 14 | * 15 | * Version Date Design Log 16 | * -------------------------------------------------------------------- 17 | * 0.1.0 18 | */ 19 | 20 | #ifndef _SIFCMD_H_DEFS 21 | #define _SIFCMD_H_DEFS 22 | 23 | #if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus) 24 | extern "C" { 25 | #endif 26 | 27 | #define SIF_CMDI_SYSTEM 0x80000000 /* system func call , not user func*/ 28 | 29 | /* commnad packet header (128bit) */ 30 | typedef struct { 31 | unsigned int psize:8; /* packet size(min 16(hdr only),max 16*7)*/ 32 | unsigned int dsize:24;/* attended data size */ 33 | unsigned int daddr; /* attended data address */ 34 | unsigned int fcode; /* called function code */ 35 | unsigned int opt; /* system no use */ 36 | } sceSifCmdHdr; 37 | 38 | /* commnad packet handler */ 39 | typedef void (* sceSifCmdHandler)(void *, void *); 40 | 41 | /* structure of command packet handler & data */ 42 | typedef struct { 43 | sceSifCmdHandler func; 44 | void *data; 45 | } sceSifCmdData; 46 | 47 | /* system function (defalut) */ 48 | #define SIF_CMDC_CHANGE_SADDR ( SIF_CMDI_SYSTEM | 0x00000000) 49 | #define SIF_CMDC_SET_SREG ( SIF_CMDI_SYSTEM | 0x00000001) 50 | #define SIF_CMDC_INIT_CMD ( SIF_CMDI_SYSTEM | 0x00000002) 51 | #define SIF_CMDC_RESET_CMD ( SIF_CMDI_SYSTEM | 0x00000003) 52 | 53 | /* data structure for telling to change packet buffer address */ 54 | typedef struct { 55 | sceSifCmdHdr chdr; 56 | void *newaddr; 57 | } sceSifCmdCSData; /* System use */ 58 | 59 | /* data structure for telling to set software register[0 - 31] */ 60 | /* software register[0 - 7] used by system */ 61 | typedef struct { 62 | sceSifCmdHdr chdr; 63 | int rno; 64 | unsigned int value; 65 | } sceSifCmdSRData; 66 | 67 | /* data structure for reset iop modules */ 68 | typedef struct { 69 | sceSifCmdHdr chdr; 70 | int size; 71 | int flag; 72 | char arg[80]; 73 | } sceSifCmdResetData; /* System use */ 74 | 75 | /* */ 76 | void sceSifInitCmd(void); 77 | void sceSifExitCmd(void); 78 | 79 | /* get & set software register value */ 80 | unsigned int sceSifGetSreg(int); 81 | unsigned int sceSifSetSreg(int,unsigned int); 82 | 83 | sceSifCmdData * sceSifSetCmdBuffer(sceSifCmdData *, int); 84 | sceSifCmdData * sceSifSetSysCmdBuffer(sceSifCmdData *, int); /* System use */ 85 | 86 | void sceSifAddCmdHandler(unsigned int,sceSifCmdHandler,void *); 87 | void sceSifRemoveCmdHandler(unsigned int); 88 | 89 | unsigned int sceSifSendCmd(unsigned int,void *,int,void *, void *, int); 90 | unsigned int isceSifSendCmd(unsigned int,void *,int,void *, void *, int); 91 | 92 | void sceSifWriteBackDCache(const void *, int); /* EE only */ 93 | 94 | /* send mode */ 95 | #define SIF_CMDM_INTR 0x01 /* called in no intr area */ 96 | #define SIF_CMDM_TAG 0x02 /* */ 97 | #define SIF_CMDM_WBDC 0x04 /* write back atended data */ 98 | 99 | #if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus) 100 | } 101 | #endif 102 | 103 | #endif /* _SIFCMD_H_DEFS */ 104 | 105 | /* End of File */ 106 | -------------------------------------------------------------------------------- /include/sdk/ee/sifdev.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parappadev/parappa2/7c3f7d367adc1153143169e53e6373f93f25ce53/include/sdk/ee/sifdev.h -------------------------------------------------------------------------------- /include/sdk/libcdvd.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parappadev/parappa2/7c3f7d367adc1153143169e53e6373f93f25ce53/include/sdk/libcdvd.h -------------------------------------------------------------------------------- /progress/dbug_progress.json: -------------------------------------------------------------------------------- 1 | {"schemaVersion": 1, "label": "dbug", "message": "100.0000%", "color": "lime"} -------------------------------------------------------------------------------- /progress/iop_mdl_progress.json: -------------------------------------------------------------------------------- 1 | {"schemaVersion": 1, "label": "iop_mdl", "message": "100.0000%", "color": "lime"} -------------------------------------------------------------------------------- /progress/main_progress.json: -------------------------------------------------------------------------------- 1 | {"schemaVersion": 1, "label": "main", "message": "42.4552%", "color": "darkorange"} -------------------------------------------------------------------------------- /progress/menu_progress.json: -------------------------------------------------------------------------------- 1 | {"schemaVersion": 1, "label": "menu", "message": "15.2180%", "color": "crimson"} -------------------------------------------------------------------------------- /progress/nalib_progress.json: -------------------------------------------------------------------------------- 1 | {"schemaVersion": 1, "label": "nalib", "message": "0.0000%", "color": "crimson"} -------------------------------------------------------------------------------- /progress/os_progress.json: -------------------------------------------------------------------------------- 1 | {"schemaVersion": 1, "label": "os", "message": "100.0000%", "color": "lime"} -------------------------------------------------------------------------------- /progress/prlib_progress.json: -------------------------------------------------------------------------------- 1 | {"schemaVersion": 1, "label": "prlib", "message": "8.2809%", "color": "crimson"} -------------------------------------------------------------------------------- /progress/total_progress.json: -------------------------------------------------------------------------------- 1 | {"schemaVersion": 1, "label": "Total percentage", "message": "49.6649%", "color": "darkorange"} -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | spimdisasm>=1.32.0,<2.0.0 2 | rabbitizer 3 | splat64[mips]>=0.32.2,<1.0.0 4 | tqdm 5 | ninja_syntax 6 | mapfile_parser -------------------------------------------------------------------------------- /src/dbug/syori.c: -------------------------------------------------------------------------------- 1 | #include "dbug/syori.h" 2 | 3 | void SyoriLineInit(int bar_size) { 4 | /* Empty */ 5 | } 6 | 7 | void SyoriLineReset(void) { 8 | /* Empty */ 9 | } 10 | 11 | int SyoriLineCnt(int num) { 12 | return 0; 13 | } 14 | 15 | void SyoriLineDisp(short xp, short yp) { 16 | /* Empty */ 17 | } 18 | -------------------------------------------------------------------------------- /src/iop_mdl/tapctrl_rpc.c: -------------------------------------------------------------------------------- 1 | #include "iop_mdl/tapctrl_rpc.h" 2 | 3 | #include 4 | 5 | #define DATA_SIZE_NORMAL (16) 6 | #define TAPCT_DEV (0x8001) 7 | 8 | static u_int sbuff[16] PR_ALIGNED(64); 9 | static sceSifClientData gCd; 10 | 11 | int TapCtInit(void) { 12 | int i; 13 | 14 | while (1) { 15 | if (sceSifBindRpc(&gCd, TAPCT_DEV, 0) < 0) { 16 | while (1); 17 | } 18 | 19 | i = 10000; 20 | while (i--); 21 | 22 | if (gCd.serve != 0) { 23 | break; 24 | } 25 | } 26 | 27 | return 1; 28 | } 29 | 30 | int TapCt(int command, int data1, int data2) { 31 | int rsize = 0; 32 | 33 | if (command & 0x8000) { 34 | rsize = 64; 35 | } 36 | 37 | sbuff[0] = data1; 38 | sbuff[1] = data2; 39 | 40 | while (sceSifCallRpc(&gCd, command, 0, sbuff, DATA_SIZE_NORMAL, sbuff, rsize, NULL, NULL)) { 41 | printf("sceSifCallRpc tapctrl miss!\n"); 42 | } 43 | 44 | return sbuff[0]; 45 | } 46 | -------------------------------------------------------------------------------- /src/iop_mdl/wp2cd_rpc.c: -------------------------------------------------------------------------------- 1 | #include "iop_mdl/wp2cd_rpc.h" 2 | 3 | #include <../libcdvd.h> 4 | 5 | #define DATA_SIZE_STRING (64) 6 | #define DATA_SIZE_NORMAL (16) 7 | 8 | static u_int sbuff[64] PR_ALIGNED(64); 9 | static sceSifClientData gCd; 10 | 11 | int WP2Init(void) { 12 | int i; 13 | 14 | while (1) { 15 | if (sceSifBindRpc(&gCd, WP2_DEV, 0) < 0) { 16 | while (1); 17 | } 18 | 19 | i = 10000; 20 | while (i--); 21 | 22 | if (gCd.serve != 0) { 23 | break; 24 | } 25 | } 26 | 27 | return 1; 28 | } 29 | 30 | int WP2Ctrl(int command, int data0) { 31 | if (command == WP2_OPENFLOC || command == WP2_SEEKFLOC) { 32 | *(sceCdlFILE*)sbuff = *(sceCdlFILE*)data0; 33 | 34 | strcpy((char*)sbuff, (char*)data0); 35 | FlushCache(0); 36 | 37 | while (sceSifCallRpc(&gCd, command, 0, sbuff, DATA_SIZE_STRING, sbuff, 64, NULL, NULL)) { 38 | printf("sceSifCallRpc wp2cd miss!\n"); 39 | } 40 | } else { 41 | if (command == 0x8002) { 42 | strcpy((char*)sbuff, (char*)data0); 43 | FlushCache(0); 44 | 45 | while (sceSifCallRpc(&gCd, command, 0, (void*)data0, DATA_SIZE_STRING, sbuff, 64, 0, 0)) { 46 | printf("sceSifCallRpc wp2cd miss!\n"); 47 | } 48 | } else { 49 | sbuff[0] = data0; 50 | FlushCache(0); 51 | 52 | while (sceSifCallRpc(&gCd, command, 0, sbuff, DATA_SIZE_NORMAL, sbuff, 64, NULL, NULL)) { 53 | printf("sceSifCallRpc wp2cd miss!\n"); 54 | } 55 | } 56 | } 57 | 58 | return sbuff[0]; 59 | } 60 | -------------------------------------------------------------------------------- /src/main/fadectrl.c: -------------------------------------------------------------------------------- 1 | #include "main/fadectrl.h" 2 | 3 | static tGS_BGCOLOR bgcolor_tmp[2] = {{}, {255, 255, 255, 0, 0}}; 4 | int _data_pad_fadectrl_[] = { 0 }; /* pad */ 5 | 6 | static FMODE_CTRL_STR fmode_ctrl_str; 7 | 8 | void FadeCtrlMain(void *x) { 9 | int tmp_time; 10 | FADE_MAKE_STR fade_make_str; 11 | 12 | fade_make_str.r = bgcolor_tmp[fmode_ctrl_str.fmode & 255].R; 13 | fade_make_str.g = bgcolor_tmp[fmode_ctrl_str.fmode & 255].G; 14 | fade_make_str.b = bgcolor_tmp[fmode_ctrl_str.fmode & 255].B; 15 | 16 | if (fmode_ctrl_str.current_time < fmode_ctrl_str.max_time) { 17 | while (fmode_ctrl_str.current_time < fmode_ctrl_str.max_time) { 18 | tmp_time = fmode_ctrl_str.current_time; 19 | 20 | if ((fmode_ctrl_str.fmode & FMODE_BLACK_OUT) == 0) { 21 | tmp_time = fmode_ctrl_str.max_time - fmode_ctrl_str.current_time; 22 | } 23 | 24 | fade_make_str.alp = (tmp_time * 128) / fmode_ctrl_str.max_time; 25 | CG_FadeDisp(&fade_make_str, 100, NULL); 26 | 27 | fmode_ctrl_str.current_time++; 28 | MtcWait(1); 29 | } 30 | } 31 | 32 | MtcExit(); 33 | } 34 | 35 | void FadeCtrlReq(FADE_MODE fmode, int time) { 36 | fmode_ctrl_str.current_time = 0; 37 | fmode_ctrl_str.fmode = fmode; 38 | fmode_ctrl_str.max_time = time; 39 | 40 | MtcExec(FadeCtrlMain, MTC_TASK_FACECTRL); 41 | } 42 | -------------------------------------------------------------------------------- /src/main/pack.c: -------------------------------------------------------------------------------- 1 | #include "main/pack.h" 2 | 3 | u_int PackGetDecodeSize(u_char *fp_r) { 4 | return *(u_int*)fp_r; 5 | } 6 | 7 | INCLUDE_ASM("main/pack", PackDecode); 8 | 9 | #ifndef NON_MATCHING 10 | INCLUDE_ASM("main/pack", PackGetAdrs); 11 | #else 12 | int PackGetAdrs(/* a0 4 */ u_int adrs, /* a1 5 */ int num) 13 | { 14 | if (PACK(adrs)->pack_header.fcnt <= num) 15 | return -1; 16 | } 17 | #endif 18 | 19 | INCLUDE_ASM("main/pack", PackDbgList); 20 | -------------------------------------------------------------------------------- /src/menu/mntm2hed.c: -------------------------------------------------------------------------------- 1 | #include "menu/mntm2hed.h" 2 | 3 | /* .data */ 4 | extern MENU_TM2_HED menu_tm2_hed[]; /* size: 105 */ 5 | 6 | MENU_TM2_HED* TsGetTM2Hed(int no) { 7 | return &menu_tm2_hed[no]; 8 | } 9 | -------------------------------------------------------------------------------- /src/nalib/namatrix.h: -------------------------------------------------------------------------------- 1 | #ifndef NALIB_NAMATRIX_H 2 | #define NALIB_NAMATRIX_H 3 | 4 | template 5 | struct NaMATRIX { 6 | T m[width][height]; 7 | }; 8 | 9 | #endif -------------------------------------------------------------------------------- /src/nalib/navector.h: -------------------------------------------------------------------------------- 1 | #ifndef NALIB_NAVECTOR_H 2 | #define NALIB_NAVECTOR_H 3 | 4 | template 5 | struct NaVECTOR { 6 | T v[size]; 7 | }; 8 | 9 | #endif -------------------------------------------------------------------------------- /src/os/usrmem.c: -------------------------------------------------------------------------------- 1 | #include "os/usrmem.h" 2 | 3 | /* .bss */ 4 | extern char usrMemoryData[25690112]; /* ~25 MB */ 5 | extern u_int usrMemPos[2048]; 6 | 7 | /* .sbss */ 8 | static int usrMemPosCnt; 9 | static int usrMemPosEndCnt; 10 | 11 | void UsrMemClear(void) { 12 | usrMemPos[0] = (u_int)usrMemoryData; 13 | usrMemPos[2047] = (u_int)usrMemoryData + sizeof(usrMemoryData); 14 | 15 | usrMemPosCnt = 0; 16 | usrMemPosEndCnt = 0; 17 | } 18 | 19 | void UsrMemClearTop(void) { 20 | usrMemPosCnt = 0; 21 | usrMemPos[0] = (u_int)usrMemoryData; 22 | } 23 | 24 | void UsrMemClearEnd(void) { 25 | usrMemPosEndCnt = 0; 26 | usrMemPos[2047] = (u_int)usrMemoryData + sizeof(usrMemoryData); 27 | } 28 | 29 | u_int UsrMemGetAdr(int id) { 30 | if (id >= usrMemPosCnt) { 31 | printf("UsrMemGetAdr ID over[%d]\n", id); 32 | return 0; 33 | } 34 | 35 | return usrMemPos[id]; 36 | } 37 | 38 | u_int UsrMemGetSize(int id) { 39 | if (id >= usrMemPosCnt) { 40 | printf("UsrMemGetSize ID over[%d]\n", id); 41 | return 0; 42 | } 43 | 44 | return usrMemPos[id + 1] - usrMemPos[id]; 45 | } 46 | 47 | u_int UsrMemGetEndAdr(int id) { 48 | if (id >= usrMemPosEndCnt) { 49 | printf("UsrMemGetEndAdr ID over[%d]\n", id); 50 | return 0; 51 | } 52 | 53 | return usrMemPos[2047 - id]; 54 | } 55 | 56 | u_int UsrMemGetEndSize(int id){ 57 | if (id >= usrMemPosEndCnt) { 58 | printf("UsrMemGetEndSize ID over[%d]\n", id); 59 | return 0; 60 | } 61 | 62 | return usrMemPos[2047 - id] - usrMemPos[2046 - id]; 63 | } 64 | 65 | u_int UsrMemAllocNext(void) { 66 | return usrMemPos[usrMemPosCnt]; 67 | } 68 | 69 | u_int UsrMemAllocEndNext(void) { 70 | return usrMemPos[2047 - usrMemPosEndCnt]; 71 | } 72 | 73 | u_int UsrMemAlloc(int size) { 74 | u_int ret = UsrMemAllocNext(); 75 | 76 | usrMemPosCnt++; 77 | usrMemPos[usrMemPosCnt] = ret + ((size + 15) / 16) * 16; 78 | 79 | if (usrMemPos[usrMemPosCnt] > UsrMemAllocEndNext()) { 80 | printf("UsrMemAlloc size over [0x%08x]\n", usrMemPos[usrMemPosCnt] - UsrMemAllocEndNext()); 81 | usrMemPosCnt--; 82 | return 0; 83 | } 84 | 85 | return ret; 86 | } 87 | 88 | u_int UsrMemEndAlloc(int size) { 89 | u_int ret = UsrMemAllocEndNext() - ((size + 15) / 16) * 16; 90 | 91 | if (ret < UsrMemAllocNext()) { 92 | printf("UsrMemEndAlloc size over [0x%08x]\n", UsrMemAllocNext() - ret); 93 | return 0; 94 | } 95 | 96 | usrMemPosEndCnt++; 97 | usrMemPos[2047 - usrMemPosEndCnt] = ret; 98 | return ret; 99 | } 100 | 101 | void UsrMemFree(void) { 102 | if (usrMemPosCnt) { 103 | usrMemPosCnt--; 104 | } 105 | } 106 | 107 | void UsrMemEndFree(void) { 108 | if (usrMemPosEndCnt) { 109 | usrMemPosEndCnt--; 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /src/prlib/animation.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | INCLUDE_ASM("prlib/animation", Initialize__13SpaFileHeader); 4 | -------------------------------------------------------------------------------- /src/prlib/animation.h: -------------------------------------------------------------------------------- 1 | #ifndef PRLIB_ANIMATION_H 2 | #define PRLIB_ANIMATION_H 3 | 4 | struct SpaFileHeader { 5 | char unk0[0x14]; 6 | float unk14; 7 | }; 8 | 9 | #endif -------------------------------------------------------------------------------- /src/prlib/billboard.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | INCLUDE_ASM("prlib/billboard", CreateBillboardMatrix__FRCt8NaMATRIX3Zfi4i4); 4 | 5 | INCLUDE_ASM("prlib/billboard", ApplyBillboardMatrix__7SpmNode); 6 | 7 | /* nalib/navector.h */ 8 | INCLUDE_ASM("prlib/billboard", func_0014C4E8); 9 | 10 | INCLUDE_ASM("prlib/billboard", func_0014C540); 11 | 12 | INCLUDE_ASM("prlib/billboard", func_0014C5F0); 13 | -------------------------------------------------------------------------------- /src/prlib/camera.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | INCLUDE_ASM("prlib/camera", Initialize__13SpcFileHeader); 4 | 5 | INCLUDE_ASM("prlib/camera", GetCamera__C13SpcFileHeaderf); 6 | 7 | /* nalib/navector.h */ 8 | INCLUDE_ASM("prlib/camera", func_00153AD0); 9 | 10 | INCLUDE_ASM("prlib/camera", func_00153B28); 11 | 12 | INCLUDE_ASM("prlib/camera", func_00153BD8); 13 | -------------------------------------------------------------------------------- /src/prlib/camera.h: -------------------------------------------------------------------------------- 1 | #ifndef PRLIB_CAMERA_H 2 | #define PRLIB_CAMERA_H 3 | 4 | struct SpcFileHeader {}; 5 | 6 | #endif -------------------------------------------------------------------------------- /src/prlib/cluster.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | INCLUDE_ASM("prlib/cluster", RenderClusterNode__22SpmClusterGeometryNodeP13PrModelObject); 4 | -------------------------------------------------------------------------------- /src/prlib/contour.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | INCLUDE_ASM("prlib/contour", SaveContour__13PrModelObject); 4 | 5 | INCLUDE_ASM("prlib/contour", SaveContour__14SpmComplexNodeP13PrModelObject); 6 | 7 | INCLUDE_ASM("prlib/contour", ResetContour__13PrModelObject); 8 | 9 | INCLUDE_ASM("prlib/contour", RenderContour__14SpmComplexNodeP13PrModelObject); 10 | -------------------------------------------------------------------------------- /src/prlib/database.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | INCLUDE_ASM("prlib/database", __16PrObjectDatabase); 4 | 5 | INCLUDE_ASM("prlib/database", _$_16PrObjectDatabase); 6 | 7 | INCLUDE_ASM("prlib/database", Initialize__16PrObjectDatabase); 8 | 9 | INCLUDE_ASM("prlib/database", Cleanup__16PrObjectDatabase); 10 | 11 | INCLUDE_ASM("prlib/database", CreateScene__16PrObjectDatabaseP13sceGsDrawEnv1PCcUi); 12 | 13 | INCLUDE_ASM("prlib/database", DeleteScene__16PrObjectDatabaseP13PrSceneObject); 14 | 15 | INCLUDE_ASM("prlib/database", _GLOBAL_$D$prObjectDatabase); 16 | 17 | INCLUDE_ASM("prlib/database", _GLOBAL_$I$prObjectDatabase); 18 | 19 | /* objectset.h */ 20 | INCLUDE_ASM("prlib/database", _$_t11PrObjectSet1Z13SpcFileHeader); 21 | 22 | INCLUDE_ASM("prlib/database", _$_t11PrObjectSet1Z13SpaFileHeader); 23 | 24 | INCLUDE_ASM("prlib/database", _$_t11PrObjectSet1Z13PrSceneObject); 25 | -------------------------------------------------------------------------------- /src/prlib/database.h: -------------------------------------------------------------------------------- 1 | #ifndef PRLIB_DATABASE_H 2 | #define PRLIB_DATABASE_H 3 | 4 | #include "prlib/scene.h" 5 | 6 | #include 7 | #include 8 | 9 | class PrObjectDatabase { 10 | public: 11 | void Initialize(); 12 | void Cleanup(); 13 | PrSceneObject* CreateScene(sceGsDrawEnv1 *drawEnv, const char *name, u_int fbp); 14 | void DeleteScene(PrSceneObject *scene); 15 | public: 16 | PrSceneObject *unk0; 17 | char unk4[0xb]; 18 | }; 19 | 20 | extern PrObjectDatabase prObjectDatabase; 21 | 22 | #endif -------------------------------------------------------------------------------- /src/prlib/depthfield.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | INCLUDE_ASM("prlib/depthfield", ApplyDepthOfField__13PrSceneObject); 4 | 5 | /* nalib/napacket.h */ 6 | INCLUDE_ASM("prlib/depthfield", func_0014CD38); 7 | 8 | INCLUDE_ASM("prlib/depthfield", func_0014CD48); 9 | 10 | INCLUDE_ASM("prlib/depthfield", func_0014CDA0); 11 | 12 | INCLUDE_ASM("prlib/depthfield", func_0014CDA8); 13 | 14 | INCLUDE_ASM("prlib/depthfield", func_0014CDB0); 15 | 16 | INCLUDE_ASM("prlib/depthfield", func_0014CDB8); 17 | 18 | INCLUDE_ASM("prlib/depthfield", func_0014CDC0); 19 | 20 | INCLUDE_ASM("prlib/depthfield", func_0014CDC8); 21 | -------------------------------------------------------------------------------- /src/prlib/dma.cpp: -------------------------------------------------------------------------------- 1 | #include "dma.h" 2 | 3 | #include 4 | 5 | #define PR_CHCR volatile tD_CHCR 6 | 7 | void PrWaitDmaFinish(u_int dmaChannel) { 8 | static PR_CHCR* chcr_table[12] = { 9 | (tD_CHCR*)D0_CHCR, 10 | (tD_CHCR*)D1_CHCR, 11 | (tD_CHCR*)D2_CHCR, 12 | (tD_CHCR*)D3_CHCR, 13 | (tD_CHCR*)D4_CHCR, 14 | (tD_CHCR*)D5_CHCR, 15 | (tD_CHCR*)D6_CHCR, 16 | (tD_CHCR*)D7_CHCR, 17 | (tD_CHCR*)D8_CHCR, 18 | (tD_CHCR*)D9_CHCR, 19 | NULL, 20 | NULL, 21 | }; 22 | 23 | PR_CHCR* chcr = chcr_table[dmaChannel]; 24 | 25 | if (dmaChannel >= 8) { 26 | while (chcr->STR & 1); 27 | return; 28 | } 29 | 30 | *D_STAT = PR_BIT(dmaChannel); 31 | if (chcr->STR & 1) { 32 | u_int pcr = *D_PCR; 33 | u_int pcrOld = pcr; 34 | 35 | pcr &= ~0x3ff; 36 | pcr |= PR_BIT(dmaChannel); 37 | 38 | *D_PCR = pcr; 39 | asm("sync.l"); 40 | 41 | asm volatile( 42 | "cpcond0_wait_loop: \n\t" 43 | " bc0f cpcond0_wait_loop \n\t" 44 | " nop \n\t" 45 | ); 46 | 47 | *D_STAT = PR_BIT(dmaChannel); 48 | *D_PCR = pcrOld; 49 | } 50 | } 51 | 52 | /* nalib/navector.h */ 53 | INCLUDE_ASM("prlib/dma", func_001544A8); 54 | 55 | INCLUDE_ASM("prlib/dma", func_00154558); 56 | 57 | INCLUDE_ASM("prlib/dma", func_00154580); 58 | 59 | /* nalib/navector.cpp */ 60 | INCLUDE_ASM("prlib/dma", func_001545D8); 61 | -------------------------------------------------------------------------------- /src/prlib/dma.h: -------------------------------------------------------------------------------- 1 | #ifndef PRLIB_DMA_H 2 | #define PRLIB_DMA_H 3 | 4 | #include "common.h" 5 | 6 | #include 7 | 8 | void PrWaitDmaFinish(u_int dmaChannel); 9 | 10 | #endif -------------------------------------------------------------------------------- /src/prlib/dmaqueue.cpp: -------------------------------------------------------------------------------- 1 | #include "dmaqueue.h" 2 | 3 | #include 4 | 5 | #include 6 | 7 | #define PR_DECACHE(addr) ((u_int)(addr) & 0x0fffffff) 8 | 9 | PrDmaQueue::PrDmaQueue(u_int size) { 10 | this->unk4 = size; 11 | this->unk0 = (PrDmaList*)memalign(128, (size + 1) * 128); 12 | 13 | Initialize(); 14 | FlushCache(0); 15 | 16 | this->unk8 = 0; 17 | this->unkC = 0; 18 | 19 | this->unk0 = (PrDmaList*)PR_UNCACHEDACCEL(this->unk0); 20 | } 21 | 22 | PrDmaQueue::~PrDmaQueue() { 23 | if (this->unk0 != NULL) { 24 | free((void*)PR_DECACHE(this->unk0)); 25 | } 26 | } 27 | 28 | // Different compiler matches without any of the volatile trickery 29 | // https://decomp.me/scratch/PcirV 30 | void PrDmaQueue::Initialize() { 31 | u_int i; 32 | PrDmaList *temp_v1; 33 | volatile PrDmaList *var_v1; 34 | 35 | for (i = 0; i <= this->unk4; i++) { 36 | temp_v1 = (PrDmaList*)&this->unk0[i]; 37 | 38 | var_v1 = temp_v1; 39 | var_v1->unk30.next = (sceDmaTag*)&var_v1[1].unk10; 40 | 41 | var_v1->unk0 = 0; 42 | var_v1->unk4 = 0; 43 | var_v1->unk8 = 0; 44 | var_v1->unkC = 0; 45 | 46 | var_v1->unk10.qwc = 1; 47 | var_v1->unk10.mark = 0; 48 | var_v1->unk10.id = 0x40; 49 | var_v1->unk10.next = (sceDmaTag*)var_v1; 50 | var_v1->unk10.p[0] = 0; 51 | var_v1->unk10.p[1] = 0; 52 | 53 | var_v1->unk20.qwc = 0; 54 | var_v1->unk20.mark = 0; 55 | var_v1->unk20.id = 0x50; 56 | var_v1->unk20.p[0] = 0; 57 | var_v1->unk20.p[1] = 0; 58 | 59 | var_v1->unk30.qwc = 0; 60 | var_v1->unk30.mark = 0; 61 | var_v1->unk30.id = 0x20; 62 | var_v1->unk30.p[0] = 0; 63 | temp_v1->unk30.p[1] = 0; 64 | } 65 | } 66 | 67 | // https://decomp.me/scratch/tVeBn 68 | INCLUDE_ASM("prlib/dmaqueue", Start__10PrDmaQueue); 69 | 70 | // https://decomp.me/scratch/yrbTv 71 | INCLUDE_ASM("prlib/dmaqueue", Append__10PrDmaQueuePv); 72 | 73 | // https://decomp.me/scratch/feA56 74 | INCLUDE_ASM("prlib/dmaqueue", Wait__10PrDmaQueue); 75 | -------------------------------------------------------------------------------- /src/prlib/dmaqueue.h: -------------------------------------------------------------------------------- 1 | #ifndef DMAQUEUE_H 2 | #define DMAQUEUE_H 3 | 4 | #include "common.h" 5 | 6 | #include 7 | #include 8 | 9 | struct PrDmaList { 10 | int unk0; 11 | int unk4; 12 | int unk8; 13 | int unkC; 14 | 15 | sceDmaTag unk10; 16 | sceDmaTag unk20; 17 | sceDmaTag unk30; 18 | 19 | char unk40[64]; 20 | }; 21 | 22 | class PrDmaQueue { 23 | public: 24 | PrDmaQueue(u_int size); 25 | ~PrDmaQueue(); 26 | 27 | void Initialize(); 28 | private: 29 | PrDmaList* unk0; 30 | int unk4; 31 | int unk8; 32 | int unkC; 33 | }; 34 | 35 | #endif -------------------------------------------------------------------------------- /src/prlib/gifreg.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | INCLUDE_ASM("prlib/gifreg", Append__27PrDmaStripForSetGifRegisterUiRCUl); 4 | 5 | INCLUDE_ASM("prlib/gifreg", Freeze__27PrDmaStripForSetGifRegisterUcPCv); 6 | 7 | INCLUDE_RODATA("prlib/gifreg", D_00396748); 8 | 9 | INCLUDE_ASM("prlib/gifreg", PrInitializeDmaStripGifRegister__FG9sceGsZbuf); 10 | 11 | INCLUDE_ASM("prlib/gifreg", PrGetDmaStripGifRegister__F20PrSetGifRegisterMode); 12 | 13 | INCLUDE_ASM("prlib/gifreg", _GLOBAL_$D$Append__27PrDmaStripForSetGifRegisterUiRCUl); 14 | 15 | INCLUDE_ASM("prlib/gifreg", _GLOBAL_$I$Append__27PrDmaStripForSetGifRegisterUiRCUl); 16 | 17 | INCLUDE_ASM("prlib/gifreg", _$_27PrDmaStripForSetGifRegister); 18 | -------------------------------------------------------------------------------- /src/prlib/menderer.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | INCLUDE_ASM("prlib/menderer", InitializeNoodleStripRendering__FUiUiUiUi); 4 | 5 | INCLUDE_ASM("prlib/menderer", GetRandom__Fv); 6 | 7 | INCLUDE_ASM("prlib/menderer", StageIndexForColor__Fv); 8 | 9 | INCLUDE_ASM("prlib/menderer", PushNoodleColor__FPUl); 10 | 11 | INCLUDE_ASM("prlib/menderer", DrawNoodleStripChunk__FRCt8NaMATRIX3Zfi4i4); 12 | 13 | INCLUDE_ASM("prlib/menderer", SetNoodleRotationMatrix__FRt8NaMATRIX3Zfi4i4f); 14 | 15 | INCLUDE_ASM("prlib/menderer", PreDrawNoodleStrip__Fv); 16 | 17 | INCLUDE_ASM("prlib/menderer", DrawNoodleStrip__Fff); 18 | 19 | INCLUDE_ASM("prlib/menderer", StartNoodleRotation__Fv); 20 | 21 | INCLUDE_ASM("prlib/menderer", UpdateNoodleRotation__Fv); 22 | 23 | INCLUDE_ASM("prlib/menderer", PrUpdateMendererSpeed__Fv); 24 | 25 | INCLUDE_ASM("prlib/menderer", PrDecelerateMenderer); 26 | 27 | INCLUDE_ASM("prlib/menderer", PrRestartMenderer); 28 | 29 | INCLUDE_ASM("prlib/menderer", DrawMenderer__Fv); 30 | 31 | INCLUDE_ASM("prlib/menderer", PrSetMendererRatio); 32 | 33 | INCLUDE_ASM("prlib/menderer", PrGetMendererRatio); 34 | 35 | INCLUDE_ASM("prlib/menderer", PrSetMendererDirection); 36 | 37 | INCLUDE_ASM("prlib/menderer", PrGetMendererDirection); 38 | 39 | INCLUDE_ASM("prlib/menderer", PrSetMendererColorModulation); 40 | 41 | INCLUDE_ASM("prlib/menderer", PrIsMendererColorModulation); 42 | 43 | INCLUDE_ASM("prlib/menderer", PrInitializeMenderer); 44 | 45 | INCLUDE_ASM("prlib/menderer", PrRenderMenderer); 46 | 47 | /* nalib/navector.h */ 48 | INCLUDE_ASM("prlib/menderer", func_0014F3B8); 49 | 50 | INCLUDE_ASM("prlib/menderer", func_0014F410); 51 | 52 | /* prlib/menderer.cpp */ 53 | PR_EXTERN 54 | void _GLOBAL_$I$prMendererRatio(void) { 55 | } 56 | 57 | /* nalib/navector.h */ 58 | INCLUDE_ASM("prlib/menderer", func_0014F4C8); 59 | 60 | INCLUDE_ASM("prlib/menderer", func_0014F5D0); 61 | 62 | INCLUDE_ASM("prlib/menderer", func_0014F6D8); 63 | 64 | /* prlib/menderer.cpp */ 65 | INCLUDE_RODATA("prlib/menderer", D_003967E0); 66 | 67 | INCLUDE_RODATA("prlib/menderer", D_003967F0); 68 | -------------------------------------------------------------------------------- /src/prlib/mendereralpha.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | INCLUDE_ASM("prlib/mendereralpha", PrInitializeAlphaModulation__Fv); 4 | 5 | INCLUDE_ASM("prlib/mendereralpha", PrCreateAlphaModulation__Ff); 6 | 7 | INCLUDE_ASM("prlib/mendereralpha", PrBlendNoodleImage__Fb); 8 | 9 | INCLUDE_RODATA("prlib/mendereralpha", D_00396980); 10 | 11 | INCLUDE_RODATA("prlib/mendereralpha", D_00396990); 12 | -------------------------------------------------------------------------------- /src/prlib/mendererawful.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | #include "prlib/dma.h" 4 | #include "prlib/random.h" 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | /* data */ 12 | extern u_long mendererFadeData[7][2]; 13 | 14 | /* sbss */ 15 | extern u_int mendererAwfulColor; 16 | extern u_int awfulChangeTimer; 17 | 18 | void SetNextSwitchRotationTimer() { 19 | awfulChangeTimer = (u_int)((PrFloatRandom() * 4.0f + 3.0f) * 60.0f); 20 | } 21 | 22 | INCLUDE_ASM("prlib/mendererawful", GetAwfulRotation__Fv); 23 | 24 | INCLUDE_ASM("prlib/mendererawful", PrStartAwfulRotation__Fv); 25 | 26 | void PrFadeFrameImage(float arg0) { 27 | if (arg0 == 0.0f) { 28 | return; 29 | } 30 | 31 | u_int alp = (u_int)(arg0 * 128.0f + 0.5f); 32 | mendererFadeData[3][0] = 33 | SCE_GS_SET_RGBAQ( 34 | (mendererAwfulColor >> 0 ) & 255, 35 | (mendererAwfulColor >> 8 ) & 255, 36 | (mendererAwfulColor >> 16) & 255, 37 | alp & 255, 38 | 0 39 | ); 40 | 41 | sceDmaChan *chan = sceDmaGetChan(SCE_DMA_GIF); 42 | chan->chcr.TTE = 0; 43 | 44 | FlushCache(0); 45 | PrWaitDmaFinish(SCE_DMA_GIF); 46 | sceDmaSendN(chan, &mendererFadeData, 7); 47 | } 48 | 49 | INCLUDE_ASM("prlib/mendererawful", PrInitializeAwfulBackground__FPv); 50 | 51 | INCLUDE_ASM("prlib/mendererawful", PrDrawAwfulBackground__FG10sceGsFrame); 52 | 53 | INCLUDE_ASM("prlib/mendererawful", PrUpdateAwfulMenderer__Fv); 54 | 55 | /* nalib/navector.h */ 56 | INCLUDE_ASM("prlib/mendererawful", func_00150CE8); 57 | 58 | INCLUDE_ASM("prlib/mendererawful", func_00150D10); 59 | -------------------------------------------------------------------------------- /src/prlib/menderercreate.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | INCLUDE_ASM("prlib/menderercreate", PrSynchronizeMendererParameter__Ff); 4 | 5 | INCLUDE_ASM("prlib/menderercreate", PrInitializeTextureCreation__FUiUiUiUi); 6 | 7 | INCLUDE_ASM("prlib/menderercreate", CreateMendererTexture__Ff); 8 | 9 | INCLUDE_ASM("prlib/menderercreate", PrCreateMendererTexture); 10 | 11 | INCLUDE_ASM("prlib/menderercreate", PrWaitMendererTexture__FP13sceGsDrawEnv1RC10sceGsFrameRC13sceGsXyoffset); 12 | 13 | INCLUDE_RODATA("prlib/menderercreate", D_00396800); 14 | -------------------------------------------------------------------------------- /src/prlib/mendererdata.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | INCLUDE_ASM("prlib/mendererdata", SetNextTarget__FP20PrNoodlePositionData); 4 | 5 | INCLUDE_ASM("prlib/mendererdata", InitializeNoodlePositionData__Fv); 6 | 7 | INCLUDE_ASM("prlib/mendererdata", UpdateNoodlePositionData__FP20PrNoodlePositionData); 8 | 9 | INCLUDE_ASM("prlib/mendererdata", GetSynchronizeRatio__FPC20PrNoodlePositionData); 10 | 11 | INCLUDE_ASM("prlib/mendererdata", PrInitializeNoodlePolygonPosition__Fv); 12 | 13 | INCLUDE_ASM("prlib/mendererdata", PrGetNoodlePolygonPosition__FPt8NaVECTOR2Zfi4Ui); 14 | 15 | /* nalib/navector.h */ 16 | INCLUDE_ASM("prlib/mendererdata", func_00151D78); 17 | 18 | INCLUDE_ASM("prlib/mendererdata", func_00151DA0); 19 | 20 | INCLUDE_ASM("prlib/mendererdata", func_00151DF8); 21 | -------------------------------------------------------------------------------- /src/prlib/mfifo.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | INCLUDE_ASM("prlib/mfifo", PrInitializeMfifo__Fv); 4 | 5 | INCLUDE_ASM("prlib/mfifo", PrCleanupMfifo__Fv); 6 | 7 | INCLUDE_ASM("prlib/mfifo", PrStartMfifo__Fv); 8 | 9 | INCLUDE_ASM("prlib/mfifo", PrStopMfifo__Fv); 10 | 11 | INCLUDE_ASM("prlib/mfifo", PrWaitMfifo__Fv); 12 | 13 | INCLUDE_ASM("prlib/mfifo", PrSendMfifo__FPC10_sceDmaTag); 14 | 15 | INCLUDE_ASM("prlib/mfifo", PrMfifoUnsentDataSize__Fv); 16 | -------------------------------------------------------------------------------- /src/prlib/microprogram.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | INCLUDE_ASM("prlib/microprogram", CalculateEntryPoint__Fv); 4 | 5 | INCLUDE_ASM("prlib/microprogram", PrLoadMicroPrograms__Fv); 6 | 7 | INCLUDE_ASM("prlib/microprogram", PrGetMicroProgramAddress__F22PrMICRO_PROGRAM_MODULE); 8 | 9 | INCLUDE_ASM("prlib/microprogram", PrGetInputVertexParameterNum__F22PrMICRO_PROGRAM_MODULE); 10 | 11 | INCLUDE_ASM("prlib/microprogram", PrGetInputVertexParameterSet__F22PrMICRO_PROGRAM_MODULE); 12 | 13 | INCLUDE_ASM("prlib/microprogram", PrGetOutputVertexParameterNum__F22PrMICRO_PROGRAM_MODULE); 14 | 15 | INCLUDE_ASM("prlib/microprogram", PrGetOutputVertexParameterSet__F22PrMICRO_PROGRAM_MODULE); 16 | 17 | INCLUDE_ASM("prlib/microprogram", PrGetMendererCreateTextureAddress__Fv); 18 | 19 | INCLUDE_ASM("prlib/microprogram", PrGetMendererDrawMeshAddress__Fv); 20 | -------------------------------------------------------------------------------- /src/prlib/microprogram.h: -------------------------------------------------------------------------------- 1 | #ifndef PRLIB_MICROPROGRAM_H 2 | #define PRLIB_MICROPROGRAM_H 3 | 4 | enum PrMICRO_PROGRAM_MODULE { 5 | ePrMicroProgram_Unk2 = 2, 6 | }; 7 | 8 | int PrGetMicroProgramAddress(PrMICRO_PROGRAM_MODULE); 9 | 10 | #endif -------------------------------------------------------------------------------- /src/prlib/model.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | INCLUDE_ASM("prlib/model", PrSetPostureWorkArea); 4 | 5 | INCLUDE_ASM("prlib/model", AllocateFromWorkArea__FUi); 6 | 7 | INCLUDE_ASM("prlib/model", __13PrModelObjectP13SpmFileHeader); 8 | 9 | INCLUDE_ASM("prlib/model", _$_13PrModelObject); 10 | 11 | INCLUDE_ASM("prlib/model", Initialize__13PrModelObject); 12 | 13 | INCLUDE_ASM("prlib/model", LinkAnimation__13PrModelObjectP13SpaFileHeader); 14 | 15 | INCLUDE_ASM("prlib/model", CleanupAnimation__13PrModelObject); 16 | 17 | INCLUDE_ASM("prlib/model", LinkPositionAnimation__13PrModelObjectP13SpaFileHeader); 18 | 19 | INCLUDE_ASM("prlib/model", CleanupPositionAnimation__13PrModelObject); 20 | 21 | INCLUDE_ASM("prlib/model", UnionBoundaryBox__13PrModelObjectPt8NaVECTOR2Zfi4T1); 22 | 23 | INCLUDE_ASM("prlib/model", GetPrimitivePosition__13PrModelObjectPt8NaVECTOR2Zfi4); 24 | 25 | INCLUDE_ASM("prlib/model", GetScreenPosition__13PrModelObjectPt8NaVECTOR2Zfi4); 26 | 27 | /* nalib/navector.h */ 28 | INCLUDE_ASM("prlib/model", func_00140E38); 29 | -------------------------------------------------------------------------------- /src/prlib/model.h: -------------------------------------------------------------------------------- 1 | #ifndef PRLIB_MODEL_H 2 | #define PRLIB_MODEL_H 3 | 4 | #include 5 | 6 | #include "prlib/microprogram.h" 7 | 8 | #include "nalib/navector.h" 9 | 10 | struct SpmFileHeader; 11 | 12 | struct SpmNodeUnk { 13 | char unk0[0x60]; 14 | PrMICRO_PROGRAM_MODULE unk60; 15 | char unk64[0x130]; 16 | int unk194; 17 | }; 18 | 19 | struct SpmNode { 20 | public: 21 | char unk0[0x154]; 22 | int unk154; 23 | SpmFileHeader* unk158; 24 | SpmNode* unk15C; 25 | SpmNode* unk160; 26 | SpmNode* unk164; 27 | char unk168[0x4]; 28 | SpmNodeUnk* unk16C[2]; 29 | char unk174[0x8]; 30 | int unk17C; 31 | char unk180[0x17]; 32 | int unk198; 33 | char unk19C[0x4]; 34 | int unk1A0; 35 | SpmNodeUnk* unk1A4; 36 | char unk1A8[0xc]; 37 | int unk1B4; 38 | int unk1B8; 39 | 40 | public: 41 | void ChangePointer(SpmFileHeader* arg0, SpmNode* arg1); 42 | }; 43 | 44 | struct SpmFileHeader { 45 | public: 46 | char unk0[0x6]; 47 | u_short unk6; 48 | char unk8[0x5c]; 49 | int unk64; 50 | u_int unk68; 51 | char unk6C[0x8]; 52 | SpmNode** unk74; 53 | 54 | public: 55 | void ChangePointer(); 56 | 57 | void* CalculatePointer(void* offset) { 58 | if (!offset) { 59 | return NULL; 60 | } 61 | return reinterpret_cast(reinterpret_cast(this) + reinterpret_cast(offset)); 62 | } 63 | }; 64 | 65 | class PrModelObject { 66 | public: 67 | void GetPrimitivePosition(NaVECTOR* arg0); 68 | void GetScreenPosition(NaVECTOR* arg0); 69 | }; 70 | 71 | #endif -------------------------------------------------------------------------------- /src/prlib/old/animation.h: -------------------------------------------------------------------------------- 1 | #ifndef ANIMATION_H 2 | #define ANIMATION_H 3 | 4 | #include 5 | 6 | #include "scene.h" 7 | 8 | class PrSceneObject; 9 | 10 | class SpaFileHeader 11 | { 12 | public: 13 | void Initialize(); 14 | public: 15 | u_int m_magic; 16 | u_short m_version; 17 | u_short m_flags; 18 | char pad0[0x0c]; 19 | float m_endFrame; 20 | char m_name[32]; 21 | void* m_unk38; 22 | u_int m_unk3C; 23 | PrSceneObject *m_unk40; 24 | u_int m_unk44; 25 | int m_userData; 26 | u_int m_unk4C; 27 | void* m_unk50; 28 | }; 29 | 30 | #endif -------------------------------------------------------------------------------- /src/prlib/old/database.h: -------------------------------------------------------------------------------- 1 | #ifndef DATABASE_H 2 | #define DATABASE_H 3 | 4 | #include "scene.h" 5 | 6 | #include "model.h" 7 | 8 | #include "animation.h" 9 | 10 | class SpaFileHeader; 11 | class SpcFileHeader; 12 | 13 | class PrObjectDatabase 14 | { 15 | public: 16 | void Initialize(); 17 | void Cleanup(); 18 | 19 | PrSceneObject* CreateScene(sceGsDrawEnv1 *drawEnv, const char* name, u_int fbp); 20 | void DeleteScene(PrSceneObject *scene); 21 | public: 22 | int _0; 23 | int _4; 24 | int _8; 25 | SpaFileHeader *m_unk0C_animation; 26 | SpaFileHeader *m_unk10_animation; 27 | int _14; 28 | SpcFileHeader *m_unk18_camera; 29 | SpcFileHeader *m_unk1C_camera; 30 | int _20; 31 | }; 32 | 33 | #endif -------------------------------------------------------------------------------- /src/prlib/old/model.h: -------------------------------------------------------------------------------- 1 | #ifndef MODEL_H 2 | #define MODEL_H 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | #include "scene.h" 10 | 11 | #include "animation.h" 12 | 13 | class SpmFileHeader; 14 | 15 | class SpmNode 16 | { 17 | public: 18 | NaMATRIX mScaleMatrix; 19 | NaMATRIX unk40_renderMatrix; 20 | NaMATRIX unk80_matrix; 21 | NaMATRIX unkC0_matrix; 22 | NaMATRIX unk100_matrix; 23 | NaVECTOR unk140_vec4; 24 | 25 | u_int m_index; 26 | u_int m_flags; 27 | 28 | SpmFileHeader *unk158_spmHeader; 29 | 30 | SpmNode* unk15C_siblingNode; 31 | SpmNode* unk160_parentNode; 32 | SpmNode* unk164_previousNode; 33 | 34 | u_int m_triangleCount; 35 | 36 | void* m_opaqueNodePacket; 37 | void* m_transmitNodePacket; 38 | 39 | char pad[0x48]; 40 | }; 41 | 42 | class PrModelObject; 43 | 44 | class SpmFileHeader 45 | { 46 | public: 47 | u_int m_magic; 48 | u_short m_version; 49 | u_short m_flags; 50 | char pad[8]; 51 | char m_name[32]; 52 | float m_unk30_vec4[4]; 53 | float m_unk40_vec4[4]; 54 | PrModelObject* m_pLinkedModel; 55 | u_int m_meshCount; 56 | int m_unk58; 57 | u_int m_vertexNum; 58 | float m_currentFrame; 59 | float m_currentPosFrame; 60 | u_int m_nodeNum; 61 | u_int m_unk6C; 62 | u_int m_unk70_post; 63 | SpmNode** m_nodes; 64 | }; 65 | 66 | class PrModelObject 67 | { 68 | public: 69 | void GetPrimitivePosition(NaVECTOR *vector); 70 | void GetScreenPosition(NaVECTOR *vector); 71 | 72 | void LinkAnimation(SpaFileHeader *animation); 73 | void LinkPositionAnimation(SpaFileHeader *animation); 74 | 75 | void CleanupAnimation(); 76 | 77 | void SavePosture(); 78 | void ResetPosture(); 79 | 80 | void SaveContour(); 81 | void ResetContour(); 82 | 83 | ~PrModelObject(); 84 | public: 85 | char pad0[0x10]; 86 | NaMATRIX m_matrix; 87 | int m_modelId; 88 | int m_userData; 89 | SpmFileHeader *m_spmImage; 90 | int m_posture; 91 | float m_animTime; 92 | float m_animTimePosition; 93 | SpaFileHeader *m_linkedAnim; 94 | SpaFileHeader *m_linkedPosAnim; 95 | char pad1[0x24]; 96 | float m_contourBlurAlpha; 97 | float m_contourBlurAlpha2; 98 | float m_transactionBlendRatio; 99 | float m_disturbance; 100 | 101 | float m_unkA4; 102 | char pad2[0x08]; 103 | }; 104 | 105 | #endif -------------------------------------------------------------------------------- /src/prlib/old/renderstuff.h: -------------------------------------------------------------------------------- 1 | #ifndef RENDERSTUFF_H 2 | #define RENDERSTUFF_H 3 | 4 | #include 5 | #include 6 | 7 | struct PrRENDERING_STATISTICS { // 0x2c 8 | /* 0x00 */ unsigned int node_num; 9 | /* 0x04 */ unsigned int opaque_context1_node_num; 10 | /* 0x08 */ unsigned int transmit_context1_node_num; 11 | /* 0x0c */ unsigned int opaque_context2_node_num; 12 | /* 0x10 */ unsigned int transmit_context2_node_num; 13 | /* 0x14 */ unsigned short render_time0; 14 | /* 0x16 */ unsigned short render_time1; 15 | /* 0x18 */ unsigned short render_time2; 16 | /* 0x1a */ unsigned short render_time3; 17 | /* 0x1c */ unsigned short render_time4; 18 | /* 0x1e */ unsigned short render_time5; 19 | /* 0x20 */ unsigned short render_time6; 20 | /* 0x22 */ unsigned short render_time7; 21 | /* 0x24 */ unsigned short render_time8; 22 | /* 0x28 */ int dynamic_append_transmit_node; /* bool */ 23 | }; 24 | 25 | class PrRenderStuff 26 | { 27 | public: 28 | void Initialize(sceGsZbuf zbuf); 29 | void WaitRender(); 30 | 31 | void Cleanup(); 32 | public: 33 | char pad0[0x1C]; 34 | int _1C; 35 | sceGsZbuf m_gsZbuf; 36 | char pad1[0x4]; 37 | PrRENDERING_STATISTICS m_renderStatistics; 38 | }; 39 | 40 | #endif -------------------------------------------------------------------------------- /src/prlib/old/scene.h: -------------------------------------------------------------------------------- 1 | #ifndef SCENE_H 2 | #define SCENE_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "model.h" 9 | 10 | struct PrPERSPECTIVE_CAMERA { // 0x40 11 | /* 0x00 */ float position[4]; 12 | /* 0x10 */ float interest[4]; 13 | /* 0x20 */ float up[4]; 14 | /* 0x30 */ float aspect; 15 | /* 0x34 */ float field_of_view; 16 | /* 0x38 */ float near_clip; 17 | /* 0x3c */ float far_clip; 18 | }; 19 | 20 | class SpcFileHeader 21 | { 22 | public: 23 | char pad0[0x14]; 24 | 25 | float m_endFrame; 26 | 27 | char m_name[32]; 28 | 29 | char pad1[0x8]; 30 | 31 | float m_position[4]; 32 | float m_interest[4]; 33 | 34 | u_int m_unk60; 35 | 36 | float m_fieldOfView; 37 | float m_aspect; 38 | float m_nearClip; 39 | float m_farClip; 40 | 41 | char pad2[0x10]; 42 | 43 | int m_userData; 44 | 45 | char pad3[0x10]; 46 | }; 47 | 48 | class PrObjectDatabase; 49 | 50 | class PrModelObject; 51 | 52 | class PrSceneObject 53 | { 54 | public: 55 | void SelectCamera(SpcFileHeader *spcImage); 56 | PrPERSPECTIVE_CAMERA* GetCurrentCamera(); 57 | public: 58 | char pad[0x8]; 59 | PrObjectDatabase* m_objectDatabase; 60 | u_int m_unk0C; 61 | PrPERSPECTIVE_CAMERA m_camera; 62 | sceGsFrame m_gsFrame; 63 | sceGsXyoffset m_xyOffset; 64 | 65 | PrModelObject* m_unk60_modelObject; 66 | PrModelObject* m_unk64_modelObject; 67 | 68 | u_int m_modelCount; 69 | 70 | SpcFileHeader* m_pCurrentCamera; 71 | 72 | sceGsDrawEnv1* m_pDrawEnv; 73 | 74 | u_int m_unk74; 75 | u_int m_unk78; 76 | float m_animTime; 77 | 78 | char* m_name; 79 | 80 | float m_fFocalLen; 81 | float m_fDefocusLen; 82 | u_int m_fDepthLevel; 83 | 84 | sceGsDBuff* m_pDBuff; 85 | 86 | u_int m_unk94; 87 | 88 | PrModelObject* m_unk98_modelObject; 89 | PrModelObject* m_unk9C_modelObject; 90 | PrModelObject* m_unkA0_modelObject; 91 | }; 92 | 93 | #endif -------------------------------------------------------------------------------- /src/prlib/prpriv.h: -------------------------------------------------------------------------------- 1 | #ifndef PRLIB_PRPRIV_H 2 | #define PRLIB_PRPRIV_H 3 | 4 | #include "common.h" 5 | 6 | #include "prlib/animation.h" 7 | #include "prlib/camera.h" 8 | #include "prlib/model.h" 9 | #include "prlib/scene.h" 10 | 11 | typedef enum { 12 | PR_FLOAT_PARAM_DISTURBANCE = 0, 13 | PR_DEBUG_PARAM_NUM = 1 14 | } PrDEBUG_PARAM; 15 | 16 | typedef union { 17 | int d; 18 | float f; 19 | } PrDebugParam; 20 | 21 | PR_EXTERN { 22 | 23 | void PrCleanupModel(PrModelObject *model); 24 | void PrCleanupAnimation(SpaFileHeader *model); 25 | void PrCleanupCamera(SpcFileHeader *camera); 26 | void PrCleanupScene(PrSceneObject *scene); 27 | 28 | } 29 | 30 | #endif -------------------------------------------------------------------------------- /src/prlib/random.cpp: -------------------------------------------------------------------------------- 1 | #include "random.h" 2 | 3 | #include 4 | 5 | extern u_int randomSeed; 6 | extern u_int randomPool[97]; 7 | 8 | static u_int RawRandom() { 9 | randomSeed = (randomSeed * 0x5d588b65 + 1); 10 | return randomSeed; 11 | } 12 | 13 | u_int PrRandom() { 14 | extern u_int poolIndex; 15 | int ret; 16 | 17 | poolIndex = randomPool[poolIndex] % 97; 18 | ret = randomPool[poolIndex] / 2; 19 | 20 | randomPool[poolIndex] = RawRandom(); 21 | return ret; 22 | } 23 | 24 | void PrInitializeRandomPool() { 25 | for (u_int i = 0; i < 97; i++) { 26 | randomPool[i] = RawRandom(); 27 | } 28 | 29 | PrRandom(); 30 | PrRandom(); 31 | } 32 | 33 | float PrFloatRandom() { 34 | /* TODO: Function does not use goto, 35 | * fix control flow. */ 36 | generate_rand: 37 | float ret = PrRandom(); 38 | 39 | if ((ret / RAND_MAX) >= 1.0f) { 40 | goto generate_rand; 41 | } 42 | 43 | return ret / RAND_MAX; 44 | } -------------------------------------------------------------------------------- /src/prlib/random.h: -------------------------------------------------------------------------------- 1 | #ifndef PRLIB_RANDOM_H 2 | #define PRLIB_RANDOM_H 3 | 4 | #include "common.h" 5 | 6 | #include 7 | 8 | u_int PrRandom(); 9 | void PrInitializeRandomPool(); 10 | float PrFloatRandom(); 11 | 12 | #endif -------------------------------------------------------------------------------- /src/prlib/render.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | INCLUDE_ASM("prlib/render", Render__13PrSceneObject); 4 | 5 | INCLUDE_ASM("prlib/render", InitializeVu1__13PrSceneObject); 6 | 7 | INCLUDE_ASM("prlib/render", PrepareScreenModelRender__13PrSceneObject); 8 | 9 | INCLUDE_ASM("prlib/render", CalculateCurrentMatrix__13PrModelObject); 10 | 11 | INCLUDE_ASM("prlib/render", CalculateCurrentMatrix__13SpmFileHeaderP13PrModelObjectRCt8NaMATRIX3Zfi4i4); 12 | 13 | INCLUDE_ASM("prlib/render", CalculateCurrentMatrixAnimation__13SpmFileHeaderP13PrModelObjectRCt8NaMATRIX3Zfi4i4); 14 | 15 | INCLUDE_ASM("prlib/render", CalculateClusterMatrix__13SpmFileHeaderP13PrModelObjectRCt8NaMATRIX3Zfi4i4); 16 | 17 | INCLUDE_ASM("prlib/render", CalculateClusterMatrixAnimation__13SpmFileHeaderP13PrModelObjectRCt8NaMATRIX3Zfi4i4); 18 | 19 | INCLUDE_ASM("prlib/render", RenderContext1Model__13PrModelObject); 20 | 21 | INCLUDE_ASM("prlib/render", RenderContext1Model__13SpmFileHeaderP13PrModelObject); 22 | 23 | INCLUDE_ASM("prlib/render", ModifySimpleDmaPacket__7SpmNodeP23PrVuNodeHeaderDmaPacket); 24 | 25 | INCLUDE_ASM("prlib/render", RenderContext1Node__7SpmNodeP13PrModelObject); 26 | 27 | INCLUDE_ASM("prlib/render", RenderScreenModelNode__13PrModelObject); 28 | 29 | INCLUDE_ASM("prlib/render", RenderScreenModelNode__13SpmFileHeader); 30 | 31 | INCLUDE_ASM("prlib/render", RenderScreenModelNode__7SpmNode); 32 | 33 | INCLUDE_ASM("prlib/render", RenderBackgroundScreenModel__13PrModelObject); 34 | 35 | INCLUDE_ASM("prlib/render", RenderBackgroundScreenModel__13SpmFileHeader); 36 | 37 | INCLUDE_ASM("prlib/render", RenderBackgroundScreenModel__7SpmNode); 38 | 39 | INCLUDE_ASM("prlib/render", RenderContext2Model__13PrModelObject); 40 | 41 | INCLUDE_ASM("prlib/render", RenderContext2Model__13SpmFileHeaderP13PrModelObject); 42 | 43 | INCLUDE_ASM("prlib/render", RenderContext2Node__7SpmNodeP13PrModelObject); 44 | 45 | /* nalib/navector.h */ 46 | INCLUDE_ASM("prlib/render", func_00145DB0); 47 | 48 | /* prlib/render.cpp */ 49 | INCLUDE_ASM("prlib/render", ComposeGlobalMatrix__7SpmNodeP13PrModelObjectRCt8NaMATRIX3Zfi4i4); 50 | 51 | /* prlib/renderstuff.h */ 52 | INCLUDE_ASM("prlib/render", func_00145E50); 53 | 54 | /* prlib/render.cpp */ 55 | INCLUDE_ASM("prlib/render", ComposeGlobalMatrixWithoutVisibility__7SpmNodeP13PrModelObjectRCt8NaMATRIX3Zfi4i4); 56 | -------------------------------------------------------------------------------- /src/prlib/renderee.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | INCLUDE_ASM("prlib/renderee", InitializeEECore__13PrRenderStuffP13PrSceneObject); 4 | 5 | INCLUDE_ASM("prlib/renderee", RenderVertexEECoreBothface__13PrRenderStuff); 6 | 7 | INCLUDE_ASM("prlib/renderee", RenderVertexEECoreNormal__13PrRenderStuff); 8 | 9 | PR_EXTERN 10 | void RenderVertexEECoreRefmap__13PrRenderStuff(void) { 11 | } 12 | 13 | PR_EXTERN 14 | void RenderVertexEECoreContour__13PrRenderStuff(void) { 15 | } 16 | 17 | INCLUDE_ASM("prlib/renderee", RenderNodeEECore__13PrRenderStuffP23PrVuNodeHeaderDmaPacket); 18 | 19 | INCLUDE_ASM("prlib/renderee", RenderChunkEECore__13PrRenderStuffP25PrVuDataChunkPacketHeaderf); 20 | 21 | /* prlib/renderstuff.h */ 22 | INCLUDE_ASM("prlib/renderee", func_00146A08); 23 | -------------------------------------------------------------------------------- /src/prlib/renderstuff.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | INCLUDE_ASM("prlib/renderstuff", __13PrRenderStuff); 4 | 5 | INCLUDE_ASM("prlib/renderstuff", _$_13PrRenderStuff); 6 | 7 | INCLUDE_ASM("prlib/renderstuff", Initialize__13PrRenderStuffG9sceGsZbuf); 8 | 9 | INCLUDE_ASM("prlib/renderstuff", Cleanup__13PrRenderStuff); 10 | 11 | INCLUDE_ASM("prlib/renderstuff", GetZbufBits__C13PrRenderStuff); 12 | 13 | INCLUDE_ASM("prlib/renderstuff", ResetStatistics__13PrRenderStuff); 14 | 15 | INCLUDE_ASM("prlib/renderstuff", StartRender__13PrRenderStuffP13PrSceneObject); 16 | 17 | INCLUDE_ASM("prlib/renderstuff", WaitRender__13PrRenderStuff); 18 | 19 | INCLUDE_ASM("prlib/renderstuff", AllocateTransmitDmaArray__13PrRenderStuffUi); 20 | 21 | INCLUDE_ASM("prlib/renderstuff", AppendTransmitDmaTag__13PrRenderStuffPC10_sceDmaTagUif); 22 | 23 | INCLUDE_ASM("prlib/renderstuff", CompareFunction__13PrRenderStuffPCvT1); 24 | 25 | INCLUDE_ASM("prlib/renderstuff", SortTransmitDmaArray__13PrRenderStuff); 26 | 27 | INCLUDE_ASM("prlib/renderstuff", MergeRender__13PrRenderStuff); 28 | 29 | INCLUDE_ASM("prlib/renderstuff", _GLOBAL_$D$prRenderStuff); 30 | 31 | INCLUDE_ASM("prlib/renderstuff", _GLOBAL_$I$prRenderStuff); 32 | 33 | /* prlib/renderstuff.h */ 34 | INCLUDE_ASM("prlib/renderstuff", func_00141650); 35 | -------------------------------------------------------------------------------- /src/prlib/renderstuff.h: -------------------------------------------------------------------------------- 1 | #ifndef PRLIB_RENDERSTUFF_H 2 | #define PRLIB_RENDERSTUFF_H 3 | 4 | #include 5 | 6 | class PrRenderStuff { 7 | public: 8 | void Initialize(sceGsZbuf zbuf); 9 | void Cleanup(); 10 | private: 11 | char unk0[0x10]; 12 | }; 13 | 14 | extern PrRenderStuff prRenderStuff; 15 | 16 | #endif -------------------------------------------------------------------------------- /src/prlib/scene.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | INCLUDE_ASM("prlib/scene", __13PrSceneObjectP13sceGsDrawEnv1PCcUi); 4 | 5 | INCLUDE_ASM("prlib/scene", _$_13PrSceneObject); 6 | 7 | INCLUDE_ASM("prlib/scene", SelectCamera__13PrSceneObjectP13SpcFileHeader); 8 | 9 | INCLUDE_ASM("prlib/scene", GetCurrentCamera__13PrSceneObject); 10 | 11 | INCLUDE_ASM("prlib/scene", SetAppropriateDefaultCamera__13PrSceneObject); 12 | 13 | INCLUDE_ASM("prlib/scene", GetFocalLength__C13PrSceneObject); 14 | 15 | INCLUDE_ASM("prlib/scene", GetDefocusLength__C13PrSceneObject); 16 | 17 | INCLUDE_ASM("prlib/scene", GetDepthLevel__C13PrSceneObject); 18 | 19 | INCLUDE_ASM("prlib/scene", PreprocessModel__13PrSceneObject); 20 | 21 | /* nalib/navector.h */ 22 | INCLUDE_ASM("prlib/scene", func_0014B988); 23 | 24 | INCLUDE_ASM("prlib/scene", func_0014B9B0); 25 | 26 | /* prlib/objectset.h */ 27 | INCLUDE_ASM("prlib/scene", _$_t11PrObjectSet1Z13PrModelObject); 28 | -------------------------------------------------------------------------------- /src/prlib/scene.h: -------------------------------------------------------------------------------- 1 | #ifndef PRLIB_SCENE_H 2 | #define PRLIB_SCENE_H 3 | 4 | #include 5 | #include 6 | 7 | class PrSceneObject { 8 | public: 9 | void PreprocessModel(); 10 | public: 11 | char unk0[0x50]; 12 | sceGsFrame unk50; 13 | sceGsXyoffset unk58; 14 | }; 15 | 16 | #endif -------------------------------------------------------------------------------- /src/prlib/setpointer.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | #include 4 | #include 5 | 6 | #include "prlib/model.h" 7 | 8 | void SpmFileHeader::ChangePointer() { 9 | if (this->unk6 & 0x1) { 10 | return; 11 | } 12 | 13 | this->unk64 = (int)CalculatePointer((void*)this->unk64); 14 | this->unk74 = (SpmNode**)CalculatePointer((void*)this->unk74); 15 | 16 | for (int i = 0; i < this->unk68; i++) { 17 | this->unk74[i] = (SpmNode*)CalculatePointer((void*)this->unk74[i]); 18 | } 19 | 20 | /* Change node pointers starting from the first. */ 21 | (*this->unk74)->ChangePointer(this, NULL); 22 | this->unk6 |= 0x1; 23 | } 24 | 25 | void SpmNode::ChangePointer(SpmFileHeader* arg0, SpmNode* arg1) { 26 | this->unk158 = arg0; 27 | this->unk164 = arg1; 28 | 29 | this->unk15C = (SpmNode*)arg0->CalculatePointer((void*)this->unk15C); 30 | this->unk160 = (SpmNode*)arg0->CalculatePointer((void*)this->unk160); 31 | 32 | this->unk16C[0] = (SpmNodeUnk*)arg0->CalculatePointer((void*)this->unk16C[0]); 33 | this->unk16C[1] = (SpmNodeUnk*)arg0->CalculatePointer((void*)this->unk16C[1]); 34 | 35 | this->unk17C = (int)this->unk16C[0]; 36 | if (this->unk16C[0] == 0) { 37 | this->unk17C = (int)this->unk16C[1]; 38 | } 39 | 40 | for (u_int i = 0; i < 2; i++) { 41 | if (this->unk16C[i]) { 42 | this->unk16C[i]->unk194 = SCE_VIF1_SET_MSCAL(PrGetMicroProgramAddress(this->unk16C[i]->unk60), 0); 43 | } 44 | } 45 | 46 | if (this->unk154 & 0xff0) { 47 | this->unk198 = (int)arg0->CalculatePointer((void*)this->unk198); 48 | if (this->unk154 & 0x10) { 49 | this->unk1B4 = (int)arg0->CalculatePointer((void*)this->unk1B4); 50 | this->unk1B8 = (int)arg0->CalculatePointer((void*)this->unk1B8); 51 | } else if (this->unk154 & 0x20) { 52 | this->unk1B4 = (int)arg0->CalculatePointer((void*)this->unk1B4); 53 | } 54 | 55 | this->unk1A0 = (int)arg0->CalculatePointer((void*)this->unk1A0); 56 | this->unk1A4 = (SpmNodeUnk*)arg0->CalculatePointer((void*)this->unk1A4); 57 | SpmNodeUnk* s0 = this->unk1A4; 58 | if (s0 != NULL) { 59 | s0->unk194 = SCE_VIF1_SET_MSCAL(PrGetMicroProgramAddress(ePrMicroProgram_Unk2), 0); 60 | } 61 | } 62 | 63 | SpmNode* s0 = this->unk15C; 64 | while (s0 != 0) { 65 | s0->ChangePointer(arg0, this); 66 | s0 = s0->unk160; 67 | } 68 | } 69 | 70 | INCLUDE_ASM("prlib/setpointer", ChangePointer__13SpaFileHeader); 71 | 72 | INCLUDE_ASM("prlib/setpointer", ChangePointer__16SpaNodeAnimationP13SpaFileHeader); 73 | 74 | INCLUDE_ASM("prlib/setpointer", ChangePointer__13SpcFileHeader); 75 | -------------------------------------------------------------------------------- /src/prlib/shape.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | INCLUDE_ASM("prlib/shape", AddShapePosition__12SpmShapeNodeUif); 4 | 5 | INCLUDE_ASM("prlib/shape", RenderShapeNode__12SpmShapeNodeP13PrModelObject); 6 | -------------------------------------------------------------------------------- /src/prlib/spadata.cpp: -------------------------------------------------------------------------------- 1 | #include "prlib/spadata.h" 2 | 3 | INCLUDE_ASM("prlib/spadata", SearchSegment__C12SpaTrackBasef); 4 | 5 | INCLUDE_ASM("prlib/spadata", GetValue__Ct8SpaTrack1Zif); 6 | 7 | INCLUDE_ASM("prlib/spadata", GetMatrix__C12SpaTransformf); 8 | 9 | INCLUDE_ASM("prlib/spadata", GetMatrix__C16SpaNodeAnimationf); 10 | 11 | INCLUDE_ASM("prlib/spadata", IsVisible__C16SpaNodeAnimationf); 12 | 13 | INCLUDE_ASM("prlib/spadata", IsNodeVisible__C13SpaFileHeaderP7SpmNodef); 14 | 15 | INCLUDE_ASM("prlib/spadata", IsEverIdentical__12SpaTransform); 16 | 17 | int SpaNodeAnimation::Optimize() { 18 | int removeCount = 0; 19 | 20 | for (int i = 0; i < this->unk8; i++) { 21 | SpaTransform* transform = this->unkC[i]; 22 | if (transform == NULL || transform->IsEverIdentical()) { 23 | removeCount++; 24 | continue; 25 | } 26 | this->unkC[i - removeCount] = this->unkC[i]; 27 | } 28 | 29 | this->unk8 -= removeCount; 30 | return removeCount; 31 | } 32 | 33 | INCLUDE_ASM("prlib/spadata", GetLinearValue__Ct8SpaTrack1Zt8NaVECTOR2Zfi4Uif); 34 | 35 | INCLUDE_ASM("prlib/spadata", GetValue__Ct8SpaTrack1Zt8NaVECTOR2Zfi4f); 36 | 37 | /* nalib/navector.h */ 38 | INCLUDE_ASM("prlib/spadata", func_00149168); 39 | 40 | INCLUDE_ASM("prlib/spadata", func_001491C0); 41 | 42 | INCLUDE_ASM("prlib/spadata", func_00149270); 43 | 44 | /* prlib/spadata.cpp */ 45 | INCLUDE_ASM("prlib/spadata", GetSprineValue__Ct8SpaTrack1ZfUif); 46 | 47 | INCLUDE_ASM("prlib/spadata", GetLinearValue__Ct8SpaTrack1ZfUif); 48 | 49 | INCLUDE_ASM("prlib/spadata", GetValue__Ct8SpaTrack1Zff); 50 | 51 | INCLUDE_ASM("prlib/spadata", GetSprineValue__Ct8SpaTrack1Zt8NaMATRIX3Zfi4i4Uif); 52 | 53 | INCLUDE_ASM("prlib/spadata", GetLinearValue__Ct8SpaTrack1Zt8NaMATRIX3Zfi4i4Uif); 54 | 55 | INCLUDE_ASM("prlib/spadata", GetValue__Ct8SpaTrack1Zt8NaMATRIX3Zfi4i4f); 56 | 57 | /* nalib/navector.h */ 58 | INCLUDE_ASM("prlib/spadata", func_0014ABE0); 59 | 60 | INCLUDE_ASM("prlib/spadata", func_0014ACE8); 61 | 62 | INCLUDE_ASM("prlib/spadata", func_0014AFE0); 63 | 64 | /* prlib/spadata.cpp */ 65 | INCLUDE_ASM("prlib/spadata", GetSprineValue__Ct8SpaTrack1Zt8NaVECTOR2Zfi4Uif); 66 | -------------------------------------------------------------------------------- /src/prlib/spadata.h: -------------------------------------------------------------------------------- 1 | #ifndef PRLIB_SPADATA_H 2 | #define PRLIB_SPADATA_H 3 | 4 | #include "common.h" 5 | 6 | #include 7 | 8 | struct SpaTransform { 9 | public: 10 | int IsEverIdentical(); 11 | }; 12 | 13 | struct SpaNodeAnimation { 14 | public: 15 | char unk0[0x8]; 16 | u_int unk8; 17 | SpaTransform** unkC; 18 | 19 | public: 20 | int Optimize(); 21 | }; 22 | 23 | #endif -------------------------------------------------------------------------------- /src/prlib/spram.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | INCLUDE_ASM("prlib/spram", Initialize__12PrSPRAM_DATAP13PrSceneObject); 4 | 5 | INCLUDE_ASM("prlib/spram", InitializeModel__12PrSPRAM_DATAP13PrModelObject); 6 | 7 | INCLUDE_ASM("prlib/spram", SendDisplayHeader__12PrSPRAM_DATA); 8 | 9 | /* nalib/navector.h */ 10 | INCLUDE_ASM("prlib/spram", func_00147CE0); 11 | 12 | INCLUDE_ASM("prlib/spram", func_00147D90); 13 | 14 | /* prlib/spram.cpp */ 15 | INCLUDE_ASM("prlib/spram", _GLOBAL_$I$Initialize__12PrSPRAM_DATAP13PrSceneObject); 16 | 17 | /* nalib/navector.h */ 18 | INCLUDE_ASM("prlib/spram", func_00147E38); 19 | 20 | INCLUDE_ASM("prlib/spram", func_00147FB8); 21 | 22 | INCLUDE_ASM("prlib/spram", func_00148140); 23 | 24 | INCLUDE_ASM("prlib/spram", func_00148248); 25 | 26 | INCLUDE_RODATA("prlib/spram", D_00396790); 27 | -------------------------------------------------------------------------------- /src/prlib/tim2.h: -------------------------------------------------------------------------------- 1 | #ifndef PRLIB_TIM2_H 2 | #define PRLIB_TIM2_H 3 | 4 | #include "common.h" 5 | 6 | #include 7 | 8 | #define TIM2_NONE (0) // For use on ClutType when there is no CLUT data 9 | #define TIM2_RGB16 (1) // 16bit color (used for both ClutType and ImageType) 10 | #define TIM2_RGB24 (2) // 24bit color (only used with ImageType) 11 | #define TIM2_RGB32 (3) // 32bit color (used for both ClutType and ImageType) 12 | #define TIM2_IDTEX4 (4) // 16 color texture (only used with ImageType) 13 | #define TIM2_IDTEX8 (5) // 16 color texture (only used with ImageType) 14 | 15 | typedef struct { // 0x10 16 | /* 0x0 */ char FileId[4]; 17 | /* 0x4 */ u_char FormatVersion; 18 | /* 0x5 */ u_char FormatId; 19 | /* 0x6 */ u_short Pictures; 20 | /* 0x8 */ char Reserved[8]; 21 | } TIM2_FILEHEADER; 22 | 23 | typedef struct { // 0x30 24 | /* 0x00 */ u_int TotalSize; 25 | /* 0x04 */ u_int ClutSize; 26 | /* 0x08 */ u_int ImageSize; 27 | /* 0x0c */ u_short HeaderSize; 28 | /* 0x0e */ u_short ClutColors; 29 | /* 0x10 */ u_char PictFormat; 30 | /* 0x11 */ u_char MipMapTextures; 31 | /* 0x12 */ u_char ClutType; 32 | /* 0x13 */ u_char ImageType; 33 | /* 0x14 */ u_short ImageWidth; 34 | /* 0x16 */ u_short ImageHeight; 35 | /* 0x18 */ u_long GsTex0; 36 | /* 0x20 */ u_long GsTex1; 37 | /* 0x28 */ u_int GsRegs; 38 | /* 0x2c */ u_int GsTexClut; 39 | } TIM2_PICTUREHEADER; 40 | 41 | typedef struct { // 0x30 42 | /* 0x00 */ u_long GsMiptbp1; 43 | /* 0x08 */ u_long GsMiptbp2; 44 | /* 0x10 */ u_int MMImageSize[0]; 45 | } TIM2_MIPMAPHEADER; 46 | 47 | typedef struct { // 0x10 48 | /* 0x0 */ char ExHeaderId[4]; 49 | /* 0x4 */ u_int UserSpaceSize; 50 | /* 0x8 */ u_int UserDataSize; 51 | /* 0xc */ u_int Reserved; 52 | } TIM2_EXHEADER; 53 | 54 | PR_EXTERN { 55 | 56 | int Tim2CheckFileHeader(); 57 | 58 | TIM2_PICTUREHEADER* Tim2GetPictureHeader(void *pTim2, int imgno); 59 | int Tim2GetMipMapPictureSize(TIM2_PICTUREHEADER *ph, int mipmap, int *pWidth, int *pHeight); 60 | TIM2_MIPMAPHEADER* Tim2GetMipMapHeader(TIM2_PICTUREHEADER *ph, int *pSize); 61 | void* Tim2GetImage(TIM2_PICTUREHEADER *ph, int mipmap); 62 | void* Tim2GetClut(TIM2_PICTUREHEADER *ph); 63 | u_int Tim2GetClutColor(TIM2_PICTUREHEADER *ph, int clut, int no); 64 | 65 | u_int Tim2GetTexel(TIM2_PICTUREHEADER *ph, int mipmap, int x, int y); 66 | u_int Tim2SetTexel(TIM2_PICTUREHEADER *ph, int mipmap, int x, int y, u_int newtexel); 67 | 68 | void Tim2LoadPicture(TIM2_PICTUREHEADER *ph); 69 | void Tim2LoadImage(TIM2_PICTUREHEADER *ph); 70 | u_int Tim2LoadClut(TIM2_PICTUREHEADER *ph); 71 | 72 | } 73 | 74 | #endif -------------------------------------------------------------------------------- /src/prlib/transition.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | INCLUDE_ASM("prlib/transition", SavePosture__13PrModelObject); 4 | 5 | INCLUDE_ASM("prlib/transition", ResetPosture__13PrModelObject); 6 | 7 | INCLUDE_ASM("prlib/transition", BlendTransitionMatrix__7SpmNodeP13PrModelObjectRt8NaMATRIX3Zfi4i4); 8 | 9 | INCLUDE_ASM("prlib/transition", BlendTransactionWeight__12SpmShapeNodeP13PrModelObjectfUi); 10 | -------------------------------------------------------------------------------- /src/prlib/utility.cpp: -------------------------------------------------------------------------------- 1 | #include "utility.h" 2 | 3 | int PrGetBitSize(u_int number) { 4 | int i; 5 | 6 | u_int bit = number; 7 | for (i = 0; bit >= 2; i++) { 8 | bit >>= 1; 9 | } 10 | 11 | return i + (PR_BIT(i) < number); 12 | } 13 | -------------------------------------------------------------------------------- /src/prlib/utility.h: -------------------------------------------------------------------------------- 1 | #ifndef PRLIB_UTILITY_H 2 | #define PRLIB_UTILITY_H 3 | 4 | #include "common.h" 5 | 6 | #include 7 | 8 | int PrGetBitSize(u_int number); 9 | 10 | #endif -------------------------------------------------------------------------------- /src/prlib/vram.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | INCLUDE_ASM("prlib/vram", PrAddDrawAreaDefinition__FP11NaGifPacketRC11PrVRAM_RECTbbUl); 4 | 5 | INCLUDE_ASM("prlib/vram", PrAddTextureAreaDefinition__FP11NaGifPacketRC11PrVRAM_RECTb); 6 | 7 | INCLUDE_ASM("prlib/vram", PrSetSpriteDefinitionZ__FUi); 8 | 9 | INCLUDE_ASM("prlib/vram", PrAddSpriteDefinition__FP11NaGifPacketRC11PrVRAM_RECTT1b); 10 | 11 | INCLUDE_ASM("prlib/vram", PrAddSpriteDefinitionSuperSampled__FP11NaGifPacketRC11PrVRAM_RECTT1); 12 | 13 | /* nalib/napacket.h */ 14 | INCLUDE_ASM("prlib/vram", func_0014D668); 15 | 16 | INCLUDE_ASM("prlib/vram", func_0014D680); 17 | 18 | INCLUDE_ASM("prlib/vram", func_0014D6C0); 19 | 20 | INCLUDE_ASM("prlib/vram", func_0014D748); 21 | 22 | INCLUDE_ASM("prlib/vram", func_0014D7A0); 23 | 24 | INCLUDE_ASM("prlib/vram", func_0014D7D0); 25 | 26 | INCLUDE_ASM("prlib/vram", func_0014D838); 27 | 28 | INCLUDE_ASM("prlib/vram", func_0014D868); 29 | 30 | INCLUDE_ASM("prlib/vram", func_0014D8A8); 31 | 32 | INCLUDE_ASM("prlib/vram", func_0014D8D8); 33 | -------------------------------------------------------------------------------- /src/prlib/wave.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | INCLUDE_ASM("prlib/wave", CG_WaveInit__FP8WAVE_STR); 4 | 5 | INCLUDE_ASM("prlib/wave", CG_WaveInitEasy__FP8WAVE_STRssss10WMODE_ENUM); 6 | 7 | INCLUDE_ASM("prlib/wave", UG_WaveDisp__FP8WAVE_STRP10sceGsFrameP12sceGifPacket); 8 | 9 | INCLUDE_ASM("prlib/wave", CG_WaveDisp__FP8WAVE_STRP10sceGsFrame); 10 | 11 | INCLUDE_ASM("prlib/wave", WaveCtrlInit__FP8WAVE_STRss10WMODE_ENUM); 12 | 13 | INCLUDE_ASM("prlib/wave", WaveCtrlDisp__FP8WAVE_STRP10sceGsFrame); 14 | 15 | INCLUDE_ASM("prlib/wave", WaveCtrlUpdate__FP8WAVE_STRf); 16 | 17 | INCLUDE_RODATA("prlib/wave", D_003969A0); 18 | -------------------------------------------------------------------------------- /tools/buildtools/elf_patcher.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # SPDX-FileCopyrightText: © 2024 AngheloAlf 4 | # SPDX-License-Identifier: MIT 5 | 6 | from __future__ import annotations 7 | 8 | import argparse 9 | import spimdisasm 10 | from pathlib import Path 11 | import struct 12 | 13 | def align_up(x: int, a: int) -> int: 14 | return (x + (a-1)) & ~(a-1) 15 | 16 | SECTIONS_TO_REALIGN_PER_TOOL: dict[str, dict[str, int]] = { 17 | "gas": { 18 | ".text": 0x8, 19 | ".data": 0x8, 20 | ".rodata": 0x8, 21 | ".sdata": 0x8, 22 | ".sbss": 0x4, 23 | ".bss": 0x10, 24 | }, 25 | } 26 | 27 | SPECIFIC_ALIGNMENTS: dict[str, dict[str, int]] = { 28 | # .bss 29 | "pack.bss.s.o": { 30 | ".bss": 0x40, 31 | }, 32 | "etc.bss.s.o": { 33 | ".bss": 0x8, 34 | }, 35 | "mcctrl.bss.s.o": { 36 | ".bss": 0x8, 37 | }, 38 | "menu.bss.s.o": { 39 | ".bss": 0x8, 40 | }, 41 | } 42 | 43 | spimdisasm.common.GlobalConfig.VERBOSE = False 44 | spimdisasm.common.GlobalConfig.QUIET = True 45 | 46 | parser = argparse.ArgumentParser(description="Patches elf objects to bypass alignment restrictions of other tools") 47 | 48 | parser.add_argument("elf_path") 49 | parser.add_argument("mode", choices=["gas"]) 50 | parser.add_argument("--section-align", nargs="+") 51 | 52 | args = parser.parse_args() 53 | 54 | elf_path = Path(args.elf_path) 55 | section_align_override: dict[str, int] = {} 56 | if args.section_align is not None: 57 | for entry in args.section_align: 58 | sect, align_str = entry.split(":") 59 | align = int(align_str, 0) 60 | section_align_override[sect] = align 61 | 62 | if elf_path.parent.name == "sdk": 63 | # SDK seems to have 0x4 alignment on .data 64 | section_align_override.setdefault(".data", 0x4) 65 | 66 | # Override specific alignments 67 | specific_alignments = SPECIFIC_ALIGNMENTS.get(elf_path.name) 68 | if specific_alignments: 69 | print(f"Applying overriden alignment on: \"{elf_path.name}\"") 70 | section_align_override.update(specific_alignments) 71 | 72 | elf_bytes = bytearray(elf_path.read_bytes()) 73 | 74 | elf_file = spimdisasm.elf32.Elf32File(elf_bytes) 75 | 76 | sections_to_realign = SECTIONS_TO_REALIGN_PER_TOOL[args.mode] 77 | 78 | for i, sect in enumerate(elf_file.sectionHeaders): 79 | name = elf_file.shstrtab[sect.name] 80 | # print(name, sect) 81 | 82 | # Check the cmd line override first 83 | new_alignment = section_align_override.get(name) 84 | 85 | if new_alignment is None: 86 | # If no override is present then use the built-in ones 87 | new_alignment = sections_to_realign.get(name) 88 | 89 | if new_alignment is not None: 90 | section_offset = elf_file.header.shoff + i * 0x28 91 | addralign_pointer = section_offset + 0x20 92 | size_pointer = section_offset + 0x14 93 | 94 | # Patch the alignment of the section 95 | fmt = spimdisasm.common.GlobalConfig.ENDIAN.toFormatString() + "I" 96 | struct.pack_into(fmt, elf_bytes, addralign_pointer, new_alignment) 97 | 98 | elf_path.write_bytes(elf_bytes) 99 | -------------------------------------------------------------------------------- /tools/cc/ee-gcc2.96/bin/ee-gcc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parappadev/parappa2/7c3f7d367adc1153143169e53e6373f93f25ce53/tools/cc/ee-gcc2.96/bin/ee-gcc -------------------------------------------------------------------------------- /tools/cc/ee-gcc2.96/ee/bin/as: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parappadev/parappa2/7c3f7d367adc1153143169e53e6373f93f25ce53/tools/cc/ee-gcc2.96/ee/bin/as -------------------------------------------------------------------------------- /tools/cc/ee-gcc2.96/lib/gcc-lib/ee/2.9-ee-991111-01/cc1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parappadev/parappa2/7c3f7d367adc1153143169e53e6373f93f25ce53/tools/cc/ee-gcc2.96/lib/gcc-lib/ee/2.9-ee-991111-01/cc1 -------------------------------------------------------------------------------- /tools/cc/ee-gcc2.96/lib/gcc-lib/ee/2.9-ee-991111-01/cc1plus: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parappadev/parappa2/7c3f7d367adc1153143169e53e6373f93f25ce53/tools/cc/ee-gcc2.96/lib/gcc-lib/ee/2.9-ee-991111-01/cc1plus -------------------------------------------------------------------------------- /tools/cc/ee-gcc2.96/lib/gcc-lib/ee/2.9-ee-991111-01/cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parappadev/parappa2/7c3f7d367adc1153143169e53e6373f93f25ce53/tools/cc/ee-gcc2.96/lib/gcc-lib/ee/2.9-ee-991111-01/cpp -------------------------------------------------------------------------------- /tools/coddog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parappadev/parappa2/7c3f7d367adc1153143169e53e6373f93f25ce53/tools/coddog -------------------------------------------------------------------------------- /tools/first_diff.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # SPDX-FileCopyrightText: © 2022-2024 AngheloAlf 4 | # SPDX-License-Identifier: MIT 5 | 6 | from __future__ import annotations 7 | 8 | import argparse 9 | import mapfile_parser 10 | from pathlib import Path 11 | import rabbitizer 12 | 13 | 14 | def decodeInstruction(bytesDiff: bytes, mapFile: mapfile_parser.MapFile) -> str|None: 15 | word = (bytesDiff[3] << 24) | (bytesDiff[2] << 16) | (bytesDiff[1] << 8) | (bytesDiff[0] << 0) 16 | instr = rabbitizer.Instruction(word) 17 | immOverride = None 18 | 19 | if not instr.isValid(): 20 | return None 21 | 22 | if instr.isJumpWithAddress(): 23 | # Instruction is a function call (jal) 24 | 25 | # Get the embedded address of the function call 26 | symAddress = instr.getInstrIndexAsVram() 27 | 28 | # Search for the address in the mapfile 29 | symInfo = mapFile.findSymbolByVramOrVrom(symAddress) 30 | if symInfo is not None: 31 | # Use the symbol from the mapfile instead of a raw value 32 | immOverride = symInfo.symbol.name 33 | 34 | return instr.disassemble(immOverride=immOverride, extraLJust=-20) 35 | 36 | def firstDiffMain(): 37 | parser = argparse.ArgumentParser(description="Find the first difference(s) between the built ROM and the base ROM.") 38 | 39 | parser.add_argument("-c", "--count", type=int, default=5, help="find up to this many instruction difference(s)") 40 | parser.add_argument("-a", "--add-colons", action='store_true', help="Add colon between bytes" ) 41 | 42 | args = parser.parse_args() 43 | 44 | buildFolder = Path("build") 45 | 46 | BUILTROM = buildFolder / f"SCPS_150.17" 47 | BUILTMAP = buildFolder / f"SCPS_150.17.map" 48 | 49 | EXPECTEDROM = "expected" / BUILTROM 50 | EXPECTEDMAP = "expected" / BUILTMAP 51 | 52 | mapfile_parser.frontends.first_diff.doFirstDiff(BUILTMAP, EXPECTEDMAP, BUILTROM, EXPECTEDROM, args.count, mismatchSize=True, addColons=args.add_colons, bytesConverterCallback=decodeInstruction, endian="little") 53 | 54 | if __name__ == "__main__": 55 | firstDiffMain() 56 | -------------------------------------------------------------------------------- /tools/objdiff-cli: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parappadev/parappa2/7c3f7d367adc1153143169e53e6373f93f25ce53/tools/objdiff-cli -------------------------------------------------------------------------------- /tools/report_progress.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import subprocess 4 | import json 5 | import re 6 | import os 7 | 8 | import mapfile_parser 9 | 10 | def save(data, filename): 11 | directory = os.path.dirname(filename) 12 | if not os.path.exists(directory): 13 | os.makedirs(directory) 14 | with open(filename, "w") as outfile: 15 | json.dump(data, outfile) 16 | 17 | def getColor(percentage): 18 | if percentage >= 75: 19 | return "lime" 20 | elif percentage >= 50: 21 | return "yellow" 22 | if percentage >= 25: 23 | return "darkorange" 24 | else: 25 | return "crimson" 26 | 27 | def parse_progress(output): 28 | lines = output.strip().split("\n") 29 | all_of_folder_percent = 0 30 | sdk_of_total_percent = 0 31 | folder_percentages = {} 32 | 33 | for line in lines[1:]: # Skip the header 34 | parts = re.split(r'\s{2,}', line.strip()) # Split by 2 or more spaces 35 | if len(parts) >= 5: 36 | category = parts[0] 37 | try: 38 | of_folder_percent = float(parts[4].strip('%')) 39 | folder_percentages[category] = of_folder_percent 40 | 41 | if category == "all": 42 | all_of_folder_percent = of_folder_percent 43 | elif category == "sdk": 44 | sdk_of_total_percent = float(parts[7].strip('()%')) 45 | except ValueError: 46 | print(f"Error on line: {line}") 47 | 48 | total_percentage = all_of_folder_percent + sdk_of_total_percent 49 | return total_percentage, folder_percentages 50 | 51 | def main(): 52 | command = ["python3", "-m", "mapfile_parser", "progress", "build/SCPS_150.17.map", "asm", "asm/nonmatchings/"] 53 | result = subprocess.run(command, stdout=subprocess.PIPE, text=True) 54 | 55 | #result = mapfile_parser.frontends.progress.doProgress("build/SCPS_150.17.map", "asm", "asm/nonmatchings/") 56 | total_percentage, folder_percentages = parse_progress(result.stdout) 57 | 58 | # print(f"Total percentage: {total_percentage:.4f}%") 59 | total_report = { 60 | "schemaVersion": 1, 61 | "label": f"Total percentage", 62 | "message": f"{total_percentage:.4f}%", 63 | "color": getColor(float(total_percentage)), 64 | } 65 | save(total_report, "progress/total_progress.json") 66 | 67 | for category, percent in folder_percentages.items(): 68 | if category not in ["sdk", "all"]: # Skip the sdk and all categories 69 | print(f"{category} percentage: {percent:.4f}%") 70 | report = { 71 | "schemaVersion": 1, 72 | "label": f"{category}", 73 | "message": f"{percent:.4f}%", 74 | "color": getColor(float(percent)), 75 | } 76 | 77 | save(report, f"progress/{category}_progress.json") 78 | 79 | if __name__ == "__main__": 80 | main() 81 | --------------------------------------------------------------------------------