├── .bash_aliases ├── .github └── workflows │ ├── build.yml │ ├── build_pr.yml │ └── docker.yaml ├── .gitignore ├── .gitmodules ├── Dockerfile ├── Makefile ├── README.md ├── config ├── README.md ├── assets06.yaml ├── assets08.yaml ├── assets13.yaml ├── assets1C.yaml ├── compressed.debug.yaml ├── compressed.ects.yaml ├── compressed.eu.yaml └── compressed.us.yaml ├── conker.debug.sha1 ├── conker.debug.yaml ├── conker.ects.sha1 ├── conker.ects.yaml ├── conker.eu.sha1 ├── conker.eu.yaml ├── conker.us.sha1 ├── conker.us.yaml ├── conker ├── Makefile ├── README.md ├── conker.debug.sha1 ├── conker.debug.yaml ├── conker.ects.sha1 ├── conker.ects.yaml ├── conker.eu.sha1 ├── conker.eu.yaml ├── conker.us.sha1 ├── conker.us.yaml ├── diff_settings.py ├── include │ ├── 2.0L │ │ ├── PR │ │ │ ├── PRimage.h │ │ │ ├── R4300.h │ │ │ ├── abi.h │ │ │ ├── gbi.h │ │ │ ├── gs2dex.h │ │ │ ├── gt.h │ │ │ ├── gu.h │ │ │ ├── leo.h │ │ │ ├── leoappli.h │ │ │ ├── libaudio.h │ │ │ ├── mbi.h │ │ │ ├── n_libaudio.h │ │ │ ├── n_libaudio_s_to_n.h │ │ │ ├── os.h │ │ │ ├── os_ai.h │ │ │ ├── os_cache.h │ │ │ ├── os_cont.h │ │ │ ├── os_convert.h │ │ │ ├── os_debug.h │ │ │ ├── os_eeprom.h │ │ │ ├── os_error.h │ │ │ ├── os_exception.h │ │ │ ├── os_flash.h │ │ │ ├── os_gbpak.h │ │ │ ├── os_gio.h │ │ │ ├── os_host.h │ │ │ ├── os_internal.h │ │ │ ├── os_internal_debug.h │ │ │ ├── os_internal_error.h │ │ │ ├── os_internal_exception.h │ │ │ ├── os_internal_gio.h │ │ │ ├── os_internal_host.h │ │ │ ├── os_internal_reg.h │ │ │ ├── os_internal_rsp.h │ │ │ ├── os_internal_si.h │ │ │ ├── os_internal_thread.h │ │ │ ├── os_internal_tlb.h │ │ │ ├── os_libc.h │ │ │ ├── os_message.h │ │ │ ├── os_motor.h │ │ │ ├── os_pfs.h │ │ │ ├── os_pi.h │ │ │ ├── os_rdp.h │ │ │ ├── os_reg.h │ │ │ ├── os_rsp.h │ │ │ ├── os_si.h │ │ │ ├── os_system.h │ │ │ ├── os_thread.h │ │ │ ├── os_time.h │ │ │ ├── os_tlb.h │ │ │ ├── os_version.h │ │ │ ├── os_vi.h │ │ │ ├── os_voice.h │ │ │ ├── ramrom.h │ │ │ ├── rcp.h │ │ │ ├── rdb.h │ │ │ ├── region.h │ │ │ ├── rmon.h │ │ │ ├── sched.h │ │ │ ├── sp.h │ │ │ ├── sptask.h │ │ │ ├── ucode.h │ │ │ ├── ucode_debug.h │ │ │ ├── ultraerror.h │ │ │ ├── ultralog.h │ │ │ ├── ultratypes.h │ │ │ └── uportals.h │ │ ├── assert.h │ │ └── ultra64.h │ ├── functions.h │ ├── libc │ │ ├── math.h │ │ ├── stdarg.h │ │ ├── stddef.h │ │ ├── stdio.h │ │ ├── stdlib.h │ │ └── string.h │ ├── macro.inc │ ├── macros.h │ ├── magic.h │ ├── structs.h │ └── variables.h ├── src │ ├── debugger │ │ ├── data │ │ │ └── data_16003FE0.c │ │ └── debugger.c │ ├── debugger_256F80.c │ ├── debugger_257330.c │ ├── debugger_257350.c │ ├── debugger_258ED0.c │ ├── game │ │ ├── data │ │ │ └── data_800959E0.c │ │ ├── done │ │ │ ├── game_10B7C0.c │ │ │ ├── game_10C140.c │ │ │ ├── game_10ECB0.c │ │ │ ├── game_119960.c │ │ │ ├── game_122650.c │ │ │ ├── game_129EB0.c │ │ │ ├── game_12D7E0.c │ │ │ ├── game_14D0D0.c │ │ │ ├── game_15A830.c │ │ │ ├── game_1765E0.c │ │ │ ├── game_193420.c │ │ │ ├── game_1A6300.c │ │ │ ├── game_1CC420.c │ │ │ ├── game_322B0.c │ │ │ ├── game_323B0.c │ │ │ ├── game_323E0.c │ │ │ ├── game_32720.c │ │ │ ├── game_32F10.c │ │ │ ├── game_32F60.c │ │ │ ├── game_32FB0.c │ │ │ ├── game_32FC0.c │ │ │ ├── game_33000.c │ │ │ ├── game_33010.c │ │ │ ├── game_33020.c │ │ │ ├── game_33080.c │ │ │ ├── game_330E0.c │ │ │ ├── game_33130.c │ │ │ ├── game_331B0.c │ │ │ ├── game_33210.c │ │ │ ├── game_33260.c │ │ │ ├── game_332E0.c │ │ │ ├── game_33320.c │ │ │ ├── game_33390.c │ │ │ ├── game_333D0.c │ │ │ ├── game_33410.c │ │ │ ├── game_33450.c │ │ │ ├── game_33460.c │ │ │ ├── game_334C0.c │ │ │ ├── game_33620.c │ │ │ ├── game_34ED0.c │ │ │ ├── game_35CF0.c │ │ │ ├── game_35E80.c │ │ │ ├── game_35EC0.c │ │ │ ├── game_36040.c │ │ │ ├── game_36280.c │ │ │ ├── game_36600.c │ │ │ ├── game_39690.c │ │ │ ├── game_3BFD0.c │ │ │ ├── game_3BFE0.c │ │ │ ├── game_3C230.c │ │ │ ├── game_3C3D0.c │ │ │ ├── game_3C6C0.c │ │ │ ├── game_3D6F0.c │ │ │ ├── game_3D770.c │ │ │ ├── game_3D780.c │ │ │ ├── game_3DB30.c │ │ │ ├── game_3DB50.c │ │ │ ├── game_3DB60.c │ │ │ ├── game_3DB80.c │ │ │ ├── game_3E460.c │ │ │ ├── game_3E5A0.c │ │ │ ├── game_3E620.c │ │ │ ├── game_3E7E0.c │ │ │ ├── game_3E810.c │ │ │ ├── game_3EFB0.c │ │ │ ├── game_3F0F0.c │ │ │ ├── game_3F120.c │ │ │ ├── game_3F3D0.c │ │ │ ├── game_3F450.c │ │ │ ├── game_3F4D0.c │ │ │ ├── game_3F560.c │ │ │ ├── game_3FBD0.c │ │ │ ├── game_3FC20.c │ │ │ ├── game_3FC30.c │ │ │ ├── game_43760.c │ │ │ ├── game_43820.c │ │ │ ├── game_43B20.c │ │ │ ├── game_49D10.c │ │ │ ├── game_49D20.c │ │ │ ├── game_75810.c │ │ │ ├── game_75950.c │ │ │ ├── game_75A90.c │ │ │ ├── game_75BD0.c │ │ │ ├── game_768F0.c │ │ │ ├── game_77A90.c │ │ │ ├── game_F20A0.c │ │ │ └── game_FC3C0.c │ │ └── entrypoint.c │ ├── game_123FB0.c │ ├── game_130CB0.c │ ├── game_131F30.c │ ├── game_14FF90.c │ ├── game_15B200.c │ ├── game_161520.c │ ├── game_168A90.c │ ├── game_169510.c │ ├── game_16DC80.c │ ├── game_16EE20.c │ ├── game_1897A0.c │ ├── game_18D770.c │ ├── game_1944C0.c │ ├── game_1BFC70.c │ ├── game_1FFF60.c │ ├── game_2062D0.c │ ├── game_21D5F0.c │ ├── game_221290.c │ ├── game_2D4B0.c │ ├── game_2DDF0.c │ ├── game_2DF70.c │ ├── game_305D0.c │ ├── game_30E90.c │ ├── game_32200.c │ ├── game_32490.c │ ├── game_32740.c │ ├── game_33660.c │ ├── game_33990.c │ ├── game_34F20.c │ ├── game_357F0.c │ ├── game_35D20.c │ ├── game_360A0.c │ ├── game_362B0.c │ ├── game_36680.c │ ├── game_39750.c │ ├── game_3B920.c │ ├── game_3BA70.c │ ├── game_3D5C0.c │ ├── game_3D9A0.c │ ├── game_3DC30.c │ ├── game_3DF10.c │ ├── game_3E890.c │ ├── game_3F1F0.c │ ├── game_3F670.c │ ├── game_3F820.c │ ├── game_40490.c │ ├── game_433F0.c │ ├── game_43620.c │ ├── game_439B0.c │ ├── game_447B0.c │ ├── game_44A90.c │ ├── game_44C40.c │ ├── game_45B80.c │ ├── game_476D0.c │ ├── game_57FA0.c │ ├── game_6D800.c │ ├── game_6E240.c │ ├── game_70200.c │ ├── game_71240.c │ ├── game_71770.c │ ├── game_75C90.c │ ├── game_75E60.c │ ├── game_75FC0.c │ ├── game_76710.c │ ├── game_77AD0.c │ ├── game_83300.c │ ├── game_981E0.c │ ├── game_A28B0.c │ ├── game_A9D90.c │ ├── game_BC430.c │ ├── game_BC510.c │ ├── game_C8950.c │ ├── game_CB1C0.c │ ├── game_D4C20.c │ ├── game_D5030.c │ ├── game_D5160.c │ ├── game_D51B0.c │ ├── game_D5250.c │ ├── game_D5500.c │ ├── game_DAE50.c │ ├── game_DBA60.c │ ├── game_EF410.c │ ├── init │ │ └── data │ │ │ ├── data_2C200.c │ │ │ ├── data_2C3F0.c │ │ │ ├── data_2C400.c │ │ │ ├── data_2C460.c │ │ │ ├── data_2C6B0.c │ │ │ ├── data_2C750.c │ │ │ └── data_2C810.c │ ├── init_1050.c │ ├── init_11FA0.c │ ├── init_12560.c │ ├── init_1420.c │ ├── init_1AAE0.c │ ├── init_1C060.c │ ├── init_1E480.c │ ├── init_1E4A0.c │ ├── init_1E530.c │ ├── init_1FB40.c │ ├── init_20000.c │ ├── init_2070.c │ ├── init_210C0.c │ ├── init_214F0.c │ ├── init_22040.c │ ├── init_22460.c │ ├── init_2E50.c │ ├── init_38C0.c │ ├── init_38E0.c │ ├── init_3920.c │ ├── init_3930.c │ ├── init_39B0.c │ ├── init_39C0.c │ ├── init_3BD0.c │ ├── init_3C40.c │ ├── init_4470.c │ ├── init_49E0.c │ ├── init_50A0.c │ ├── init_5AB0.c │ ├── init_8180.c │ ├── init_8F90.c │ ├── init_A420.c │ ├── init_B1B0.c │ ├── init_EB00.c │ └── libultra │ │ ├── audio │ │ ├── cents2ratio.c │ │ ├── code_17AA0.c │ │ ├── code_17D80.c │ │ ├── code_18C60.c │ │ ├── code_18CB0.c │ │ ├── cseq.h │ │ ├── game_21FC90.c │ │ ├── heap.c │ │ ├── init_128D0.c │ │ ├── init_15550.c │ │ ├── init_17870.c │ │ ├── init_17A80.c │ │ ├── init_17AF0.c │ │ ├── init_17C00.c │ │ ├── init_17DF0.c │ │ ├── init_17F10.c │ │ ├── init_18D00.c │ │ ├── init_18D50.c │ │ ├── init_19B50.c │ │ ├── init_1CBF0.c │ │ ├── init_1D900.c │ │ ├── init_1E2A0.c │ │ ├── init_1E350.c │ │ ├── init_1E400.c │ │ ├── n_abi.h │ │ ├── n_cseqnextdelta.c │ │ ├── n_cseqp.h │ │ ├── n_cspgettempo.c │ │ ├── n_csplayer.c │ │ ├── n_csq.c │ │ ├── n_seqp.h │ │ ├── n_sl.c │ │ ├── n_sndp.h │ │ ├── n_synaddplayer.c │ │ ├── n_synallocvoice.c │ │ ├── n_synfreevoice.c │ │ ├── n_synsetpan.c │ │ ├── n_synsetpitch.c │ │ ├── n_synsetpitch2.c │ │ ├── n_synsetpriority.c │ │ ├── n_synsetvol.c │ │ ├── n_synstartvoiceparam.c │ │ ├── n_synstopvoice.c │ │ ├── n_synthInternals.h │ │ ├── n_synthesizer.c │ │ └── synthInternals.h │ │ ├── gu │ │ ├── cosf.c │ │ ├── guMtxF2L.c │ │ ├── guMtxIdentF.c │ │ ├── guNormalize.c │ │ ├── guPerspectiveF.c │ │ ├── guRotateF.c │ │ ├── mtxcatl.c │ │ └── sinf.c │ │ ├── io │ │ ├── ai.c │ │ ├── aigetstat.c │ │ ├── aisetfreq.c │ │ ├── aisetnextbuf.c │ │ ├── controller.h │ │ ├── pfschecker2.c │ │ ├── pfsisplug2.c │ │ ├── piint.h │ │ ├── pimgr.c │ │ ├── siint.h │ │ └── sptask.c │ │ └── os │ │ ├── createthread.c │ │ ├── getthreadpri.c │ │ ├── initialize.c │ │ └── osint.h ├── symbol_addrs.debug.txt ├── symbol_addrs.ects.txt ├── symbol_addrs.eu.txt ├── symbol_addrs.us.txt ├── tools │ ├── asm-differ │ ├── ctx.py │ ├── first-diff.py │ ├── get_data.py │ └── mips_to_c ├── undefined_funcs.debug.txt ├── undefined_funcs.ects.txt ├── undefined_funcs.eu.txt ├── undefined_funcs.us.txt ├── undefined_syms.debug.txt ├── undefined_syms.ects.txt ├── undefined_syms.eu.txt └── undefined_syms.us.txt ├── diff_settings.py ├── game.debug.rzip.yaml ├── game.eu.rzip.yaml ├── game.us.rzip.yaml ├── ido └── ido5.3_recomp │ ├── Makefile │ ├── README.md │ ├── acpp │ ├── as1 │ ├── cc │ ├── cc_c.c │ ├── cfe │ ├── copt │ ├── elf.h │ ├── err.english.cc │ ├── header.h │ ├── helpers.h │ ├── libc_impl.c │ ├── libc_impl.h │ ├── recomp │ ├── recomp.cpp │ ├── ugen │ ├── ugen_c.c │ ├── ujoin │ ├── uld │ ├── umerge │ ├── uopt │ └── usplit ├── packages.txt ├── requirements.txt └── tools ├── compress_dir.py ├── extract_compressed.py ├── first-diff.py ├── gzip ├── progress.py ├── rareunzip.py ├── rarezip.py └── splat_ext ├── __init__.py ├── rareunzip.py └── rzip.py /.bash_aliases: -------------------------------------------------------------------------------- 1 | # bash aliases for ease of use, copy/append to ~/.bash_aliases 2 | 3 | alias m2c='python3 tools/mips_to_c/mips_to_c.py ' 4 | alias di='python3 tools/decomp-permuter/import.py ' 5 | alias dp='python3 tools/decomp-permuter/permuter.py --best-only -j3 ' 6 | alias ad='python3 tools/asm-differ/diff.py -mwo3 ' 7 | -------------------------------------------------------------------------------- /.github/workflows/build_pr.yml: -------------------------------------------------------------------------------- 1 | name: build_pr 2 | 3 | on: 4 | pull_request_target: 5 | branches: [ master ] 6 | 7 | jobs: 8 | build_pr: 9 | if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} 10 | runs-on: ubuntu-20.04 11 | steps: 12 | - name: Checkout this repo 13 | uses: actions/checkout@v2 14 | with: 15 | submodules: recursive 16 | ref: ${{ github.event.pull_request.head.ref }} 17 | repository: ${{ github.event.pull_request.head.repo.full_name }} 18 | - name: Checkout baserom 19 | uses: actions/checkout@v2 20 | with: 21 | repository: mkst/conker-private 22 | token: ${{ secrets.PRIVATE_REPO_ACCESS }} 23 | path: baserom 24 | - name: Decrypt baserom 25 | run: echo ${{ secrets.CONKER_BASEROM_US }} | openssl enc -d -aes-256-cbc -pass stdin -pbkdf2 -in baserom/baserom.us.z64.aes -out baserom.us.z64 26 | 27 | - name: Perform make extract 28 | uses: docker://docker.io/markstreet/conker:latest 29 | with: 30 | args: make extract 31 | 32 | - name: Perform make extract (code) 33 | uses: docker://docker.io/markstreet/conker:latest 34 | with: 35 | args: sh -c "cd conker && make extract" 36 | - name: Perform make (code) 37 | uses: docker://docker.io/markstreet/conker:latest 38 | with: 39 | args: sh -c "cd conker && make --jobs" 40 | - name: Perform make replace 41 | uses: docker://docker.io/markstreet/conker:latest 42 | with: 43 | args: sh -c "cd conker && make replace" 44 | 45 | - name: Perform make 46 | uses: docker://docker.io/markstreet/conker:latest 47 | with: 48 | args: make --jobs 49 | -------------------------------------------------------------------------------- /.github/workflows/docker.yaml: -------------------------------------------------------------------------------- 1 | name: Create and push Docker build image 2 | on: 3 | push: 4 | branches: [ master ] 5 | jobs: 6 | push_to_dockerhub: 7 | name: Publish Docker build image to Docker Hub + Github Registry 8 | runs-on: ubuntu-latest 9 | permissions: 10 | contents: read 11 | steps: 12 | - name: Check out the repo 13 | uses: actions/checkout@v2 14 | - name: Log in to Docker Hub 15 | uses: docker/login-action@v1 16 | with: 17 | username: ${{ secrets.DOCKERHUB_USERNAME }} 18 | password: ${{ secrets.DOCKERHUB_TOKEN }} 19 | - name: Log in to GitHub Docker Registry 20 | uses: docker/login-action@v1 21 | with: 22 | registry: ghcr.io 23 | username: ${{ github.repository_owner }} 24 | password: ${{ secrets.GHCR_PAT }} 25 | - name: Build and push to Docker Hub 26 | uses: docker/build-push-action@v2 27 | with: 28 | push: true 29 | tags: markstreet/conker:latest 30 | - name: Build and push to Github registry 31 | uses: docker/build-push-action@v2 32 | with: 33 | push: true 34 | tags: ghcr.io/${{ github.repository_owner }}/conker:latest 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # directories 2 | 3 | __pycache__/ 4 | asm/ 5 | assets/ 6 | bin/ 7 | build/ 8 | expected/ 9 | extracted/ 10 | html/ 11 | junk/ 12 | nonmatchings 13 | py/ 14 | rodata/ 15 | rzip/ 16 | src_debug/ 17 | src_eu/ 18 | text/ 19 | textures/ 20 | 21 | # files 22 | 23 | conker/ctx.c 24 | .splat_cache 25 | *.bin 26 | *.csv 27 | *.gz 28 | *.o 29 | *.ok 30 | *.pad 31 | *.z64 32 | *.ld 33 | *_auto.txt 34 | 35 | # optional tools 36 | 37 | tools/decomp-permuter 38 | tools/gfxdis 39 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "tools/n64splat"] 2 | path = tools/n64splat 3 | url = https://github.com/ethteck/n64splat.git 4 | [submodule "tools/asm-differ"] 5 | path = tools/asm-differ 6 | url = https://github.com/simonlindholm/asm-differ 7 | [submodule "tools/asm-processor"] 8 | path = tools/asm-processor 9 | url = https://github.com/simonlindholm/asm-processor.git 10 | [submodule "tools/mips_to_c"] 11 | path = tools/mips_to_c 12 | url = https://github.com/matt-kempster/mips_to_c.git 13 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 as build 2 | 3 | ENV DEBIAN_FRONTEND=noninteractive 4 | 5 | COPY /packages.txt / 6 | 7 | RUN apt-get update && apt-get install -y $(cat /packages.txt) 8 | 9 | COPY requirements.txt / 10 | 11 | RUN python3 -m pip install -r /requirements.txt --no-cache-dir 12 | 13 | COPY .bash_aliases /root/.bash_aliases 14 | 15 | RUN mkdir /conker 16 | WORKDIR /conker 17 | -------------------------------------------------------------------------------- /config/README.md: -------------------------------------------------------------------------------- 1 | # config/ 2 | 3 | This directory contains `yaml` files used by the `extract_compressed` Python script to extract the compressed chunks in the ROM that do not (appear to?) have an offsets table. 4 | 5 | # Compressed Sections 6 | 7 | ## Decompression 8 | 9 | Use the `extract_compressed.py` script to decompress these compressed files. 10 | 11 | The arguments are the config file, the file to be decompressed, and the output directory to extract to, e.g.: 12 | 13 | ```sh 14 | mkdir -p tmp 15 | python3 tools/extract_compressed.py config/compressed.us.yaml bin/compressed.bin tmp/ 16 | ``` 17 | **NOTE:** Change `us` to `eu` if you are working with the `eu` ROM. 18 | 19 | ### Compression 20 | 21 | The same script that is used to compress the `game` assets can be re-used to compressed these files. There is no 2-byte alignment within these files, so be sure to pass the `--no-padding` flag: 22 | 23 | ```sh 24 | # create output folder 25 | mkdir -p tmp2 26 | # perform compression 27 | python3 tools/compress_dir.py tmp tmp2 --no-padding 28 | # combine compressed files into single blob 29 | cat tmp2/*.gz > compressed.bin 30 | ``` 31 | 32 | In the ROM there is `0x0` padding added to the end of the compressed section to align to a 16 byte boundary. 33 | -------------------------------------------------------------------------------- /config/assets08.yaml: -------------------------------------------------------------------------------- 1 | files: 2 | - compressed: 54 3 | start: 112 4 | uncompressed: 120 5 | - compressed: 94 6 | start: 168 7 | uncompressed: 272 8 | - compressed: 98 9 | start: 264 10 | uncompressed: 312 11 | - compressed: 95 12 | start: 368 13 | uncompressed: 280 14 | - compressed: 67 15 | start: 464 16 | uncompressed: 152 17 | - compressed: 103 18 | start: 536 19 | uncompressed: 312 20 | - compressed: 64 21 | start: 640 22 | uncompressed: 144 23 | - compressed: 119 24 | start: 704 25 | uncompressed: 440 26 | - compressed: 71 27 | start: 824 28 | uncompressed: 152 29 | name: '00000000' 30 | start: 0 31 | -------------------------------------------------------------------------------- /config/assets1C.yaml: -------------------------------------------------------------------------------- 1 | files: 2 | - compressed: 1440 3 | start: 32 4 | uncompressed: 2444 5 | - compressed: 121 6 | start: 1472 7 | uncompressed: 166 8 | - compressed: 504 9 | start: 1600 10 | uncompressed: 864 11 | - compressed: 1010 12 | start: 2104 13 | uncompressed: 1960 14 | name: '00000000' 15 | start: 0 16 | -------------------------------------------------------------------------------- /conker.debug.sha1: -------------------------------------------------------------------------------- 1 | 3b99222ee76f6277a963142cd807b3df25d5174f -------------------------------------------------------------------------------- /conker.ects.sha1: -------------------------------------------------------------------------------- 1 | 06597dc935651f8995bfacc30fde6e621d44c3e1 -------------------------------------------------------------------------------- /conker.eu.sha1: -------------------------------------------------------------------------------- 1 | ee7bc6656fd1e1d9ffb3d19add759f28b88df710 -------------------------------------------------------------------------------- /conker.us.sha1: -------------------------------------------------------------------------------- 1 | 4cbadd3c4e0729dec46af64ad018050eada4f47a -------------------------------------------------------------------------------- /conker/README.md: -------------------------------------------------------------------------------- 1 | # Conker's Bad Fur Day (code) decompilation 2 | 3 | **TL;DR** - Read the [wiki](https://github.com/mkst/conker/wiki) for the most up-to-date information. 4 | 5 | There are three code sections within the ROM: 6 | - initialisation code + libultra; this is referred to as `init` and is translated to address `0x10000000` 7 | - core game code; this is referred to as `game` and is translated to address `0x15000000` 8 | - debugger code; referred to as `debugger` and translated to address `0x16000000` 9 | 10 | In the `us`, `eu` and `debug` ROMs this `game` code is compressed; in the earlier `ects` ROM it is not. 11 | 12 | These sections are pulled out of the ROM and combined in order to have a standard way of compiling the code across the different versions. 13 | 14 | ## Building 15 | 16 | The following assumes you are within the `conker/` directory of the repo, 17 | 18 | **Extract the `game.VERSION.bin`** 19 | 20 | ```sh 21 | make extract 22 | ``` 23 | 24 | **Compile** 25 | 26 | ```sh 27 | make --jobs 28 | ``` 29 | 30 | **Replace sections of original ROM split with newly compiled** 31 | 32 | ```sh 33 | make replace 34 | ``` 35 | 36 | **Rebuild ROM** 37 | ```sh 38 | make -C .. 39 | ``` 40 | -------------------------------------------------------------------------------- /conker/conker.debug.sha1: -------------------------------------------------------------------------------- 1 | 3902ce173a62b73d855cf6819e67d615d97728f5 -------------------------------------------------------------------------------- /conker/conker.ects.sha1: -------------------------------------------------------------------------------- 1 | fbddfe3744540836bfeb5b9692056be27270542f -------------------------------------------------------------------------------- /conker/conker.eu.sha1: -------------------------------------------------------------------------------- 1 | c3904f30d9248dae6cb1cd946207a13c1dc96a96 -------------------------------------------------------------------------------- /conker/conker.us.sha1: -------------------------------------------------------------------------------- 1 | 842e3d348e3c8ae0039e2ab367ad492f9b5266d8 -------------------------------------------------------------------------------- /conker/diff_settings.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | VERSION = 'us' 4 | 5 | def apply(config, args): 6 | config['baseimg'] = f'conker.{VERSION}.bin' 7 | config['myimg'] = f'build/conker.{VERSION}.bin' 8 | config['mapfile'] = f'build/conker.{VERSION}.map' 9 | config['source_directories'] = ['src', 'include'] 10 | -------------------------------------------------------------------------------- /conker/include/2.0L/PR/os_internal.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * * 3 | * Copyright (C) 1995, Silicon Graphics, Inc. * 4 | * * 5 | * These coded instructions, statements, and computer programs contain * 6 | * unpublished proprietary information of Silicon Graphics, Inc., and * 7 | * are protected by Federal copyright law. They may not be disclosed * 8 | * to third parties or copied or duplicated in any form, in whole or * 9 | * in part, without the prior written consent of Silicon Graphics, Inc. * 10 | * * 11 | **************************************************************************/ 12 | 13 | /*---------------------------------------------------------------------* 14 | Copyright (C) 1998 Nintendo. (Originated by SGI) 15 | 16 | $RCSfile: os_internal.h,v $ 17 | $Revision: 1.20 $ 18 | $Date: 1998/10/09 08:01:09 $ 19 | *---------------------------------------------------------------------*/ 20 | 21 | #ifndef _OS_INTERNAL_H_ 22 | #define _OS_INTERNAL_H_ 23 | 24 | #ifdef _LANGUAGE_C_PLUS_PLUS 25 | extern "C" { 26 | #endif 27 | 28 | #include 29 | 30 | #if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) 31 | 32 | #include "os_internal_reg.h" 33 | #include "os_internal_exception.h" 34 | #include "os_internal_tlb.h" 35 | #include "os_internal_si.h" 36 | #include "os_internal_rsp.h" 37 | #include "os_internal_error.h" 38 | #include "os_internal_gio.h" 39 | #include "os_internal_thread.h" 40 | #include "os_internal_debug.h" 41 | #include "os_internal_host.h" 42 | 43 | #endif /* _LANGUAGE_C */ 44 | 45 | #ifdef _LANGUAGE_C_PLUS_PLUS 46 | } 47 | #endif 48 | 49 | #endif /* !_OS_INTERNAL_H */ 50 | -------------------------------------------------------------------------------- /conker/include/2.0L/PR/os_internal_debug.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * * 3 | * Copyright (C) 1995, Silicon Graphics, Inc. * 4 | * * 5 | * These coded instructions, statements, and computer programs contain * 6 | * unpublished proprietary information of Silicon Graphics, Inc., and * 7 | * are protected by Federal copyright law. They may not be disclosed * 8 | * to third parties or copied or duplicated in any form, in whole or * 9 | * in part, without the prior written consent of Silicon Graphics, Inc. * 10 | * * 11 | **************************************************************************/ 12 | 13 | /*---------------------------------------------------------------------* 14 | Copyright (C) 1998 Nintendo. (Originated by SGI) 15 | 16 | $RCSfile: os_internal_debug.h,v $ 17 | $Revision: 1.1 $ 18 | $Date: 1998/10/09 08:01:09 $ 19 | *---------------------------------------------------------------------*/ 20 | 21 | #ifndef _OS_INTERNAL_DEBUG_H_ 22 | #define _OS_INTERNAL_DEBUG_H_ 23 | 24 | #ifdef _LANGUAGE_C_PLUS_PLUS 25 | extern "C" { 26 | #endif 27 | 28 | #include 29 | 30 | #if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) 31 | 32 | /* Debug port */ 33 | extern void __osSyncPutChars(int, int, const char *); 34 | extern int __osAtomicDec(unsigned int *p); 35 | 36 | 37 | #endif /* _LANGUAGE_C */ 38 | 39 | #ifdef _LANGUAGE_C_PLUS_PLUS 40 | } 41 | #endif 42 | 43 | #endif /* !_OS_INTERNAL_DEBUG_H */ 44 | -------------------------------------------------------------------------------- /conker/include/2.0L/PR/os_internal_error.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * * 3 | * Copyright (C) 1995, Silicon Graphics, Inc. * 4 | * * 5 | * These coded instructions, statements, and computer programs contain * 6 | * unpublished proprietary information of Silicon Graphics, Inc., and * 7 | * are protected by Federal copyright law. They may not be disclosed * 8 | * to third parties or copied or duplicated in any form, in whole or * 9 | * in part, without the prior written consent of Silicon Graphics, Inc. * 10 | * * 11 | **************************************************************************/ 12 | 13 | /*---------------------------------------------------------------------* 14 | Copyright (C) 1998 Nintendo. (Originated by SGI) 15 | 16 | $RCSfile: os_internal_error.h,v $ 17 | $Revision: 1.1 $ 18 | $Date: 1998/10/09 08:01:10 $ 19 | *---------------------------------------------------------------------*/ 20 | 21 | #ifndef _OS_INTERNAL_ERROR_H_ 22 | #define _OS_INTERNAL_ERROR_H_ 23 | 24 | #ifdef _LANGUAGE_C_PLUS_PLUS 25 | extern "C" { 26 | #endif 27 | 28 | #include 29 | 30 | #if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) 31 | 32 | /* Error handling */ 33 | 34 | extern void __osError(s16, s16, ...); 35 | extern OSThread * __osGetCurrFaultedThread(void); 36 | extern OSThread * __osGetNextFaultedThread(OSThread *); 37 | 38 | 39 | #endif /* _LANGUAGE_C */ 40 | 41 | #ifdef _LANGUAGE_C_PLUS_PLUS 42 | } 43 | #endif 44 | 45 | #endif /* !_OS_INTERNAL_ERROR_H */ 46 | -------------------------------------------------------------------------------- /conker/include/2.0L/PR/os_internal_exception.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * * 3 | * Copyright (C) 1995, Silicon Graphics, Inc. * 4 | * * 5 | * These coded instructions, statements, and computer programs contain * 6 | * unpublished proprietary information of Silicon Graphics, Inc., and * 7 | * are protected by Federal copyright law. They may not be disclosed * 8 | * to third parties or copied or duplicated in any form, in whole or * 9 | * in part, without the prior written consent of Silicon Graphics, Inc. * 10 | * * 11 | **************************************************************************/ 12 | 13 | /*---------------------------------------------------------------------* 14 | Copyright (C) 1998 Nintendo. (Originated by SGI) 15 | 16 | $RCSfile: os_internal_exception.h,v $ 17 | $Revision: 1.1 $ 18 | $Date: 1998/10/09 08:01:10 $ 19 | *---------------------------------------------------------------------*/ 20 | 21 | #ifndef _OS_INTERNAL_EXCEPTION_H_ 22 | #define _OS_INTERNAL_EXCEPTION_H_ 23 | 24 | #ifdef _LANGUAGE_C_PLUS_PLUS 25 | extern "C" { 26 | #endif 27 | 28 | #include 29 | 30 | #if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) 31 | 32 | /* Routine for HW interrupt "handler" */ 33 | extern void __osSetHWIntrRoutine(OSHWIntr interrupt, 34 | s32 (*handler)(void)); // no stackEnd 35 | extern void __osGetHWIntrRoutine(OSHWIntr interrupt, 36 | s32 (**handler)(void), void **stackEnd); 37 | 38 | /* Routine for global interrupt mask */ 39 | extern void __osSetGlobalIntMask(OSHWIntr); 40 | extern void __osResetGlobalIntMask(OSHWIntr); 41 | 42 | 43 | #endif /* _LANGUAGE_C */ 44 | 45 | #ifdef _LANGUAGE_C_PLUS_PLUS 46 | } 47 | #endif 48 | 49 | #endif /* !_OS_INTERNAL_EXCEPTION_H */ 50 | -------------------------------------------------------------------------------- /conker/include/2.0L/PR/os_internal_gio.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * * 3 | * Copyright (C) 1995, Silicon Graphics, Inc. * 4 | * * 5 | * These coded instructions, statements, and computer programs contain * 6 | * unpublished proprietary information of Silicon Graphics, Inc., and * 7 | * are protected by Federal copyright law. They may not be disclosed * 8 | * to third parties or copied or duplicated in any form, in whole or * 9 | * in part, without the prior written consent of Silicon Graphics, Inc. * 10 | * * 11 | **************************************************************************/ 12 | 13 | /*---------------------------------------------------------------------* 14 | Copyright (C) 1998 Nintendo. (Originated by SGI) 15 | 16 | $RCSfile: os_internal_gio.h,v $ 17 | $Revision: 1.1 $ 18 | $Date: 1998/10/09 08:01:11 $ 19 | *---------------------------------------------------------------------*/ 20 | 21 | #ifndef _OS_INTERNAL_GIO_H_ 22 | #define _OS_INTERNAL_GIO_H_ 23 | 24 | #ifdef _LANGUAGE_C_PLUS_PLUS 25 | extern "C" { 26 | #endif 27 | 28 | #include 29 | 30 | #if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) 31 | 32 | /* Development board functions */ 33 | 34 | extern void __osGIOInit(s32); 35 | extern void __osGIOInterrupt(s32); 36 | extern void __osGIORawInterrupt(s32); 37 | 38 | 39 | #endif /* _LANGUAGE_C */ 40 | 41 | #ifdef _LANGUAGE_C_PLUS_PLUS 42 | } 43 | #endif 44 | 45 | #endif /* !_OS_INTERNAL_GIO_H */ 46 | -------------------------------------------------------------------------------- /conker/include/2.0L/PR/os_internal_host.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * * 3 | * Copyright (C) 1995, Silicon Graphics, Inc. * 4 | * * 5 | * These coded instructions, statements, and computer programs contain * 6 | * unpublished proprietary information of Silicon Graphics, Inc., and * 7 | * are protected by Federal copyright law. They may not be disclosed * 8 | * to third parties or copied or duplicated in any form, in whole or * 9 | * in part, without the prior written consent of Silicon Graphics, Inc. * 10 | * * 11 | **************************************************************************/ 12 | 13 | /*---------------------------------------------------------------------* 14 | Copyright (C) 1998 Nintendo. (Originated by SGI) 15 | 16 | $RCSfile: os_internal_host.h,v $ 17 | $Revision: 1.1 $ 18 | $Date: 1998/10/09 08:01:11 $ 19 | *---------------------------------------------------------------------*/ 20 | 21 | #ifndef _OS_INTERNAL_HOST_H_ 22 | #define _OS_INTERNAL_HOST_H_ 23 | 24 | #ifdef _LANGUAGE_C_PLUS_PLUS 25 | extern "C" { 26 | #endif 27 | 28 | #include 29 | 30 | #if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) 31 | 32 | /* routine for rdb port */ 33 | extern u32 __osRdbSend(u8 *buf, u32 size, u32 type); 34 | 35 | 36 | #endif /* _LANGUAGE_C */ 37 | 38 | #ifdef _LANGUAGE_C_PLUS_PLUS 39 | } 40 | #endif 41 | 42 | #endif /* !_OS_INTERNAL_HOST_H */ 43 | -------------------------------------------------------------------------------- /conker/include/2.0L/PR/os_internal_reg.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * * 3 | * Copyright (C) 1995, Silicon Graphics, Inc. * 4 | * * 5 | * These coded instructions, statements, and computer programs contain * 6 | * unpublished proprietary information of Silicon Graphics, Inc., and * 7 | * are protected by Federal copyright law. They may not be disclosed * 8 | * to third parties or copied or duplicated in any form, in whole or * 9 | * in part, without the prior written consent of Silicon Graphics, Inc. * 10 | * * 11 | **************************************************************************/ 12 | 13 | /*---------------------------------------------------------------------* 14 | Copyright (C) 1998 Nintendo. (Originated by SGI) 15 | 16 | $RCSfile: os_internal_reg.h,v $ 17 | $Revision: 1.2 $ 18 | $Date: 1999/03/10 12:19:14 $ 19 | *---------------------------------------------------------------------*/ 20 | 21 | #ifndef _OS_INTERNAL_REG_H_ 22 | #define _OS_INTERNAL_REG_H_ 23 | 24 | #ifdef _LANGUAGE_C_PLUS_PLUS 25 | extern "C" { 26 | #endif 27 | 28 | #include 29 | 30 | #if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) 31 | 32 | /* Routines to get/fetch coprocessor 0 registers */ 33 | 34 | extern u32 __osGetCause(void); 35 | extern void __osSetCause(u32); 36 | extern u32 __osGetCompare(void); 37 | extern void __osSetCompare(u32); 38 | extern u32 __osGetConfig(void); 39 | extern void __osSetConfig(u32); 40 | extern void __osSetCount(u32); 41 | extern u32 __osGetSR(void); 42 | extern void __osSetSR(u32); 43 | extern u32 __osDisableInt(void); 44 | extern void __osRestoreInt(u32); 45 | extern u32 __osGetWatchLo(void); 46 | extern void __osSetWatchLo(u32); 47 | 48 | /* Routines to get/set floating-point control and status register */ 49 | extern u32 __osSetFpcCsr(u32); 50 | extern u32 __osGetFpcCsr(void); 51 | 52 | 53 | #endif /* _LANGUAGE_C */ 54 | 55 | #ifdef _LANGUAGE_C_PLUS_PLUS 56 | } 57 | #endif 58 | 59 | #endif /* !_OS_INTERNAL_REG_H */ 60 | -------------------------------------------------------------------------------- /conker/include/2.0L/PR/os_internal_rsp.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * * 3 | * Copyright (C) 1995, Silicon Graphics, Inc. * 4 | * * 5 | * These coded instructions, statements, and computer programs contain * 6 | * unpublished proprietary information of Silicon Graphics, Inc., and * 7 | * are protected by Federal copyright law. They may not be disclosed * 8 | * to third parties or copied or duplicated in any form, in whole or * 9 | * in part, without the prior written consent of Silicon Graphics, Inc. * 10 | * * 11 | **************************************************************************/ 12 | 13 | /*---------------------------------------------------------------------* 14 | Copyright (C) 1998 Nintendo. (Originated by SGI) 15 | 16 | $RCSfile: os_internal_rsp.h,v $ 17 | $Revision: 1.1 $ 18 | $Date: 1998/10/09 08:01:12 $ 19 | *---------------------------------------------------------------------*/ 20 | 21 | #ifndef _OS_INTERNAL_RSP_H_ 22 | #define _OS_INTERNAL_RSP_H_ 23 | 24 | #ifdef _LANGUAGE_C_PLUS_PLUS 25 | extern "C" { 26 | #endif 27 | 28 | #include 29 | 30 | #if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) 31 | 32 | /* Signal processor interface (Sp) */ 33 | 34 | extern u32 __osSpGetStatus(void); 35 | extern void __osSpSetStatus(u32); 36 | extern s32 __osSpSetPc(u32); 37 | extern s32 __osSpRawWriteIo(u32, u32); 38 | extern s32 __osSpRawReadIo(u32, u32 *); 39 | extern s32 __osSpRawStartDma(s32, u32, void *, u32); 40 | 41 | 42 | #endif /* _LANGUAGE_C */ 43 | 44 | #ifdef _LANGUAGE_C_PLUS_PLUS 45 | } 46 | #endif 47 | 48 | #endif /* !_OS_INTERNAL_RSP_H */ 49 | -------------------------------------------------------------------------------- /conker/include/2.0L/PR/os_internal_si.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * * 3 | * Copyright (C) 1995, Silicon Graphics, Inc. * 4 | * * 5 | * These coded instructions, statements, and computer programs contain * 6 | * unpublished proprietary information of Silicon Graphics, Inc., and * 7 | * are protected by Federal copyright law. They may not be disclosed * 8 | * to third parties or copied or duplicated in any form, in whole or * 9 | * in part, without the prior written consent of Silicon Graphics, Inc. * 10 | * * 11 | **************************************************************************/ 12 | 13 | /*---------------------------------------------------------------------* 14 | Copyright (C) 1998 Nintendo. (Originated by SGI) 15 | 16 | $RCSfile: os_internal_si.h,v $ 17 | $Revision: 1.1 $ 18 | $Date: 1998/10/09 08:01:13 $ 19 | *---------------------------------------------------------------------*/ 20 | 21 | #ifndef _OS_INTERNAL_SI_H_ 22 | #define _OS_INTERNAL_SI_H_ 23 | 24 | #ifdef _LANGUAGE_C_PLUS_PLUS 25 | extern "C" { 26 | #endif 27 | 28 | #include 29 | 30 | #if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) 31 | 32 | /* Serial interface (Si) */ 33 | 34 | extern u32 __osSiGetStatus(void); 35 | extern s32 __osSiRawWriteIo(u32, u32); 36 | extern s32 __osSiRawReadIo(u32, u32 *); 37 | extern s32 __osSiRawStartDma(s32, void *); 38 | 39 | 40 | #endif /* _LANGUAGE_C */ 41 | 42 | #ifdef _LANGUAGE_C_PLUS_PLUS 43 | } 44 | #endif 45 | 46 | #endif /* !_OS_INTERNAL_SI_H */ 47 | -------------------------------------------------------------------------------- /conker/include/2.0L/PR/os_internal_thread.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * * 3 | * Copyright (C) 1995, Silicon Graphics, Inc. * 4 | * * 5 | * These coded instructions, statements, and computer programs contain * 6 | * unpublished proprietary information of Silicon Graphics, Inc., and * 7 | * are protected by Federal copyright law. They may not be disclosed * 8 | * to third parties or copied or duplicated in any form, in whole or * 9 | * in part, without the prior written consent of Silicon Graphics, Inc. * 10 | * * 11 | **************************************************************************/ 12 | 13 | /*---------------------------------------------------------------------* 14 | Copyright (C) 1998 Nintendo. (Originated by SGI) 15 | 16 | $RCSfile: os_internal_thread.h,v $ 17 | $Revision: 1.1 $ 18 | $Date: 1998/10/09 08:01:13 $ 19 | *---------------------------------------------------------------------*/ 20 | 21 | #ifndef _OS_INTERNAL_THREAD_H_ 22 | #define _OS_INTERNAL_THREAD_H_ 23 | 24 | #ifdef _LANGUAGE_C_PLUS_PLUS 25 | extern "C" { 26 | #endif 27 | 28 | #include 29 | 30 | #if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) 31 | 32 | /* For debugger use */ 33 | 34 | extern OSThread * __osGetActiveQueue(void); 35 | 36 | 37 | #endif /* _LANGUAGE_C */ 38 | 39 | #ifdef _LANGUAGE_C_PLUS_PLUS 40 | } 41 | #endif 42 | 43 | #endif /* !_OS_INTERNAL_THREAD_H */ 44 | -------------------------------------------------------------------------------- /conker/include/2.0L/PR/os_internal_tlb.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * * 3 | * Copyright (C) 1995, Silicon Graphics, Inc. * 4 | * * 5 | * These coded instructions, statements, and computer programs contain * 6 | * unpublished proprietary information of Silicon Graphics, Inc., and * 7 | * are protected by Federal copyright law. They may not be disclosed * 8 | * to third parties or copied or duplicated in any form, in whole or * 9 | * in part, without the prior written consent of Silicon Graphics, Inc. * 10 | * * 11 | **************************************************************************/ 12 | 13 | /*---------------------------------------------------------------------* 14 | Copyright (C) 1998 Nintendo. (Originated by SGI) 15 | 16 | $RCSfile: os_internal_tlb.h,v $ 17 | $Revision: 1.1 $ 18 | $Date: 1998/10/09 08:01:14 $ 19 | *---------------------------------------------------------------------*/ 20 | 21 | #ifndef _OS_INTERNAL_TLB_H_ 22 | #define _OS_INTERNAL_TLB_H_ 23 | 24 | #ifdef _LANGUAGE_C_PLUS_PLUS 25 | extern "C" { 26 | #endif 27 | 28 | #include 29 | 30 | #if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) 31 | 32 | /* Routines for fetch TLB info */ 33 | 34 | extern u32 __osGetTLBASID(void); 35 | extern u32 __osGetTLBPageMask(s32); 36 | extern u32 __osGetTLBHi(s32); 37 | extern u32 __osGetTLBLo0(s32); 38 | extern u32 __osGetTLBLo1(s32); 39 | 40 | 41 | #endif /* _LANGUAGE_C */ 42 | 43 | #ifdef _LANGUAGE_C_PLUS_PLUS 44 | } 45 | #endif 46 | 47 | #endif /* !_OS_INTERNAL_TLB_H */ 48 | -------------------------------------------------------------------------------- /conker/include/2.0L/PR/os_motor.h: -------------------------------------------------------------------------------- 1 | 2 | /*---------------------------------------------------------------------* 3 | Copyright (C) 1998 Nintendo. 4 | 5 | $RCSfile: os_motor.h,v $ 6 | $Revision: 1.1 $ 7 | $Date: 1998/10/09 08:01:15 $ 8 | *---------------------------------------------------------------------*/ 9 | 10 | #ifndef _OS_MOTOR_H_ 11 | #define _OS_MOTOR_H_ 12 | 13 | #ifdef _LANGUAGE_C_PLUS_PLUS 14 | extern "C" { 15 | #endif 16 | 17 | #include 18 | #include "os_message.h" 19 | #include "os_pfs.h" 20 | 21 | 22 | #if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) 23 | 24 | /************************************************************************** 25 | * 26 | * Type definitions 27 | * 28 | */ 29 | 30 | 31 | #endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ 32 | 33 | /************************************************************************** 34 | * 35 | * Global definitions 36 | * 37 | */ 38 | 39 | 40 | #if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) 41 | 42 | /************************************************************************** 43 | * 44 | * Macro definitions 45 | * 46 | */ 47 | 48 | 49 | /************************************************************************** 50 | * 51 | * Extern variables 52 | * 53 | */ 54 | 55 | 56 | /************************************************************************** 57 | * 58 | * Function prototypes 59 | * 60 | */ 61 | 62 | /* Rumble PAK interface */ 63 | 64 | extern s32 osMotorInit(OSMesgQueue *, OSPfs *, int); 65 | #if 1 66 | #define MOTOR_START 1 67 | #define MOTOR_STOP 0 68 | #define osMotorStart(x) __osMotorAccess((x), MOTOR_START) 69 | #define osMotorStop(x) __osMotorAccess((x), MOTOR_STOP) 70 | extern s32 __osMotorAccess(OSPfs *, s32); 71 | #else 72 | extern s32 osMotorStop(OSPfs *); 73 | extern s32 osMotorStart(OSPfs *); 74 | #endif 75 | 76 | 77 | #endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ 78 | 79 | #ifdef _LANGUAGE_C_PLUS_PLUS 80 | } 81 | #endif 82 | 83 | #endif /* !_OS_MOTOR_H_ */ 84 | -------------------------------------------------------------------------------- /conker/include/2.0L/PR/os_version.h: -------------------------------------------------------------------------------- 1 | 2 | /*---------------------------------------------------------------------* 3 | Copyright (C) 1998 Nintendo. 4 | 5 | $RCSfile: os_version.h,v $ 6 | $Revision: 1.2 $ 7 | $Date: 1999/06/17 01:33:01 $ 8 | *---------------------------------------------------------------------*/ 9 | 10 | #ifndef _OS_VERSION_H_ 11 | #define _OS_VERSION_H_ 12 | 13 | #define OS_MAJOR_VERSION "2.0K" /* major version */ 14 | #define OS_MINOR_VERSION 0 /* patch level */ 15 | 16 | #endif /* !_OS_VERSION_H_ */ 17 | -------------------------------------------------------------------------------- /conker/include/2.0L/PR/rmon.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * * 3 | * Copyright (C) 1995, Silicon Graphics, Inc. * 4 | * * 5 | * These coded instructions, statements, and computer programs contain * 6 | * unpublished proprietary information of Silicon Graphics, Inc., and * 7 | * are protected by Federal copyright law. They may not be disclosed * 8 | * to third parties or copied or duplicated in any form, in whole or * 9 | * in part, without the prior written consent of Silicon Graphics, Inc. * 10 | * * 11 | **************************************************************************/ 12 | 13 | /************************************************************************** 14 | * 15 | * $Revision: 1.6 $ 16 | * $Date: 1997/02/11 08:30:08 $ 17 | * $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/rmon.h,v $ 18 | * 19 | **************************************************************************/ 20 | 21 | #ifndef _RMON_H_ 22 | #define _RMON_H_ 23 | 24 | #ifdef _LANGUAGE_C_PLUS_PLUS 25 | extern "C" { 26 | #endif 27 | 28 | #include 29 | #define RMON_DBG_BUF_SIZE 2048 30 | #define RMON_STACKSIZE 0x1000 31 | 32 | extern void rmonMain( void * ); 33 | extern void rmonPrintf( const char *, ... ); 34 | 35 | #ifdef _LANGUAGE_C_PLUS_PLUS 36 | } 37 | #endif 38 | 39 | #endif /* !_OS_H */ 40 | -------------------------------------------------------------------------------- /conker/include/2.0L/assert.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASSERT_H__ 2 | #define __ASSERT_H__ 3 | 4 | #ifdef NDEBUG 5 | #undef assert 6 | #define assert(EX) ((void)0) 7 | #else 8 | extern void __assert(const char *, const char *, int); 9 | #define assert(EX) ((EX)?((void)0):__assert( # EX , __FILE__, __LINE__)) 10 | #endif /* NDEBUG */ 11 | 12 | #endif /* !__ASSERT_H__ */ 13 | -------------------------------------------------------------------------------- /conker/include/2.0L/ultra64.h: -------------------------------------------------------------------------------- 1 | 2 | /************************************************************************** 3 | * * 4 | * Copyright (C) 1994, Silicon Graphics, Inc. * 5 | * * 6 | * These coded instructions, statements, and computer programs contain * 7 | * unpublished proprietary information of Silicon Graphics, Inc., and * 8 | * are protected by Federal copyright law. They may not be disclosed * 9 | * to third parties or copied or duplicated in any form, in whole or * 10 | * in part, without the prior written consent of Silicon Graphics, Inc. * 11 | * * 12 | *************************************************************************/ 13 | 14 | /************************************************************************** 15 | * 16 | * $Revision: 1.10 $ 17 | * $Date: 1997/02/11 08:37:33 $ 18 | * $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/ultra64.h,v $ 19 | * 20 | **************************************************************************/ 21 | 22 | #ifndef _ULTRA64_H_ 23 | #define _ULTRA64_H_ 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /conker/include/libc/math.h: -------------------------------------------------------------------------------- 1 | #ifndef MATH_H 2 | #define MATH_H 3 | 4 | #define M_PI 3.14159265358979323846 5 | 6 | float sinf(float); 7 | double sin(double); 8 | float cosf(float); 9 | double cos(double); 10 | 11 | float sqrtf(float); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /conker/include/libc/stdarg.h: -------------------------------------------------------------------------------- 1 | #ifndef STDARG_H 2 | #define STDARG_H 3 | 4 | // When not building with IDO, use the builtin vaarg macros for portability. 5 | #ifndef __sgi 6 | #define va_list __builtin_va_list 7 | #define va_start __builtin_va_start 8 | #define va_arg __builtin_va_arg 9 | #define va_end __builtin_va_end 10 | #else 11 | 12 | typedef char *va_list; 13 | #define _FP 1 14 | #define _INT 0 15 | #define _STRUCT 2 16 | 17 | #define _VA_FP_SAVE_AREA 0x10 18 | #define _VA_ALIGN(p, a) (((unsigned int)(((char *)p) + ((a) > 4 ? (a) : 4) - 1)) & -((a) > 4 ? (a) : 4)) 19 | #define va_start(vp, parmN) (vp = ((va_list)&parmN + sizeof(parmN))) 20 | 21 | #define __va_stack_arg(list, mode) \ 22 | ( \ 23 | ((list) = (char *)_VA_ALIGN(list, __builtin_alignof(mode)) + \ 24 | _VA_ALIGN(sizeof(mode), 4)), \ 25 | (((char *)list) - (_VA_ALIGN(sizeof(mode), 4) - sizeof(mode)))) 26 | 27 | #define __va_double_arg(list, mode) \ 28 | ( \ 29 | (((long)list & 0x1) /* 1 byte aligned? */ \ 30 | ? (list = (char *)((long)list + 7), (char *)((long)list - 6 - _VA_FP_SAVE_AREA)) \ 31 | : (((long)list & 0x2) /* 2 byte aligned? */ \ 32 | ? (list = (char *)((long)list + 10), (char *)((long)list - 24 - _VA_FP_SAVE_AREA)) \ 33 | : __va_stack_arg(list, mode)))) 34 | 35 | #define va_arg(list, mode) ((mode *)(((__builtin_classof(mode) == _FP && \ 36 | __builtin_alignof(mode) == sizeof(double)) \ 37 | ? __va_double_arg(list, mode) \ 38 | : __va_stack_arg(list, mode))))[-1] 39 | #define va_end(__list) 40 | 41 | #endif 42 | #endif 43 | -------------------------------------------------------------------------------- /conker/include/libc/stddef.h: -------------------------------------------------------------------------------- 1 | #ifndef STDDEF_H 2 | #define STDDEF_H 3 | 4 | #include "PR/ultratypes.h" 5 | 6 | #ifndef offsetof 7 | #define offsetof(st, m) ((size_t)&(((st *)0)->m)) 8 | #endif 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /conker/include/libc/stdio.h: -------------------------------------------------------------------------------- 1 | #ifndef STDIO_H 2 | #define STDIO_H 3 | 4 | extern int sprintf(char *s, const char *fmt, ...); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /conker/include/libc/stdlib.h: -------------------------------------------------------------------------------- 1 | #ifndef STDLIB_H 2 | #define STDLIB_H 3 | 4 | typedef struct lldiv_t 5 | { 6 | long long quot; 7 | long long rem; 8 | } lldiv_t; 9 | 10 | typedef struct ldiv_t 11 | { 12 | long quot; 13 | long rem; 14 | } ldiv_t; 15 | 16 | lldiv_t lldiv(long long num, long long denom); 17 | ldiv_t ldiv(long num, long denom); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /conker/include/libc/string.h: -------------------------------------------------------------------------------- 1 | #ifndef STRING_H 2 | #define STRING_H 3 | 4 | #include "PR/ultratypes.h" 5 | 6 | void *memcpy(void *dst, const void *src, size_t size); 7 | size_t strlen(const char *str); 8 | char *strchr(const char *str, s32 ch); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /conker/include/macro.inc: -------------------------------------------------------------------------------- 1 | # Assembly Macros 2 | 3 | .set K0BASE, 0x80000000 4 | .set K1BASE, 0xA0000000 5 | .set K2BASE, 0xC0000000 6 | 7 | .macro glabel label 8 | .global \label 9 | .balign 4 10 | \label: 11 | .endm 12 | 13 | .macro .word32 x 14 | .word \x 15 | .endm 16 | -------------------------------------------------------------------------------- /conker/include/macros.h: -------------------------------------------------------------------------------- 1 | #ifndef MACROS_H 2 | #define MACROS_H 3 | 4 | #define ALIGN2(val) ((((s32)val) + 0x1) & ~0x1) 5 | #define ALIGN4(val) ((((s32)val) + 0x3) & ~0x3) 6 | #define ALIGN8(val) ((((s32)val) + 0x7) & ~0x7) 7 | #define ALIGN16(val) ((((s32)val) + 0xF) & ~0xF) 8 | 9 | #define ALIGNU16(val) ((((u32)val) + 0xF) & ~0xF) 10 | 11 | #define CLAMP(x, min, max) ((x) < (min) ? (min) : (x) > (max) ? (max) : (x)) 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /conker/include/magic.h: -------------------------------------------------------------------------------- 1 | #ifndef MAGIC_H 2 | #define MAGIC_H 3 | 4 | /* 5 | 6 | Magic numbers encountered: 7 | 8 | 0x1A37E0 9 | 0xAB1950 This is the offsets table in US ROM 10 | 0xC000037 11 | 0x40F0FAAC 12 | 0x98CCE31A 13 | 0xE7B00F09 14 | 0xF0F0F0F0 15 | 16 | */ 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /conker/src/debugger_256F80.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | #pragma GLOBAL_ASM("asm/nonmatchings/debugger_256F80/func_16001700.s") 8 | #pragma GLOBAL_ASM("asm/nonmatchings/debugger_256F80/func_16001830.s") 9 | #pragma GLOBAL_ASM("asm/nonmatchings/debugger_256F80/func_160018BC.s") 10 | 11 | // another __osSiDeviceBusy function 12 | s32 func_16001984() 13 | { 14 | register u32 stat = IO_READ(SI_STATUS_REG); 15 | if (stat & (SI_STATUS_DMA_BUSY | SI_STATUS_RD_BUSY)) 16 | return 1; 17 | return 0; 18 | } 19 | 20 | // very similar to __osSiRawStartDma 21 | s32 func_160019A8(s32 direction, void *dramAddr) { 22 | if ((s32)dramAddr & 3) { // what is this checking? 23 | return -1; 24 | } 25 | if (func_16001984()) { 26 | return -1; 27 | } 28 | 29 | if (direction == OS_WRITE) { 30 | osWritebackDCache(dramAddr, 64); 31 | } 32 | 33 | IO_WRITE(SI_DRAM_ADDR_REG, osVirtualToPhysical(dramAddr)); 34 | 35 | if (direction == OS_READ) { 36 | IO_WRITE(SI_PIF_ADDR_RD64B_REG, 0x1FC007C0); 37 | } else { 38 | IO_WRITE(SI_PIF_ADDR_WR64B_REG, 0x1FC007C0); 39 | } 40 | if (direction == OS_READ) { 41 | osInvalDCache(dramAddr, 64); 42 | } 43 | 44 | return 0; 45 | } 46 | 47 | void func_16001A64(void) { 48 | } 49 | 50 | s32 func_16001A6C(f32 arg0) { 51 | s32 tmp = *(s32*) &arg0; 52 | 53 | if ((tmp * 2) == 0) { 54 | return 0; 55 | } 56 | tmp = (tmp & 0x7F800000) >> 0x17; 57 | if ((tmp <= 0) || (tmp >= 255)) { 58 | return 1; 59 | } 60 | return 0; 61 | } 62 | -------------------------------------------------------------------------------- /conker/src/debugger_257330.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_16001AB0(s32 arg0, s32 arg1, s32 arg2, s32 arg3) { 8 | } 9 | -------------------------------------------------------------------------------- /conker/src/debugger_257350.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | // whats wrong with bcopy? 8 | u8* func_16001AD0(u8 *arg0, u8 *arg1, u32 arg2) { 9 | u8 *tmp0 = arg0; 10 | u8 *tmp1 = arg1; 11 | 12 | while (arg2 > 0) { 13 | *tmp0++ = *tmp1++; 14 | arg2 -= 1; 15 | } 16 | 17 | return arg0; 18 | } 19 | 20 | #pragma GLOBAL_ASM("asm/nonmatchings/debugger_257350/func_16001B00.s") 21 | // NON-MATCHING: moves in wrong order! 22 | // s32 func_16001B00(u8 *arg0) { // strlen 23 | // s32 i; 24 | // for (i = 0; arg0[i]; i++) {}; 25 | // return i; 26 | // } 27 | 28 | #pragma GLOBAL_ASM("asm/nonmatchings/debugger_257350/func_16001B34.s") 29 | // s32 func_16001BB4(void *arg0, s32 arg1, void *arg2, s32 arg3) ; 30 | // NON-MATCHING: need to work out func_16001BB4 31 | // s32 func_16001B34(s8 arg0[], s32 arg1, s32 arg2, s32 arg3) { 32 | // s32 idx = func_16001BB4(&D_16001B8C, &arg1, arg2, &arg3); 33 | // if (idx >= 0) { 34 | // arg0[idx] = 0; 35 | // } 36 | // return idx; 37 | // } 38 | 39 | s32 func_16001B8C(u8 *arg0, u8 *arg1, u32 arg2) { 40 | return func_16001AD0(arg0, arg1, arg2) + arg2; 41 | } 42 | 43 | #pragma GLOBAL_ASM("asm/nonmatchings/debugger_257350/func_16001BB4.s") 44 | // uses jump table 45 | #pragma GLOBAL_ASM("asm/nonmatchings/debugger_257350/func_160021FC.s") 46 | // contains delay slot 47 | #pragma GLOBAL_ASM("asm/nonmatchings/debugger_257350/func_1600288C.s") 48 | #pragma GLOBAL_ASM("asm/nonmatchings/debugger_257350/func_16002D2C.s") 49 | #pragma GLOBAL_ASM("asm/nonmatchings/debugger_257350/func_16002DE4.s") 50 | #pragma GLOBAL_ASM("asm/nonmatchings/debugger_257350/func_160033A8.s") 51 | -------------------------------------------------------------------------------- /conker/src/debugger_258ED0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | // uses tlbr 8 | #pragma GLOBAL_ASM("asm/nonmatchings/debugger_258ED0/func_16003650.s") 9 | -------------------------------------------------------------------------------- /conker/src/game/data/data_800959E0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | f32 D_800959E0 = 999.0; 5 | f32 D_800959E4 = 999.0; 6 | f32 D_800959E8 = -10000.0; 7 | f32 D_800959EC = 999.0; 8 | f32 D_800959F0 = -10000.0; 9 | -------------------------------------------------------------------------------- /conker/src/game/done/game_10B7C0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | void func_150DE310(s32 arg0) { 5 | } 6 | -------------------------------------------------------------------------------- /conker/src/game/done/game_10C140.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_150DEC90(s32 arg0) { 8 | func_15179008(0); 9 | D_800DD444 = 0; 10 | } 11 | -------------------------------------------------------------------------------- /conker/src/game/done/game_10ECB0.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | void func_150E1800(struct108 *arg0) { 6 | if (func_1509BE40(1, 0x403E, 6, 0x2000) != 0) { 7 | arg0->unk84 |= 0x20; 8 | return; 9 | } 10 | arg0->unk84 &= ~0x20; 11 | } 12 | -------------------------------------------------------------------------------- /conker/src/game/done/game_119960.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | 6 | void func_150EC4B0(struct108 *arg0) { 7 | if (func_1509BE40(1, 0x4023, 6, 0x2000) != 0) { 8 | arg0->unk84 |= 0x1010; 9 | } else { 10 | arg0->unk84 &= ~0x1010; 11 | } 12 | arg0->unk84 &= ~8; 13 | } 14 | -------------------------------------------------------------------------------- /conker/src/game/done/game_122650.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | 6 | extern u8 D_80088B44; 7 | extern s32 D_800CC454; 8 | 9 | void func_150F51A0(s32 arg0, s32 arg1) { 10 | D_80088B40 = 1; 11 | } 12 | 13 | s32 func_150F51BC(void) { 14 | if (D_80088B40 != 0) { 15 | D_80088B40 = 0; 16 | return 1; 17 | } else { 18 | return 0; 19 | } 20 | } 21 | 22 | void func_150F51E8(s32 arg0) { 23 | if (((D_800CC454 & 0X1F) == 3) || ((D_800CC454 & 0x1F) == 4)) { 24 | if (D_800BE9E4 < D_80088B44){ 25 | if(D_800C35EA != 1) { 26 | D_80088B44 = (D_80088B44 - D_800BE9E4); 27 | } 28 | } else { 29 | D_80088B44 = ((func_150ADA20() & 0x3F) + 0xC0); 30 | func_10010F30(15, 18000, ((func_150ADA20() & 0x3F) + 0x20), 0, 0); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /conker/src/game/done/game_129EB0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_150FCA00(struct108 *arg0) { 8 | arg0->unk348 = 500.0f; 9 | arg0->unk34C = 500.0f; 10 | arg0->unk374 = 800.0f; 11 | } 12 | -------------------------------------------------------------------------------- /conker/src/game/done/game_12D7E0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | void func_15100330(s32 arg0) { 5 | } 6 | -------------------------------------------------------------------------------- /conker/src/game/done/game_14D0D0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_1511FC20(s32 arg0) { 8 | } 9 | 10 | s32 func_1511FC2C(s32 arg0, s32 arg1, s32 arg2, s32 arg3) { 11 | return arg0; 12 | } 13 | 14 | s32 func_1511FC44(s32 arg0, s32 arg1, s32 arg2, s32 arg3) { 15 | return arg0; 16 | } 17 | -------------------------------------------------------------------------------- /conker/src/game/done/game_15A830.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | void func_1512D380(s32 arg0) { 5 | } 6 | -------------------------------------------------------------------------------- /conker/src/game/done/game_193420.c: -------------------------------------------------------------------------------- 1 | void func_15165F70(void) { 2 | } 3 | -------------------------------------------------------------------------------- /conker/src/game/done/game_1A6300.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | 6 | s32 func_15178E50(s32 arg0) { 7 | if ((D_800B0DF0->unk14 == 1)) { 8 | s32 tmp = D_800DBFF0->unk2FC; 9 | if (D_800B0DF0->unk16 < tmp) { 10 | return 1; 11 | } 12 | } 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /conker/src/game/done/game_1CC420.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | void func_1519EF70(s32 arg0, s32 arg1, s32 arg2) { 5 | } 6 | -------------------------------------------------------------------------------- /conker/src/game/done/game_322B0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15004E00(void) { 8 | u32 i; 9 | 10 | for (i = 0; i < 25; i++) 11 | { 12 | D_800C6660[i].unk0 = 0; 13 | D_800C6660[i].unk4 = 0; 14 | D_800C6660[i].unk8 = 0; 15 | D_800C6660[i].unkF = 0; 16 | } 17 | } 18 | 19 | void func_15004E80(void) { 20 | D_800C3E7C = D_800B0DF0->unk1A; 21 | D_800C3E80 = allocate_memory(D_800C3E7C << 6, 1, 3, 0); 22 | D_800C3E84 = allocate_memory(D_800C3E7C << 6, 1, 3, 0); 23 | } 24 | -------------------------------------------------------------------------------- /conker/src/game/done/game_323B0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15004F00(void) { 8 | D_800C3EE0 = 0; 9 | } 10 | 11 | void func_15004F10(void) { 12 | D_800C4000 = 0xF; 13 | } 14 | -------------------------------------------------------------------------------- /conker/src/game/done/game_323E0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15004F30(void) { 8 | bzero(&D_800D19A0, 748); // bzero 9 | bzero(&D_800D1C90, 748); 10 | bzero(&D_800D1F80, 187); 11 | bzero(&D_800D2040, 187); 12 | bzero(&D_800D1588, 748); 13 | bzero(&D_800C5A90, 374); 14 | bzero(&D_800C5C08, 748); 15 | bzero(&D_800C6070, 748); 16 | bzero(&D_800C6360, 748); 17 | } 18 | -------------------------------------------------------------------------------- /conker/src/game/done/game_32720.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15005270(void) { 8 | D_800C67F1 = (u8)0; 9 | D_800C67F0 = (u8)0; 10 | } 11 | -------------------------------------------------------------------------------- /conker/src/game/done/game_32F10.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15005A60(struct108 *arg0, s32 arg1) { 8 | if (D_800B0DF0->unkE != 0) { 9 | D_80082B40[D_800B0DF0->unkE](arg0); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /conker/src/game/done/game_32F60.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15005AB0(struct108 *arg0) { 8 | arg0->unk1B4 = 1; 9 | arg0->unk1E0 = 3; 10 | arg0->unk348 = 230.0f; 11 | arg0->unk34C = 230.0f; 12 | arg0->unk84 |= 0x4000; 13 | arg0->unk374 = 290.0f; 14 | } 15 | 16 | void func_15005AF0(s32 arg0) { 17 | } 18 | -------------------------------------------------------------------------------- /conker/src/game/done/game_32FB0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15005B00(s32 arg0) { 8 | } 9 | -------------------------------------------------------------------------------- /conker/src/game/done/game_32FC0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15005B10(struct108 *arg0) { 8 | arg0->unk1E0 = 8; 9 | arg0->unk1B4 = 3; 10 | arg0->unk84 = arg0->unk84 & -5; 11 | func_15124B18(arg0); 12 | } 13 | -------------------------------------------------------------------------------- /conker/src/game/done/game_33000.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15005B50(s32 arg0) { 8 | } 9 | -------------------------------------------------------------------------------- /conker/src/game/done/game_33010.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15005B60(s32 arg0) { 8 | } 9 | -------------------------------------------------------------------------------- /conker/src/game/done/game_33020.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15005B70(s32 arg0) { 8 | s32 i; 9 | 10 | func_1509BFB0(0, 0x4014, 0); 11 | for (i = 0 ; i < 3; i++) 12 | { 13 | func_1509BFB0(0, i + 0x400C, 0); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /conker/src/game/done/game_33080.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15005BD0(struct108 *arg0) { 8 | arg0->unk2C = 8; 9 | arg0->unk84 |= 0x300000; 10 | arg0->unk84 &= -5; 11 | arg0->unk1B4 = 1; 12 | arg0->unk1E0 = 3; 13 | func_15124B18(arg0); 14 | arg0->unk134 = 0; 15 | } 16 | -------------------------------------------------------------------------------- /conker/src/game/done/game_330E0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15005C30(struct108 *arg0) { 8 | arg0->unk84 |= 0x100000; 9 | arg0->unk84 &= -5; 10 | arg0->unk1B4 = 2; 11 | arg0->unk1E0 = 5; 12 | func_15124B18(arg0); 13 | } 14 | -------------------------------------------------------------------------------- /conker/src/game/done/game_33130.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15005C80(struct108 *arg0) { 8 | arg0->unk2C = 8; 9 | arg0->unk84 |= 0x1300000; 10 | arg0->unk1B4 = 1; 11 | arg0->unk1E0 = 2; 12 | arg0->unk348 = 117.0f; 13 | arg0->unk34C = 117.0f; 14 | arg0->unk190 = 0.0f; 15 | arg0->unk18C = 0.0f; 16 | arg0->unk134 = 0; 17 | arg0->unk5F0 |= 0x10; 18 | arg0->unk23C = 1; 19 | arg0->unk374 = 370.0f; 20 | } 21 | 22 | void func_15005CF0(s32 arg0) { 23 | } 24 | -------------------------------------------------------------------------------- /conker/src/game/done/game_331B0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15005D00(struct108 *arg0) { 8 | arg0->unk2C = 8; 9 | arg0->unk84 |= 0x300000; 10 | arg0->unk84 &= -5; 11 | arg0->unk1B4 = 1; 12 | arg0->unk1E0 = 3; 13 | func_15124B18(arg0); 14 | arg0->unk134 = 0; 15 | } 16 | -------------------------------------------------------------------------------- /conker/src/game/done/game_33210.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15005D60(struct108 *arg0) { 8 | arg0->unk1B4 = 2; 9 | arg0->unk1E0 = 5; 10 | func_15124B18(arg0); 11 | arg0->unk134 = 0; 12 | arg0->unk84 |= 0x4000; 13 | } 14 | 15 | void func_15005DA0(s32 arg0) { 16 | } 17 | -------------------------------------------------------------------------------- /conker/src/game/done/game_33260.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15005DB0(struct108 *arg0) { 8 | func_15123934(arg0, 8, 0, arg0->unk134, 3); 9 | arg0->unk84 |= 0x1000000; 10 | arg0->unk84 &= -5; 11 | arg0->unk348 = 500.0f; 12 | arg0->unk34C = 500.0f; 13 | arg0->unk374 = 800.0f; 14 | arg0->unk73C = (u16)0; 15 | } 16 | -------------------------------------------------------------------------------- /conker/src/game/done/game_332E0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15005E30(struct108 *arg0) { 8 | if (D_800BE9F0 == 50) { 9 | arg0->unk1B4 = 2; 10 | arg0->unk1E0 = 4; 11 | func_15124B18(arg0); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /conker/src/game/done/game_33320.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15005E70(struct108 *arg0) { 8 | arg0->unk1B4 = 2; 9 | func_15124B18(arg0); 10 | arg0->unk23C = 1; 11 | } 12 | 13 | void func_15005EA0(struct108 *arg0) { 14 | arg0->unk1B4 = 1; 15 | arg0->unk1E0 = 15; 16 | func_15124B18(arg0); 17 | arg0->unk134 = 1; 18 | } 19 | -------------------------------------------------------------------------------- /conker/src/game/done/game_33390.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15005EE0(struct108 *arg0) { 8 | arg0->unk1B4 = (u16)2; 9 | arg0->unk1E0 = (u16)0xF; 10 | func_15124B18(arg0); 11 | arg0->unk134 = 1; 12 | } 13 | -------------------------------------------------------------------------------- /conker/src/game/done/game_333D0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15005F20(struct108 *arg0) { 8 | arg0->unk1B4 = 3; 9 | arg0->unk1E0 = 15; 10 | func_15124B18(arg0); 11 | arg0->unk134 = 1; 12 | } 13 | -------------------------------------------------------------------------------- /conker/src/game/done/game_33410.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15005F60(struct108 *arg0) { 8 | arg0->unk1B4 = (u16)2; 9 | func_15124B18(arg0); 10 | arg0->unk84 |= 0x4000; 11 | } 12 | -------------------------------------------------------------------------------- /conker/src/game/done/game_33450.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | void func_15005FA0(s32 arg0) { 5 | } 6 | -------------------------------------------------------------------------------- /conker/src/game/done/game_33460.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15005FB0(struct108 *arg0) { 8 | arg0->unk2C = 8; 9 | arg0->unk84 |= 0x300000; 10 | arg0->unk84 &= -5; 11 | arg0->unk1B4 = (u16)1; 12 | arg0->unk1E0 = (u16)3; 13 | func_15124B18(arg0); 14 | arg0->unk134 = 0; 15 | } 16 | -------------------------------------------------------------------------------- /conker/src/game/done/game_334C0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15006010(struct108 *arg0) { 8 | 9 | if (arg0->unk3D0->unk102) { 10 | if (func_15123934(arg0, 8, 0, 0, 0)) { 11 | arg0->unk84 |= 0x100000; 12 | arg0->unk84 &= -5; 13 | arg0->unk1B4 = 1; 14 | arg0->unk1E0 = 3; 15 | func_15124B18(arg0); 16 | } 17 | arg0->unk348 = 143.0f; 18 | arg0->unk34C = 143.0f; 19 | arg0->unk374 = 150.0f; 20 | arg0->unk190 = -38.0f; 21 | return; 22 | } 23 | if (arg0->unk23E == 0x3B) { 24 | if (func_15123934(arg0, 8, 0, 0, 0)) { 25 | arg0->unk84 |= 0x100000; 26 | arg0->unk84 &= -5; 27 | arg0->unk348 = 155.0f; 28 | arg0->unk34C = 155.0f; 29 | arg0->unk190 = 30.0f; 30 | arg0->unk18C = 30.0f; 31 | arg0->unk374 = 178.0f; 32 | return; 33 | } 34 | } else { 35 | func_151239CC(arg0, 0); 36 | } 37 | } 38 | 39 | void func_15006140(struct108 *arg0) { 40 | arg0->unk1E0 = 5; 41 | arg0->unk1B4 = 2; 42 | func_15124B18(arg0); 43 | } 44 | -------------------------------------------------------------------------------- /conker/src/game/done/game_33620.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15006170(struct108 *arg0) { 8 | arg0->unk1E0 = (u16)5; 9 | arg0->unk1B4 = (u16)2; 10 | func_15124B18(arg0); 11 | arg0->unk84 = (s32) (arg0->unk84 | 0x4000); 12 | } 13 | -------------------------------------------------------------------------------- /conker/src/game/done/game_34ED0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15007A20(void) { 8 | // zero out bss (?) 9 | bzero(&D_800B0DC0, (s32)&D_800E9D00 - (s32)&D_800B0DC0); 10 | // zero out (?) 11 | bzero(&D_80044B20, 0x3E000); // 253952 bytes 12 | } 13 | -------------------------------------------------------------------------------- /conker/src/game/done/game_35CF0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | void func_15008840(void) { 7 | bzero(&D_800D99D0, 32); // bzero 8 | } 9 | -------------------------------------------------------------------------------- /conker/src/game/done/game_35E80.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_150089D0(void) { 8 | u8 tmp = -1; 9 | D_800DD2A0 = tmp; 10 | if (0) {}; 11 | D_800DD2A1 = tmp; 12 | D_800DD2A2 = tmp; 13 | D_800DD2A3 = tmp; 14 | } 15 | -------------------------------------------------------------------------------- /conker/src/game/done/game_35EC0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15008A10(void) { 8 | D_80088720 = func_15083E90(1); 9 | D_80088724.x = 0.0f; 10 | D_80088724.y = 0.0f; 11 | D_80088724.z = 0.0f; 12 | D_80088730 = func_15083E90(1); 13 | } 14 | 15 | void func_15008A60(void) { 16 | if (0) {} 17 | 18 | D_800DDE08 = 0; 19 | 20 | // unrolled loop? 21 | D_800DDE40 = 0; 22 | D_800DDDAC = 0; 23 | D_800DDE28 = 0; 24 | D_800DDDB0 = 0; 25 | D_800DDE1C = 0; 26 | D_800DDE20 = 0; 27 | D_800DDDC8 = 0.0f; 28 | D_800DDDD8 = 0.0f; 29 | 30 | D_800DDE3C = 0; 31 | D_800DDDAD = 0; 32 | D_800DDE2C = 0; 33 | D_800DDDB4 = 0; 34 | D_800DDE1D = 0; 35 | D_800DDE21 = 0; 36 | D_800DDDCC = 0.0f; 37 | D_800DDDDC = 0.0f; 38 | 39 | D_800DDE3D = 0; 40 | D_800DDDAE = 0; 41 | D_800DDE30 = 0; 42 | D_800DDDB8 = 0; 43 | D_800DDE1E = 0; 44 | D_800DDE22 = 0; 45 | D_800DDDD0 = 0.0f; 46 | D_800DDDE0 = 0.0f; 47 | 48 | D_800DDE3E = 0; 49 | D_800DDDAF = 0; 50 | D_800DDE34 = 0; 51 | D_800DDDBC = 0; 52 | D_800DDE1F = 0; 53 | D_800DDE23 = 0; 54 | D_800DDDD4 = 0.0f; 55 | D_800DDDE4 = 0.0f; 56 | 57 | D_800DDE3F = 0; 58 | D_800DDE18 = 0; 59 | D_800DDE38 = 0; 60 | } 61 | -------------------------------------------------------------------------------- /conker/src/game/done/game_36040.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15008B90(void) { 8 | func_15008BB0(); 9 | } 10 | 11 | void func_15008BB0(void) { 12 | D_800D98E0 = func_1518AADC(12, 1000, 1); 13 | } 14 | 15 | void func_15008BE0(void) { 16 | } 17 | -------------------------------------------------------------------------------- /conker/src/game/done/game_36280.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15008DD0(void) { 8 | s32 i; 9 | 10 | for (i = 0; i < 2; i++) 11 | { 12 | D_800DD460[i] = 0; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /conker/src/game/done/game_36600.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15009150(s32 arg0) { 8 | struct162 *tmp; 9 | 10 | D_800DDD64 = 0; 11 | D_800DDD61 = 0; 12 | D_800DD2D0 = 0; 13 | if ((D_800DCDD0 != 0) && (D_8008CFFC[D_800B0DF0->unk10] != 0)) { 14 | tmp = func_1517E080(0, 0xFF); 15 | tmp->unk2E = 3; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /conker/src/game/done/game_39690.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | 6 | void func_1500C1E0(void) { 7 | s32 i; 8 | 9 | for (i = 0; i < 4; i++) { 10 | D_800DDF5C[i] = D_800DDF60[i] = 0; 11 | } 12 | for (i = 0; i < 11; i++) { 13 | D_800DDF68[i] = -2; 14 | } 15 | 16 | bzero(D_800DDE80, 220); // bzero 220 bytes 17 | 18 | for (i = 0; i < 11; i++) { 19 | D_800DDF78[i] = 0; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /conker/src/game/done/game_3BFD0.c: -------------------------------------------------------------------------------- 1 | void func_1500EB20(void) { 2 | } 3 | -------------------------------------------------------------------------------- /conker/src/game/done/game_3BFE0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_1500EB30(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { 8 | struct04 *temp_v0 = (struct04 *)func_151491F4((s16) ((func_150ADA20() & 0x7F) + 0xA), 1, -1, 1, 0, 0xA, 0xFF, 0); 9 | if (temp_v0 != 0) { 10 | temp_v0->unk28 = arg0; 11 | temp_v0->unk2A = arg1; 12 | temp_v0->unk2C = arg2; 13 | temp_v0->unk2E = arg3; 14 | temp_v0->unk30 = arg4; 15 | } 16 | } 17 | 18 | void func_1500EBC4(void) { 19 | func_1500EB30(386, 571, -1576, 422, 0); 20 | func_1500EB30(-23, 797, -2235, -145, 0); 21 | func_1500EB30(113, 745, -2246, -190, 0); 22 | func_1500EB30(388, 1124, -1741, 481, 0); 23 | func_1500EB30(388, 1124, -1560, 643, 0); 24 | func_1500EB30(388, 1124, -1104, 916, 0); 25 | func_1500EB30(1464, 1095, -2654, -492, 1); 26 | func_1500EB30(1448, 1095, -2431, 502, 0); 27 | func_1500EB30(1409, 1116, -1993, -379, 0); 28 | func_1500EB30(1403, 1120, -569, -404, 0); 29 | func_1500EB30(1540, 1371, -1265, -525, 0); 30 | func_1500EB30(892, 2181, -1759, 1736, 0); 31 | func_1500EB30(763, 2181, -1225, 1654, 0); 32 | func_1500EB30(1209, 2181, -899, 1376, 0); 33 | func_1500EB30(1719, 2181, -781, -565, 0); 34 | func_1500EB30(1162, 2181, -644, 1437, 0); 35 | func_1500EB30(1932, 2181, -1266, -623, 1); 36 | } 37 | -------------------------------------------------------------------------------- /conker/src/game/done/game_3C230.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_1500ED80(void) { 8 | func_15177410(1, 0xD8, -0xDAC, 0, 0x4BB, 0.0f, 15000, 30.0f, 0x4D, 0xF, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F); 9 | func_150124A0(); 10 | } 11 | 12 | void func_1500EE18(struct127 *arg0, s32 arg1, s32 arg2) { 13 | struct172 tmp; 14 | struct37 *temp_v0; 15 | 16 | tmp.unk0 = arg0; 17 | tmp.unk4 = arg0->unique_id; 18 | 19 | temp_v0 = func_15149130(0x12C, -1, 0x45, -1, 0, 0, 8, 0xFF, 1); 20 | if (temp_v0 != NULL) { 21 | memcpy(&temp_v0->unk28, &tmp, 8); // memcpy 22 | } 23 | } 24 | 25 | void func_1500EE94(struct16 *arg0) { 26 | struct173 tmp; 27 | struct37 *temp_v0; 28 | 29 | tmp.unk0 = arg0; 30 | tmp.unk4 = 0.0f; 31 | tmp.unk8 = arg0->unk14; 32 | temp_v0 = func_15149130(0x12C, -1, 0x46, -1, 0, 0x39, 0xC, 0xFF, 1); 33 | if (temp_v0 != NULL) { 34 | memcpy(&temp_v0->unk28, &tmp, 12); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /conker/src/game/done/game_3C3D0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_1500EF20(void) { 8 | struct102 *temp_v0; 9 | struct174 tmp; 10 | 11 | func_15195AA8(D_800B0E00[0], D_800902B8, 1, -1, 0, 0, 0, -8); 12 | func_15195AA8(D_800B0E00[1], D_800902B8, 1, -1, 0, 1, 0, -8); 13 | 14 | tmp.unk0 = D_80096220; 15 | tmp.unk4 = D_80096224; 16 | tmp.unkC = D_80096228; 17 | tmp.unk8 = 400.0f; 18 | temp_v0 = (struct102 *)func_151491F4((s16) ((func_150ADA20() % 0x33U) + 0x19), 5, -1, 1, 0, 0x10, 0xFF, 0); 19 | if (temp_v0 != NULL) { 20 | memcpy(&temp_v0->unk28, &tmp, 16); 21 | } 22 | 23 | tmp.unk0 = D_8009622C; 24 | tmp.unk4 = D_80096230; 25 | tmp.unkC = D_80096234; 26 | temp_v0 = (struct102 *)func_151491F4((s16) ((func_150ADA20() % 0x33U) + 0x19), 5, -1, 1, 0, 0x10, 0xFF, 0); 27 | if (temp_v0 != NULL) { 28 | memcpy(&temp_v0->unk28, &tmp, 16); 29 | } 30 | 31 | tmp.unk4 = D_80096238; 32 | temp_v0 = (struct102 *)func_151491F4((s16) ((func_150ADA20() % 0x33U) + 0x19), 5, -1, 1, 0, 0x10, 0xFF, 0); 33 | if (temp_v0 != NULL) { 34 | memcpy(&temp_v0->unk28, &tmp, 16); 35 | } 36 | 37 | tmp.unk0 = D_8009623C; 38 | tmp.unk4 = D_80096240; 39 | tmp.unkC = D_80096244; 40 | temp_v0 = (struct102 *)func_151491F4((s16) ((func_150ADA20() % 0x33U) + 0x19), 5, -1, 1, 0, 0x10, 0xFF, 0); 41 | if (temp_v0 != NULL) { 42 | memcpy(&temp_v0->unk28, &tmp, 16); 43 | } 44 | 45 | temp_v0 = (struct102 *)&D_800DCD20; 46 | D_800DCD94 = temp_v0->unk0; 47 | D_800DCD98 = temp_v0->unk1; 48 | D_800DCD9C = temp_v0->unk2; 49 | D_800DCDA0 = 0.0f; 50 | } 51 | -------------------------------------------------------------------------------- /conker/src/game/done/game_3C6C0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_1500F210(void) { 8 | func_15195AA8(D_800B0E00[0], D_800902B8, 1, -1, 0, 0, 0, -8); 9 | func_15195AA8(D_800B0E00[1], D_800902B8, 1, -1, 0, 1, 0, -8); 10 | } 11 | -------------------------------------------------------------------------------- /conker/src/game/done/game_3D6F0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15010240(void) { 8 | func_15195AA8(D_800B0E00[0], D_800902E4, 0, -1, 0, 0, 0, 4); 9 | func_15195AA8(D_800B0E00[1], D_800902E4, 0, -1, 0, 1, 0, 4); 10 | } 11 | -------------------------------------------------------------------------------- /conker/src/game/done/game_3D770.c: -------------------------------------------------------------------------------- 1 | void func_150102C0(void) { 2 | } 3 | -------------------------------------------------------------------------------- /conker/src/game/done/game_3D780.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_150102D0(void) { 8 | func_15195AA8(D_800B0E00[0], D_800902E8, 0, -1, 0, 0, 0, -6); 9 | func_15195AA8(D_800B0E00[1], D_800902E8, 0, -1, 0, 1, 0, -6); 10 | func_15195AA8(D_800B0E00[0], D_800902EC, 0, -1, 0, 0, 0, -3); 11 | func_15195AA8(D_800B0E00[1], D_800902EC, 0, -1, 0, 1, 0, -3); 12 | func_15149130(300, -1, 59, -1, 0, 0, 0, 255, 1); 13 | } 14 | 15 | void func_150103E0(void) { 16 | func_15177410(0, 255, -3477, -963, 684, 0.0f, 15000, 15.0f, -106, 30, 127, 127, 127, 127, 127, 127); 17 | func_15177410(4, 254, 2404, -992, 779, 0.0f, 2000, 15.0f, -106, 30, 127, 127, 127, 127, 127, 127); 18 | } 19 | -------------------------------------------------------------------------------- /conker/src/game/done/game_3DB30.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15010680(void) { 8 | D_800E0940 = func_150EA904; 9 | } 10 | -------------------------------------------------------------------------------- /conker/src/game/done/game_3DB50.c: -------------------------------------------------------------------------------- 1 | void func_150106A0(void) { 2 | } 3 | -------------------------------------------------------------------------------- /conker/src/game/done/game_3DB60.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_150106B0(void) { 8 | D_800E0930 = func_150EB430; 9 | } 10 | -------------------------------------------------------------------------------- /conker/src/game/done/game_3DB80.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | s32 func_150106D0(struct39 *arg0) { 8 | struct176 tmp; 9 | struct37 *temp_v0; 10 | 11 | tmp.unk0 = arg0; 12 | tmp.unk4 = func_15144598(arg0); 13 | tmp.unkC = 0.0f; 14 | 15 | func_1510F800(0); 16 | 17 | tmp.unk8 = func_1510FD20(arg0->unk0, arg0->unk4); 18 | if (tmp.unk8 == 0) { 19 | return 1; 20 | } else { 21 | temp_v0 = func_15149130(300, -1, 89, -1, 0, 0, 16, 255, 0); 22 | if (temp_v0 != NULL) { 23 | memcpy(&temp_v0->unk28, &tmp, 16); // memcpy 24 | } 25 | } 26 | return 1; 27 | } 28 | -------------------------------------------------------------------------------- /conker/src/game/done/game_3E460.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15010FB0(void) { 8 | D_800BE4F0 = allocate_memory(16, 1, 0, 0); 9 | D_800BE4F0->unk0 = func_15195AA8(D_800B0E00[1], D_80090310, 1, -1, 0, 1, 0, 0); 10 | D_800BE4F0->unk4 = func_15195AA8(D_800B0E00[0], D_80090314, 0, -1, 0, 0, 0, 0); 11 | D_800BE4F0->unk8 = func_15195FB0(func_151149AC(250), D_80090310, 1, -1, 0, 0, 0); 12 | D_800BE4F0->unkC = func_15195FB0(func_151149AC(249), D_80090310, 1, -1, 0, 0, 0); 13 | func_1510F800(0); 14 | D_800D9A40 = func_1510FD20(0x1500, 0x700); 15 | } 16 | -------------------------------------------------------------------------------- /conker/src/game/done/game_3E5A0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_150110F0(void) { 8 | func_15195AA8(D_800B0E00[0], D_80090318, 0, -1, 0, 0, 0, 8); 9 | func_15195AA8(D_800B0E00[0], D_8009031C, 0, -1, 0, 0, 8, 0); 10 | } 11 | -------------------------------------------------------------------------------- /conker/src/game/done/game_3E620.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15011170(void) { 8 | D_80088B40 = 0; 9 | func_150F4D5C(D_800DBFF0, 0, 0, 0xFF, 1); 10 | func_1000FA64(108, -3580, -546, -6129, 18000, 1111, 1100, func_1000EB00, 0, 0, 8, 0); 11 | func_1000FA64(108, -2929, -1121, -2158, 18000, 1590, 1580, func_1000EB00, 0, 0, 8, 0); 12 | func_1000FA64(108, 497, -1071, -2105, 18000, 2040, 2030, func_1000EB00, 0, 0, 8, 0); 13 | func_1000FA64(1567, 26, 0, 0, 12000, 2500, 1800, func_1000EF40, 0, 0, 72, 0); 14 | func_1000FA64(1567, 27, 0, 0, 8000, 2000, 1000, func_1000EF40, 0, 0, 72, 0); 15 | } 16 | -------------------------------------------------------------------------------- /conker/src/game/done/game_3E7E0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15011330(void) { 8 | func_150E8854(); 9 | D_80041FD8 = (u8)0x10; 10 | } 11 | -------------------------------------------------------------------------------- /conker/src/game/done/game_3E810.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15011360(void) { 8 | func_15008E00(); 9 | func_15008E10(2); 10 | func_15008E10(3); 11 | if ((D_800D2E4C->unk14 & 1) != 0) { 12 | D_800B0DF0->unk5 = (u8)0x30; 13 | D_800B0DF0->unk6 = (u8)0x38; 14 | D_800B0DF0->unk7 = (u8)0x5F; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /conker/src/game/done/game_3EFB0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15011B00(s32 arg0, s32 arg1, s32 arg2, s32 arg3) { 8 | struct04 *temp_v0 = func_151491F4((s16) ((func_150ADA20() & 0x7F) + 10), 1, -1, 1, 0, 10, 255, 0); 9 | if (temp_v0 != NULL) { 10 | temp_v0->unk28 = arg0; 11 | temp_v0->unk2A = arg1; 12 | temp_v0->unk2C = arg2; 13 | temp_v0->unk2E = arg3; 14 | temp_v0->unk30 = 1; 15 | } 16 | } 17 | 18 | void func_15011B94(void) { 19 | func_15011B00(1257, 338, -2988, -367); 20 | func_15011B00(1901, 338, -2753, -367); 21 | func_1515F170(1, 0); 22 | func_1515F170(2, 1); 23 | func_1000FA64(77, 765, 55, -89, 12000, 600, 300, func_1000EF40, 0, 0, 8, 0); 24 | } 25 | -------------------------------------------------------------------------------- /conker/src/game/done/game_3F0F0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15011C40(void) { 8 | bzero(&D_800BE500, 5); // bzero 9 | } 10 | -------------------------------------------------------------------------------- /conker/src/game/done/game_3F120.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15011C70(void) { 8 | D_800D9AA0[0] = 0; 9 | D_800D9AA0[1] = 0; 10 | D_800D9AA0[2] = 0; 11 | func_15103800(); 12 | } 13 | 14 | void func_15011CA0(void) { 15 | func_15103800(); 16 | } 17 | 18 | void func_15011CC0(void) { 19 | func_15195AA8(D_800B0E00[0], D_800902E4, 0, -1, 0, 0, 0, 4); 20 | func_15195AA8(D_800B0E00[1], D_800902E4, 0, -1, 0, 1, 0, 4); 21 | } 22 | -------------------------------------------------------------------------------- /conker/src/game/done/game_3F3D0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15011F20(s32 arg0) { 8 | struct17 tmp; 9 | struct37 *temp_v0; 10 | 11 | tmp.unk0 = 50.0f; 12 | tmp.unk4 = 50.0f; 13 | tmp.unk8 = 0.0f; 14 | temp_v0 = func_15149130(300, -1, 71, -1, 0, 0, 12, 255, 1); 15 | if (temp_v0 != NULL) { 16 | memcpy(&temp_v0->unk28, &tmp, 12); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /conker/src/game/done/game_3F450.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15011FA0(s32 arg0) { 8 | struct17 tmp; 9 | struct37 *temp_v0; 10 | 11 | tmp.unk0 = 50.0f; 12 | tmp.unk4 = 50.0f; 13 | tmp.unk8 = 0.0f; 14 | temp_v0 = (struct37*) func_15149130(300, -1, 0x48, -1, 0, 0, 12, 255, 1); 15 | if (temp_v0 != NULL) { 16 | memcpy(&temp_v0->unk28, &tmp, 12); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /conker/src/game/done/game_3F4D0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15012020(s32 arg0, s32 arg1) { 8 | struct183 tmp; 9 | 10 | tmp.unk0 = 7; 11 | tmp.unk4 = arg0; 12 | tmp.unk8 = D_80096530; 13 | tmp.unkC = D_80096534; 14 | tmp.unk10 = 0.0f; 15 | tmp.unk14 = 0.0f; 16 | tmp.unk18 = 0.0f; 17 | tmp.unk1C = 0.0f; 18 | tmp.unk20 = 0.0f; 19 | tmp.unk24 = 0; 20 | tmp.unk25 = -1; 21 | tmp.unk26 = 3; 22 | 23 | func_151A8B20(&tmp, -1, 0, 0xFF, 0); 24 | } 25 | -------------------------------------------------------------------------------- /conker/src/game/done/game_3F560.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_150120B0(s32 arg0) { 8 | struct37 *temp_v0; 9 | struct184 tmp; 10 | 11 | tmp.unk0 = 50.0f; 12 | tmp.unk4 = 50.0f; 13 | tmp.unk8 = 50.0f; 14 | tmp.unkC = 50.0f; 15 | tmp.unk10 = 50.0f; 16 | tmp.unk14 = 50.0f; 17 | tmp.unk18 = 0.0f; 18 | tmp.unk1C = D_80096540; 19 | 20 | temp_v0 = func_15149130(300, -1, 30, -1, 0, 65, 32, 255, 1); 21 | if (temp_v0 != NULL) { 22 | memcpy(&temp_v0->unk28, &tmp, 32); 23 | } 24 | } 25 | 26 | void func_1501214C(struct127 *arg0) { 27 | struct185 tmp; 28 | 29 | if (D_800BE9F0 != 24) { 30 | tmp.unk0 = arg0; 31 | tmp.unk4 = arg0->unique_id; 32 | tmp.unk6 = 300; 33 | tmp.unk8 = 0; 34 | tmp.unk9 = 0; 35 | tmp.unkA = 2; 36 | func_15190770(&tmp, 0, 255, 1); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /conker/src/game/done/game_3FBD0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | u8 func_15012720(void) { 8 | switch(D_800BE9F0) 9 | { 10 | case 0: 11 | case 44: 12 | case 55: 13 | return 2; 14 | case 40: 15 | return 6; 16 | default: 17 | return 5; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /conker/src/game/done/game_3FC20.c: -------------------------------------------------------------------------------- 1 | void func_15012770(void) { 2 | } 3 | -------------------------------------------------------------------------------- /conker/src/game/done/game_3FC30.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15012780(void) { 8 | s32 i; 9 | 10 | D_800DD418 = 0; 11 | for (i = 0; i < 2; i++) 12 | { 13 | D_800DD410[i] = 0; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /conker/src/game/done/game_43760.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | 6 | void func_150162B0(void) { 7 | 8 | bzero(&D_800CC2D0, 20300); 9 | D_80086000 = 0; 10 | 11 | if (D_800D2138 == 2) { 12 | D_800CC26E = 2; 13 | } else if (D_800D2138 == 3) { 14 | D_800CC26E = 3; 15 | } else if (D_800D2138 == 4) { 16 | D_800CC26E = 4; 17 | } else { 18 | D_800CC26E = 0; 19 | } 20 | D_800CC2B0 = 0; 21 | bzero(&D_800CC298, 24); 22 | D_800CC2A2 = 1; 23 | D_800D18D0 = 0; 24 | } 25 | -------------------------------------------------------------------------------- /conker/src/game/done/game_43820.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15016370(void) { 8 | struct127 *tmp; 9 | s32 i; 10 | 11 | for (i = 0; i < D_8008FD8C; i++) { 12 | tmp = &D_800CC2D0[i]; 13 | tmp->unk31C->unk114 = 180; 14 | tmp->unk31C->unk116 = 60; 15 | tmp->unk31C->unk118 = 60; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /conker/src/game/done/game_43B20.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15016670(void) { 8 | D_800D18C0 = 0; 9 | } 10 | 11 | void func_15016680(void) { 12 | D_800D212C = 0; 13 | } 14 | 15 | void func_15016690(s32 arg0) { 16 | s32 tmp; 17 | 18 | D_800D2120 = -1; 19 | D_800D2124 = -1; 20 | tmp = func_1502B7F0(&D_800D212C, 3, 12, arg0, 6) / 24U; 21 | D_800D2128 = tmp; 22 | if (tmp == 0) { 23 | D_800D212C = allocate_memory(24, 1, 0, 0); 24 | D_800D2128 = 1U; 25 | if (D_800D20FC) { 26 | D_800D212C->unk0 = D_800D20FC->unk6; 27 | D_800D212C->unk2 = D_800D20FC->unk8; 28 | D_800D212C->unk4 = D_800D20FC->unkA; 29 | D_800D212C->unk8 = D_800D20FC->unk6 + 100; 30 | D_800D212C->unkC = D_800D20FC->unk8 + 100; 31 | D_800D212C->unk10 = D_800D20FC->unkA; 32 | D_800D212C->unk6 = 0; 33 | D_800D212C->unk7 = D_800D20FC->unkC; 34 | D_800D212C->unk15 = 0; 35 | } else { 36 | D_800D212C->unk0 = 0xE10; 37 | D_800D212C->unk2 = -0xC80; 38 | D_800D212C->unk4 = -0x898; 39 | D_800D212C->unk10 = 1000.0f; 40 | D_800D212C->unk8 = D_800D212C->unkC = D_800D212C->unk10; 41 | D_800D212C->unk6 = 0; 42 | D_800D212C->unk7 = 0; 43 | D_800D212C->unk15 = 0; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /conker/src/game/done/game_49D10.c: -------------------------------------------------------------------------------- 1 | void func_1501C860(void) { 2 | } 3 | -------------------------------------------------------------------------------- /conker/src/game/done/game_49D20.c: -------------------------------------------------------------------------------- 1 | void func_1501C870(void) { 2 | } 3 | -------------------------------------------------------------------------------- /conker/src/game/done/game_75810.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | 4 | #define PI 3.1415927410125732f 5 | 6 | f32 func_15048360(f32 arg0) { 7 | s16 phi_a0; 8 | 9 | if (arg0 >= 1.0f) { 10 | phi_a0 = 0x7FFF; 11 | } else if (arg0 <= -1.0f) { 12 | phi_a0 = -0x7FFF; 13 | } else { 14 | phi_a0 = arg0 * 32767.0f; 15 | } 16 | return func_15048664(phi_a0) * (PI / 65535); 17 | } 18 | 19 | f32 func_15048408(f32 arg0) { 20 | s16 phi_a0; 21 | 22 | if (arg0 >= 1.0f) { 23 | phi_a0 = 0x7FFF; 24 | } else if (arg0 <= -1.0f) { 25 | phi_a0 = -0x7FFF; 26 | } else { 27 | phi_a0 = arg0 * 32767.0f; 28 | } 29 | return func_150486B8(phi_a0) * (PI / 65535); 30 | } 31 | -------------------------------------------------------------------------------- /conker/src/game/done/game_75950.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | 4 | // undo intrinsic 5 | #pragma function sqrtf 6 | 7 | #define PI 3.1415927410125732f 8 | 9 | f32 func_150484A0(f32 arg0, f32 arg1) { 10 | f32 ret; 11 | 12 | if (arg0 == 0.0f) { 13 | if (arg1 >= 0.0f) { 14 | ret = 0.0f; 15 | } else { 16 | ret = PI; 17 | } 18 | } else if (arg1 == 0.0f) { 19 | if (arg0 > 0.0f) { 20 | ret = PI/2; 21 | } else { 22 | ret = 3*PI/2; 23 | } 24 | } else { 25 | ret = sqrtf((arg0 * arg0) + (arg1 * arg1)); 26 | if (arg1 < arg0) { 27 | ret = func_15048360(arg1 / ret); 28 | if (arg0 < 0.0f) { 29 | ret = 2*PI - ret; 30 | } 31 | } else { 32 | ret = PI/2 - func_15048360(arg0 / ret); 33 | if (arg1 < 0.0f) { 34 | ret = PI - ret; 35 | } 36 | if (ret < 0.0f) { 37 | ret += 2*PI; 38 | } 39 | } 40 | } 41 | return ret; 42 | } 43 | -------------------------------------------------------------------------------- /conker/src/game/done/game_75BD0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | f32 func_15048720(f32 arg0, f32 arg1, f32 arg2) { 8 | f32 res = func_15048A70(arg1, arg2) * arg0; 9 | return arg1 + res; 10 | } 11 | 12 | void func_15048758(f32 *arg0) { 13 | while (*arg0 < 0.0f) { 14 | *arg0 = (f32) (*arg0 + 360.0f); 15 | } 16 | while (*arg0 >= 360.0f) { 17 | *arg0 = (f32) (*arg0 - 360.0f); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /conker/src/game/done/game_768F0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | s32 func_15049440(f32 arg0[4][4], f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9) { 8 | f32 ret; 9 | f32 tmp; 10 | 11 | ret = -(arg0[0][2] * arg1 + arg0[1][2] * arg2 + arg0[2][2] * arg3 + arg0[3][2]); 12 | if (ret < arg6) { 13 | return 0; 14 | } 15 | if (arg7 < ret) { 16 | return 0; 17 | } 18 | tmp = arg0[0][0] * arg1 + arg0[1][0] * arg2 + arg0[2][0] * arg3 + arg0[3][0]; 19 | if (arg8 < (tmp - arg4)) { 20 | return 0; 21 | } 22 | if ((tmp + arg4) < -arg8) { 23 | return 0; 24 | } 25 | tmp = arg0[0][1] * arg1 + arg0[1][1] * arg2 + arg0[2][1] * arg3 + arg0[3][1]; 26 | if (arg9 < (tmp - arg5)) { 27 | return 0; 28 | } 29 | if ((tmp + arg5) < -arg9) { 30 | return 0; 31 | } 32 | return ret; 33 | } 34 | -------------------------------------------------------------------------------- /conker/src/game/done/game_77A90.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | f32 tanf(f32 arg0) { 8 | return sinf(arg0) / cosf(arg0); 9 | } 10 | -------------------------------------------------------------------------------- /conker/src/game/done/game_F20A0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_150C4BF0(struct108 *arg0) { 8 | if (func_1509BE40(1, 0x403F, 6, 0x2000)) { 9 | arg0->unk84 |= 0x1000000; 10 | } else { 11 | arg0->unk84 &= 0xFEFFFFFF; 12 | } 13 | if (func_1509BE40(1, 0x4019, 6, 0x2000)) { 14 | func_1509BFB0(1, 0x9000, 0x10, 0xA0); 15 | return; 16 | } 17 | if (func_1509BE40(1, 0x4044, 6, 0x2000)) { 18 | func_1509BFB0(1, 0x9000, 0x10, 0); 19 | return; 20 | } 21 | if (func_1509BE40(4, 0x2000, 0xAC, 0x401B, 0x401C, 0x401D, 0x401E)) { 22 | func_1509BFB0(1, 0x9000, 0x10, -0x96); 23 | return; 24 | } 25 | func_1509BFB0(1, 0x9000, 0x10, 0); 26 | } 27 | -------------------------------------------------------------------------------- /conker/src/game/done/game_FC3C0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_150CEF10(struct108 *arg0) { 8 | arg0->unk84 |= 0x10; 9 | if (arg0->unk1B4 == 3) { 10 | arg0->unk1E0 = 5; 11 | arg0->unk1B4 = 2; 12 | func_15124B18(arg0); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /conker/src/game/entrypoint.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | u32 jtbl_80095A30[8] = { 8 | 0x1500798C, // first case 9 | 0x15007994, 10 | 0x150079C0, 11 | 0x150079CC, 12 | 0x1500798C, 13 | 0, 14 | 0, 15 | 0 16 | }; 17 | 18 | // game entrypoint 19 | #pragma GLOBAL_ASM("asm/nonmatchings/game/entrypoint/func_15007830.s") 20 | // NON-MATCHING: need to better understand jump tables 21 | // void func_15007830(void) { 22 | // func_15007A20(); 23 | // D_800D2C28 = 0; 24 | // osCreateMesgQueue(&D_800BEA10, &D_800BEA28, 16); 25 | // D_800BEA68->unk0 = 2; 26 | // D_800BEA68->unk20 = 2; 27 | // D_800BE617 = 0; 28 | // func_100050A0(&D_800BEA10); 29 | // func_15003570(); 30 | // D_800BEAAB = 0; 31 | // func_10008180(); 32 | // func_15000000(); 33 | // func_15016588(); 34 | // func_151EEFF0(); 35 | // D_800BEAA8 = 0; 36 | // func_150061B0(); 37 | // func_15006234(); 38 | // func_151DD970(); 39 | // func_15015920(0); 40 | // func_15008A60(); 41 | // func_15042D50(); 42 | // D_800BEA04[0] = 0; 43 | // D_800BEA00[0] = 1; 44 | // D_800BE615 = 5; 45 | // D_800BEAAA = 1; 46 | // func_1509C120(); 47 | // do { 48 | // switch(D_800BE615) { 49 | // case 0: 50 | // case 4: 51 | // func_151E50C8(); 52 | // case 1: 53 | // func_15017498(); 54 | // if (2 == D_800E0B94) { 55 | // func_150ADACC(0x81280783); 56 | // } 57 | // func_15007A70(D_800BEA04[1], D_800BEA00[1], D_800BE9F4[1]); 58 | // case 2: 59 | // func_15007B3C(); 60 | // D_800BE615 = 0U; 61 | // case 3: 62 | // func_100051E8(); 63 | // D_800BE9E8 = 0; 64 | // func_150186D0(); 65 | // } 66 | // } while (1); 67 | // } 68 | -------------------------------------------------------------------------------- /conker/src/game_123FB0.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | 6 | #pragma GLOBAL_ASM("asm/nonmatchings/game_123FB0/func_150F6B00.s") 7 | // NON-MATCHING: 90% there 8 | // void func_150F6B00(struct108 *arg0) { 9 | // struct190 tmp; 10 | // 11 | // f32 phi_f2; 12 | // f32 temp_f2; 13 | // f32 phi_f0_2; 14 | // 15 | // // func_1509BE40 has variable number of args 16 | // if ((func_1509BE40(1, 16387, 6, 8192) != 0) && (arg0->unk3D0->unk1CA != 0)) { 17 | // arg0->unk84 |= 0xC0001000; 18 | // func_15048F90(&D_800A1B80, &arg0->unk2A4, &tmp.unk14); 19 | // func_15048F90(&D_800A1B80, &D_800A1B8C, &tmp.unk8); 20 | // tmp.unk0 = 1.0f / func_150AD930(&tmp.unk8); 21 | // func_1504917C(&tmp.unk8, &tmp.unk20); 22 | // temp_f2 = func_150AD900(&tmp.unk20, &tmp.unk14) * tmp.unk0 * 0.75f; 23 | // if (temp_f2 < 0.0f) { 24 | // phi_f2 = 0.0f; 25 | // } else { 26 | // if (temp_f2 > 1.0f) { 27 | // phi_f0_2 = 1.0f; 28 | // } else { 29 | // phi_f0_2 = temp_f2; 30 | // } 31 | // phi_f2 = phi_f0_2; 32 | // } 33 | // tmp.unk4 = phi_f2; 34 | // if (func_1509BE40(4, 8192, 172, 16448, 16449, 16450, 16451) != 0) { 35 | // phi_f0_2 = (0.0f * tmp.unk4) + -900.0f; 36 | // arg0->unk374 = 220.0f; 37 | // } else { 38 | // if (func_1509BE40(4, 8192, 172, 16455, 16454, 16453, 16452) != 0) { 39 | // phi_f0_2 = (0.0f * tmp.unk4) + 900.0f; 40 | // arg0->unk374 = 220.0f; 41 | // } else { 42 | // phi_f0_2 = 0.0f * tmp.unk4; 43 | // arg0->unk374 = 294.0f; 44 | // } 45 | // } 46 | // // takes a variable number of args 47 | // func_1509BFB0(3, 16387, 3, phi_f0_2, -20.0f, ((s32)(D_800A1B98 * phi_f2) + D_800A1B9C)); 48 | // func_15049688(&arg0->unk37C, func_15048FC8(&D_800D9A50) - 180.0f, &arg0->unk7C8, 8.0f, 10.0f, arg0->unk7B4); 49 | // arg0->unk39C = arg0->unk37C * D_800A1BA0; 50 | // } else { 51 | // arg0->unk84 = arg0->unk84 & 0x3FFFEFFF; 52 | // } 53 | // } 54 | -------------------------------------------------------------------------------- /conker/src/game_130CB0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15103800(void) { 8 | bzero(D_800D9AB0, 8); // bzero 9 | } 10 | 11 | void func_15103828(void) { 12 | u16 temp_v1; 13 | s32 i; 14 | 15 | for (i = 0; i < 4; i++) 16 | { 17 | if (D_800D9AB0[i]) { 18 | if (D_800D9AB0[i] > D_800BE9E4) 19 | { 20 | D_800D9AB0[i] -= D_800BE9E4; 21 | } else { 22 | D_800D9AB0[i] = 0; 23 | } 24 | } 25 | } 26 | } 27 | 28 | // need to figure out the structs 29 | #pragma GLOBAL_ASM("asm/nonmatchings/game_130CB0/func_15103910.s") 30 | #pragma GLOBAL_ASM("asm/nonmatchings/game_130CB0/func_15103AA0.s") 31 | #pragma GLOBAL_ASM("asm/nonmatchings/game_130CB0/func_15103C14.s") 32 | -------------------------------------------------------------------------------- /conker/src/game_15B200.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | 6 | #pragma GLOBAL_ASM("asm/nonmatchings/game_15B200/func_1512DD50.s") 7 | // void func_1512DD50(struct108 *arg0) { 8 | // s32 pad; 9 | // struct17 tmp; 10 | // 11 | // f32 temp_f0; 12 | // f32 temp_f0_2; 13 | // f32 temp_f12; 14 | // f32 temp_f14; 15 | // f32 temp_f2; 16 | // 17 | // struct127 *temp_v0; 18 | // struct164 *temp_v1; 19 | // 20 | // temp_f2 = arg0->unk712; 21 | // temp_f0 = arg0->unk720 * temp_f2; 22 | // temp_f12 = arg0->unk724 * temp_f2; 23 | // temp_f0_2 = arg0->unk728 * temp_f0; 24 | // temp_f14 = -temp_f0 * arg0->unk72C; 25 | // 26 | // arg0->unk874 = arg0->unk70C - temp_f0_2; 27 | // arg0->unk878 = arg0->unk70E - temp_f12; 28 | // arg0->unk87C = arg0->unk710 - temp_f14; 29 | // 30 | // tmp.unk0 = 2.0f * temp_f0_2; 31 | // tmp.unk4 = 2.0f * temp_f12; 32 | // tmp.unk8 = 2.0f * temp_f14; 33 | // 34 | // temp_f2 = 1.0f / func_150AD930(&tmp); 35 | // temp_v0 = arg0->unk870; 36 | // temp_v0->unk1C = temp_f2; 37 | // temp_v0->unk10 = temp_f2 * tmp.unk0; 38 | // temp_v0->unk14 = temp_f2 * tmp.unk4; 39 | // temp_v0->unk18 = temp_f2 * tmp.unk8; 40 | // temp_v1 = arg0->unk6FC; 41 | // temp_v0->unk20 = temp_v1->unk20; 42 | // temp_v0->unk24 = temp_v1->unk8; 43 | // temp_v0->unk28 = 0.0f; 44 | // temp_v0->unk2C = 0.0f; 45 | // temp_v0->unk0 = (s8) temp_v1->unk1C; 46 | // } 47 | 48 | #pragma GLOBAL_ASM("asm/nonmatchings/game_15B200/func_1512DEA4.s") 49 | -------------------------------------------------------------------------------- /conker/src/game_168A90.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | #pragma GLOBAL_ASM("asm/nonmatchings/game_168A90/func_1513B5E0.s") 8 | #pragma GLOBAL_ASM("asm/nonmatchings/game_168A90/func_1513B798.s") 9 | #pragma GLOBAL_ASM("asm/nonmatchings/game_168A90/func_1513B83C.s") 10 | 11 | s32 func_1513B968(s32 arg0, s32 arg1) { 12 | // FIXME: &arg0->unk_120[D_800BE9C0] 13 | func_150A7B80(arg0 + 120 + (D_800BE9C0 << 6)); 14 | return 1; 15 | } 16 | 17 | void func_1513B9A8(struct132 *arg0) { 18 | func_100043B4(arg0->unk4C, 4); 19 | func_15169804(arg0); 20 | } 21 | 22 | void func_1513B9DC(struct132 *arg0) { 23 | func_100043B4(arg0->unk4C, 4); 24 | func_15169824(arg0); 25 | } 26 | 27 | void func_1513BA10(struct132 *arg0) { 28 | D_80089C44[arg0->unk48](); 29 | } 30 | 31 | void func_1513BA44(struct132 *arg0) { 32 | D_80089C54[arg0->unk48](); 33 | } 34 | 35 | #pragma GLOBAL_ASM("asm/nonmatchings/game_168A90/func_1513BA78.s") 36 | 37 | s32 func_1513BAD4(s32 arg0, s32 arg1) { 38 | return 0; 39 | } 40 | 41 | #pragma GLOBAL_ASM("asm/nonmatchings/game_168A90/func_1513BAE8.s") 42 | #pragma GLOBAL_ASM("asm/nonmatchings/game_168A90/func_1513BBFC.s") 43 | #pragma GLOBAL_ASM("asm/nonmatchings/game_168A90/func_1513BEB0.s") 44 | -------------------------------------------------------------------------------- /conker/src/game_1BFC70.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | 6 | #pragma GLOBAL_ASM("asm/nonmatchings/game_1BFC70/func_151927C0.s") 7 | // JUSTREG: using t2 not t3 8 | // void func_151927C0(struct114 *arg0) { 9 | // s32 tmp0; 10 | // tmp0 = (s16)((arg0->unk14 & 0xFF) >> 1); 11 | // arg0->unk38 = 300; 12 | // arg0->unk3A = 10; 13 | // arg0->unk14 = tmp0 * 65537; 14 | // arg0->unk3B = 0; 15 | // } 16 | -------------------------------------------------------------------------------- /conker/src/game_21D5F0.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | 6 | // handwritten? 7 | #pragma GLOBAL_ASM("asm/nonmatchings/game_21D5F0/guMtxXFMF.s") 8 | // void func_151F0140(f32 arg0[4][4], f32 arg1, f32 arg2, f32 arg3, f32 *arg4, f32 *arg5, f32 *arg6) { 9 | // *arg4 = arg0[0][0] * arg1 + arg0[1][0] * arg2 + arg0[2][0] * arg3 + arg0[3][0]; 10 | // *arg5 = arg0[0][1] * arg1 + arg0[1][1] * arg2 + arg0[2][1] * arg3 + arg0[3][1]; 11 | // *arg6 = arg0[0][2] * arg1 + arg0[1][2] * arg2 + arg0[2][2] * arg3 + arg0[3][2]; 12 | // } 13 | 14 | #pragma GLOBAL_ASM("asm/nonmatchings/game_21D5F0/guMtxCatF.s") 15 | -------------------------------------------------------------------------------- /conker/src/game_221290.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | 8 | #pragma GLOBAL_ASM("asm/nonmatchings/game_221290/func_151F3DE0.s") 9 | #pragma GLOBAL_ASM("asm/nonmatchings/game_221290/func_151F42E8.s") 10 | #pragma GLOBAL_ASM("asm/nonmatchings/game_221290/func_151F4F38.s") 11 | #pragma GLOBAL_ASM("asm/nonmatchings/game_221290/func_151F578C.s") 12 | #pragma GLOBAL_ASM("asm/nonmatchings/game_221290/func_151F63C4.s") 13 | #pragma GLOBAL_ASM("asm/nonmatchings/game_221290/func_151F6970.s") 14 | #pragma GLOBAL_ASM("asm/nonmatchings/game_221290/func_151F6B28.s") 15 | #pragma GLOBAL_ASM("asm/nonmatchings/game_221290/func_151F6FD0.s") 16 | #pragma GLOBAL_ASM("asm/nonmatchings/game_221290/func_151F78B4.s") 17 | #pragma GLOBAL_ASM("asm/nonmatchings/game_221290/func_151F7F60.s") 18 | #pragma GLOBAL_ASM("asm/nonmatchings/game_221290/func_151F8088.s") 19 | #pragma GLOBAL_ASM("asm/nonmatchings/game_221290/func_151F85C4.s") 20 | // void *func_151F85C4(s32 arg0, s32 arg1, s32 arg2) { 21 | // void *sp1C; 22 | // 23 | // sp1C = (void *)0x800E1880; 24 | // if (sp1C == 0) { 25 | // return NULL; 26 | // } 27 | // sp1C->unkC = -1; 28 | // sp1C->unk10 = -1; 29 | // sp1C->unk14 = -1; 30 | // sp1C->unk0 = arg0; 31 | // sp1C->unk4 = arg1; 32 | // sp1C->unk8 = arg2; 33 | // sp1C->unk201C = 0; 34 | // sp1C->unk2020 = 0; 35 | // sp1C->unk3BA0 = 0; 36 | // if (func_151F8088(sp1C, 0) == 0) { 37 | // return NULL; 38 | // } 39 | // sp1C->unk8474 = 0; 40 | // bzero(sp1C + 0x6A64, 0x900); 41 | // return sp1C; 42 | // } 43 | 44 | #pragma GLOBAL_ASM("asm/nonmatchings/game_221290/func_151F86B0.s") 45 | -------------------------------------------------------------------------------- /conker/src/game_2DDF0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | // loops... 7 | #pragma GLOBAL_ASM("asm/nonmatchings/game_2DDF0/func_15000940.s") 8 | -------------------------------------------------------------------------------- /conker/src/game_30E90.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | #pragma GLOBAL_ASM("asm/nonmatchings/game_30E90/func_150039E0.s") 8 | 9 | // FIXME: matches but something isnt right 10 | void func_15004574(void) { 11 | if (D_800DBF88 != 0xFF) { 12 | D_800DBF8C = D_800DBEF4[D_800DBF88].unk1C; 13 | D_800DBF90 = D_800DBEF4[D_800DBF88].unk28; 14 | } 15 | } 16 | 17 | void func_150045BC(void) { 18 | } 19 | 20 | #pragma GLOBAL_ASM("asm/nonmatchings/game_30E90/func_150045C4.s") 21 | #pragma GLOBAL_ASM("asm/nonmatchings/game_30E90/func_150049A4.s") 22 | #pragma GLOBAL_ASM("asm/nonmatchings/game_30E90/func_15004A4C.s") 23 | // NON-MATCHING: not this... 24 | // void func_15004A4C(void) { 25 | // u32 i; 26 | // for (i = 0; i < D_800DBEF0; i++) { 27 | // D_800DBEFC[i] = D_800DBEF8[i] = 0; 28 | // // D_800DBEFC[i] = 0; 29 | // } 30 | // } 31 | 32 | #pragma GLOBAL_ASM("asm/nonmatchings/game_30E90/func_15004AAC.s") 33 | #pragma GLOBAL_ASM("asm/nonmatchings/game_30E90/func_15004BF0.s") 34 | #pragma GLOBAL_ASM("asm/nonmatchings/game_30E90/func_15004CE0.s") 35 | -------------------------------------------------------------------------------- /conker/src/game_32200.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15004D50(void) { 8 | s32 i; //s0 9 | struct222** s1; 10 | 11 | D_800C3FC0 = (struct222*) &D_80084300; 12 | for( i = 1; i <= D_80082FA0; i++){ 13 | (&D_800C3FC0)[i] = (struct222 *) allocate_memory(0x50, 1, 2, 0); //allocate_memory 14 | bcopy(D_800C3FC0, (&D_800C3FC0)[i], 0x50); //bcopy 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /conker/src/game_32490.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | #pragma GLOBAL_ASM("asm/nonmatchings/game_32490/func_15004FE0.s") 8 | // NON-MATCHING: miles away 9 | // s32 func_15004FE0(s32 arg0) { 10 | // struct161 **sp34; 11 | // u32 temp_lo; 12 | // s32 i; 13 | // 14 | // sp34 = 0; 15 | // temp_lo = func_1502B7F0(&sp34, 3, 12, arg0, 3) / 24U; 16 | // D_800C6654 = temp_lo; 17 | // allocate_memory(temp_lo * 20, 1, 1, 0); 18 | // 19 | // for(i = 0; i < D_800C6654; i++) { 20 | // D_800C6650[i].unk0 = sp34[i]->unk0; 21 | // D_800C6650[i].unk2 = sp34[i]->unk4; 22 | // D_800C6650[i].unk4 = sp34[i]->unk8; 23 | // D_800C6650[i].unk6 = 0; 24 | // D_800C6650[i].unk8 = sp34[i]->unkC * sp34[i]->unkC; 25 | // D_800C6650[i].unkC = sp34[i]->unk10; 26 | // D_800C6650[i].unkE = sp34[i]->unkC + sp34[i]->unk0; 27 | // D_800C6650[i].unk10 = sp34[i]->unk0 - sp34[i]->unkC; 28 | // D_800C6650[i].unk12 = sp34[i]->unk14; 29 | // } 30 | // if (sp34 != NULL) { 31 | // func_10004074(sp34); 32 | // } 33 | // return i; 34 | // } 35 | -------------------------------------------------------------------------------- /conker/src/game_33660.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_150061B0(void) { 8 | osCreateMesgQueue(&D_800BE900, &D_800BE2D0, 8); 9 | osSetEventMesg(OS_EVENT_SI, &D_800BE900, D_800BE9E0); 10 | D_800BE730.unk0 = &D_800BE748; 11 | D_800BE730.unk4 = &D_800BE74E; 12 | D_800BE730.unk8 = &D_800BE754; 13 | D_800BE730.unkC = &D_800BE75A; 14 | func_15007644(); 15 | } 16 | 17 | #pragma GLOBAL_ASM("asm/nonmatchings/game_33660/func_15006234.s") 18 | -------------------------------------------------------------------------------- /conker/src/game_34F20.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15007A70(s16 arg0, s16 arg1, s16 arg2) { 8 | 9 | D_800BE9B4 = 2; 10 | func_1503FB08(); 11 | D_800BE9F0 = D_800BE9F4 = arg2; 12 | 13 | func_15172C50(D_800DD2C0); 14 | func_15008230(); 15 | func_15005270(); 16 | func_15017300(arg0, arg1); 17 | 18 | func_15015F40(D_80087280[D_800D2138], arg2); 19 | func_150175E0(); 20 | func_150177F8(); 21 | func_15089BB0(); 22 | func_15000090(); 23 | D_800BE938 = 1; 24 | D_800D18A8 = 0; 25 | D_800BE9ED = 0; 26 | } 27 | 28 | // requires jump table 29 | #pragma GLOBAL_ASM("asm/nonmatchings/game_34F20/func_15007B3C.s") 30 | 31 | void func_150081E4(void) { 32 | s32 i; 33 | 34 | D_800D3668 = 0; 35 | D_800CBE00 = 0; 36 | D_800DDD64 = 0; 37 | 38 | for (i = 0; i < 2; i++) 39 | { 40 | D_800DF7C8[i] = 0; 41 | } 42 | 43 | D_800D245C = 0; 44 | D_800D2548 = 0; 45 | } 46 | 47 | 48 | void func_15008230(void) { 49 | D_800C35C4 = (u8)0; 50 | D_800C3C88 = (u8)0; 51 | } 52 | 53 | void func_15008248(s32 arg0) { 54 | s32 i; 55 | 56 | D_800C3638 = 0; 57 | D_800C3671 = 0; 58 | D_800C3670 = 0; 59 | func_1501D044(0); 60 | func_1501D044(1); 61 | D_800C3663 = 0; 62 | 63 | for (i = 0; i < 3; i++) 64 | { 65 | D_800C3CA0[i].unk0 = 0; 66 | D_800C3CA0[i].unkC = 0; 67 | } 68 | 69 | D_800C3681 = 0; 70 | D_800C3682 = 0; 71 | D_800C3683 = 0; 72 | } 73 | 74 | void func_150082CC(void) { 75 | s32 tmp = D_800C35C4 - 1; 76 | 77 | if (D_800C35C4 != 0) { 78 | if (D_800C35C5 == 0) { 79 | D_800C35EA = 2; 80 | } 81 | D_800C35C4 = 0; 82 | func_1501D348(D_800BE9F0, tmp, 0, D_800C3C90, D_800C3C94); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /conker/src/game_357F0.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | // bit of a beast 6 | #pragma GLOBAL_ASM("asm/nonmatchings/game_357F0/func_15008340.s") 7 | -------------------------------------------------------------------------------- /conker/src/game_35D20.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | // loops and loops 6 | #pragma GLOBAL_ASM("asm/nonmatchings/game_35D20/func_15008870.s") 7 | #pragma GLOBAL_ASM("asm/nonmatchings/game_35D20/func_15008930.s") 8 | -------------------------------------------------------------------------------- /conker/src/game_360A0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | #pragma GLOBAL_ASM("asm/nonmatchings/game_360A0/func_15008BF0.s") 8 | // NON-MATCHING: absolute mess 9 | // s32 func_15008BF0(struct110 *arg0) { 10 | // struct109 tmp; 11 | // f32 foo; 12 | // f32 bar = D_80095B40; 13 | // 14 | // arg0->unk16 |= 4; 15 | // foo = arg0->unk6 * D_80095B44 * D_80095B48; 16 | // 17 | // tmp.unk54 = 0.0f; 18 | // tmp.unk50 = foo; 19 | // 20 | // tmp.unk70 = 4; 21 | // tmp.unk74 = 2; 22 | // tmp.unk60 = 100; 23 | // tmp.unk62 = 100; 24 | // tmp.unk6C = 40; 25 | // tmp.unk6E = 20; 26 | // // 27 | // tmp.unk58 = 7.0f; 28 | // tmp.unk5C = 6.0f; 29 | // tmp.unk48 = D_80095B4C; 30 | // tmp.unk4C = 7.5f; 31 | // tmp.unk64 = D_80095B50; 32 | // tmp.unk68 = D_80095B54; 33 | // tmp.unk2A = 20; 34 | // tmp.unk28 = arg0->unk10 * bar; 35 | // tmp.unk2E = 8; 36 | // tmp.unk2C = ((arg0->unkC * bar) - 64.0f); 37 | // 38 | // func_15143874(tmp.unk28 - 64, arg0->unk6, &tmp.unk20, &tmp.unk24); 39 | // 40 | // tmp.unk30 = arg0->unk0 - tmp.unk20; 41 | // tmp.unk34 = arg0->unk2; 42 | // tmp.unk3C = tmp.unk20 + tmp.unk20; 43 | // tmp.unk40 = 0.0f; 44 | // tmp.unk38 = arg0->unk4 - tmp.unk24; 45 | // tmp.unk44 = tmp.unk24 + tmp.unk24; 46 | // 47 | // func_15189900(&tmp, arg0->unk1B); 48 | // 49 | // return 1; 50 | // } 51 | -------------------------------------------------------------------------------- /conker/src/game_362B0.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | 6 | void func_15008E00(void) { 7 | D_800DDE50 = (u8)0; 8 | } 9 | 10 | #pragma GLOBAL_ASM("asm/nonmatchings/game_362B0/func_15008E10.s") 11 | -------------------------------------------------------------------------------- /conker/src/game_3B920.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | #pragma GLOBAL_ASM("asm/nonmatchings/game_3B920/func_1500E470.s") 8 | // NON-MATCHING: damn nops, is this -g ? 9 | // void func_1500E470(s32 arg0) { 10 | // u8 tmp; 11 | // D_800DD190 = -1; 12 | // bzero(&D_800DD198, 24); 13 | // D_800DD404 = 0xFF; 14 | // D_800DD405 = 0; 15 | // D_800DD406 = 0; 16 | // D_800E0930 = 0; 17 | // D_800E0934 = 0; 18 | // D_800E0940 = 0; 19 | // D_8008CD00 = 0; 20 | // D_80088B60 = 0; 21 | // D_800BE4E0 = 0; 22 | // // is this handwritten? 23 | // D_800E0A10 = func_15012720(); 24 | // func_15012370(); 25 | // 26 | // func_151EF640(64); 27 | // func_151732E0(arg0); 28 | // func_15004FE0(arg0); 29 | // func_150127B0(); 30 | // 31 | // func_1519582C(); 32 | // func_15008BE0(); 33 | // func_15008B90(); 34 | // func_1500E5C0(); 35 | // 36 | // if (0) {}; 37 | // if (D_800B0DF0->unkA) { 38 | // D_80082D90[D_800B0DF0->unkA](); 39 | // } 40 | // func_1500ABA0(arg0); 41 | // func_1500BEC0(); 42 | // func_1500AC14(); 43 | // func_151872B0(arg0); 44 | // func_15178EB0(); 45 | // func_15012FE0(); 46 | // 47 | // if (0) {}; 48 | // tmp = (D_800D2E4C->unk4 & 128) == 0; 49 | // func_151645C4(tmp); 50 | // } 51 | -------------------------------------------------------------------------------- /conker/src/game_3BA70.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | #pragma GLOBAL_ASM("asm/nonmatchings/game_3BA70/func_1500E5C0.s") 8 | 9 | void func_1500E70C(s32 arg0) { 10 | if (arg0 == 0x2B) { 11 | func_15011C70(); 12 | } 13 | } 14 | 15 | #pragma GLOBAL_ASM("asm/nonmatchings/game_3BA70/func_1500E738.s") 16 | 17 | void func_1500E890(void) { 18 | func_15008E00(); 19 | func_15008E10(0); 20 | func_15008E10(1); 21 | } 22 | 23 | #pragma GLOBAL_ASM("asm/nonmatchings/game_3BA70/func_1500E8C0.s") 24 | // NON-MATCHING: fair bit to figure out 25 | // void func_1500E8C0(void) { 26 | // struct145 tmp; 27 | // s32 phi_v0; 28 | // 29 | // func_15195AA8(D_800B0E00[0], D_800902E8, 0, -1, 0, 0, 0, -6); 30 | // func_15195AA8(D_800B0E00[1], D_800902E8, 0, -1, 0, 1, 0, -6); 31 | // tmp.unk28 = D_80096210; // 0.2142857164144516 32 | // tmp.unk30 = 5.0f; 33 | // tmp.unk34 = 6.0f; 34 | // tmp.unk20 = 8.0f; 35 | // tmp.unk24 = 7.0f; 36 | // tmp.unk14 = 0.0f; 37 | // tmp.unk18 = 0.0f; 38 | // tmp.unk2C = 0.0f; 39 | // tmp.unk48 = 3; 40 | // tmp.unk4C = 2; 41 | // tmp.unk0 = 0x34; 42 | // tmp.unk2 = 0x12; 43 | // tmp.unk4 = -0x28; 44 | // tmp.unk6 = 0xF; 45 | // tmp.unk38 = 0x9B; 46 | // tmp.unk3A = 0x64; 47 | // tmp.unk44 = 0x29; 48 | // tmp.unk46 = 0x29; 49 | // tmp.unk10 = 400.0f; 50 | // tmp.unk1C = 900.0f - 400.0f; 51 | // tmp.unk3C = D_80096214; // 0.6000000238418579 52 | // tmp.unk40 = D_80096218; 53 | // tmp.unkC = D_8009621C; 54 | // tmp.unk8 = 800.0f; 55 | // func_15189900(&tmp, 1); 56 | // if (D_800BE9F0 == 6) { 57 | // phi_v0 = 52; 58 | // } else { 59 | // phi_v0 = 7; 60 | // } 61 | // func_1000FA64(1567, (s16)phi_v0, 0, 0, 12000, 1000, 400, func_1000EF40, 0, 0, 72, 0); 62 | // } 63 | 64 | void func_1500EAA0(void) { 65 | func_15195AA8(D_800B0E00[0], D_80090320, 0, -1, 0, 0, 0, -8); 66 | func_15195AA8(D_800B0E00[1], D_80090320, 0, -1, 0, 1, 0, -8); 67 | } 68 | -------------------------------------------------------------------------------- /conker/src/game_3D5C0.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | 6 | // need to figure out the structs 7 | #pragma GLOBAL_ASM("asm/nonmatchings/game_3D5C0/func_15010110.s") 8 | -------------------------------------------------------------------------------- /conker/src/game_3D9A0.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | 6 | // ??? 7 | #pragma GLOBAL_ASM("asm/nonmatchings/game_3D9A0/func_150104F0.s") 8 | 9 | void func_15010538(struct127 *arg0) { 10 | struct175 tmp; 11 | struct37 *temp_v0; 12 | 13 | func_15161E24(arg0, 2, 2, 300, 30, 100, 200, 255, 255, 1); 14 | // FAKEMATCH but works... 15 | dummy_label_927029: 16 | tmp.unk0 = arg0; 17 | tmp.unk4 = arg0->unique_id; 18 | tmp.unk6 = 0; 19 | tmp.unk8 = 0; 20 | tmp.unkA = 0; 21 | 22 | temp_v0 = func_15149130(300, -1, 80, -1, 0, 61, 12, 255, 1); 23 | if (temp_v0 != NULL) { 24 | memcpy(&temp_v0->unk28, &tmp, 12); // memcpy 25 | } 26 | } 27 | 28 | #pragma GLOBAL_ASM("asm/nonmatchings/game_3D9A0/func_15010600.s") 29 | // NON-MATCHING: addresses are wrong :( 30 | // void func_15010600(void) { 31 | // s32 i; 32 | // 33 | // for (i = 0; i < 11; i++) { 34 | // D_800D9930[i] = D_800D9920[i] = 0; 35 | // } 36 | // } 37 | -------------------------------------------------------------------------------- /conker/src/game_3DC30.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15010780(void) { 8 | func_15177410(1, 255, 0, 108, 0, 0.0f, 15000, 80.0f, 77, 15, 127, 127, 127, 127, 127, 127); 9 | func_15177410(0, 255, 6628, 108, 0, 0.0f, 15000, 80.0f, 77, 15, 127, 127, 127, 127, 127, 127); 10 | } 11 | 12 | #pragma GLOBAL_ASM("asm/nonmatchings/game_3DC30/func_15010880.s") 13 | // NON-MATCHING: ops in wrong order 14 | // void func_15010880(void) { 15 | // struct177 tmp; 16 | // struct37 *temp_v0; 17 | 18 | // func_15177410(0x10, 0xE9, -437, 0x463, -0xCBF, 90.0f, 15000, 36.0f, 0x4D, 15, 127, 127, 127, 127, 127, 127); 19 | // D_800E0934 = func_150DE32C; 20 | 21 | // tmp.unk0 = 0; 22 | // tmp.unk4 = *((s32*) &D_800D3098) + 0xEA0; 23 | // tmp.unk8 = *((s32*) &D_800D3098) + 0xED4; 24 | 25 | // temp_v0 = func_15149130(300, -1, 94, -1, 0, 0, 12, 255, 1); 26 | // if (temp_v0 != NULL) { 27 | // memcpy(&temp_v0->unk28, &tmp, 12); // memcpy 28 | // } 29 | // if ((D_800D2E4C->unk12 & 0x40) != 0) { 30 | // func_15149130(5, 9, -1, -1, 1, 0, 0, 255, 1); 31 | // } 32 | // } 33 | 34 | void func_150109D0(void) { 35 | struct179 tmp; 36 | 37 | tmp.unk20 = 0; 38 | //D_80096430 listed as (struct180*), but used as (struct180) here; 39 | tmp.unk4 = *((struct180*) &D_80096430); 40 | 41 | tmp.unk0 = 1; 42 | tmp.unk1C = fabsf(tmp.unk4.unk4 - tmp.unk4.unk10); 43 | func_151ACBD4(&tmp, 0); 44 | func_150E8854(); 45 | } 46 | -------------------------------------------------------------------------------- /conker/src/game_3DF10.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | // fat struct to decipher 6 | #pragma GLOBAL_ASM("asm/nonmatchings/game_3DF10/func_15010A60.s") 7 | -------------------------------------------------------------------------------- /conker/src/game_3F1F0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15011D40(void) { 8 | func_15103800(); 9 | } 10 | 11 | // doesnt look like fun 12 | #pragma GLOBAL_ASM("asm/nonmatchings/game_3F1F0/func_15011D60.s") 13 | -------------------------------------------------------------------------------- /conker/src/game_3F670.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | 6 | #pragma GLOBAL_ASM("asm/nonmatchings/game_3F670/func_150121C0.s") 7 | -------------------------------------------------------------------------------- /conker/src/game_3F820.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | #pragma GLOBAL_ASM("asm/nonmatchings/game_3F820/func_15012370.s") 8 | // void func_15012370(void) { 9 | // f32 temp_f0; 10 | // f32 temp_f2; 11 | // u8 i; 12 | // 13 | // f32 foo = D_80096560; // 20000.0f 14 | // f32 **tmp = D_800BE628; 15 | // 16 | // for (i = 0; i <= D_80082FA0; i++) { 17 | // temp_f0 = tmp[i][1] * 0.5f; 18 | // temp_f2 = tmp[i][2] * 0.5f; 19 | // func_151EF954(D_800DCC10[i], -temp_f0, temp_f0, -temp_f2, temp_f2, 1.0f, foo, 1.0f); 20 | // } 21 | // } 22 | 23 | void func_15012470(void) { 24 | D_80088750 = func_1518AADC(4, 300, 0); 25 | } 26 | 27 | #pragma GLOBAL_ASM("asm/nonmatchings/game_3F820/func_150124A0.s") 28 | -------------------------------------------------------------------------------- /conker/src/game_43620.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | #pragma GLOBAL_ASM("asm/nonmatchings/game_43620/func_15016170.s") 8 | // looks straightforward.. but... isnt 9 | // void func_15016170(s32 arg0) { 10 | // s32 idx; 11 | // s16 tmp; 12 | // bzero(&D_800E0D80, 160); 13 | // D_800E0D80.unk8 = alHeapDBAlloc(0, 0, arg0, 1, 80); 14 | // D_800E0D80.unk74 = alHeapDBAlloc(0, 0, arg0, 1, 1088); 15 | // D_800E0D80.unk5C = alHeapDBAlloc(0, 0, arg0, 1, 8); 16 | // D_800E0D80.unk96 = 64; 17 | // D_800E0D80.unkC = 64; 18 | // D_800E0D80.unk84 = 0; 19 | // D_800E0D80.unkE = 0x7FFF; 20 | // D_800E0D80.unk88 = 0x7FFF; 21 | // D_800E0D80.unk9A = 0; 22 | // D_800E0D80.unk32 = 0; 23 | // D_800E0D80.unk30 = 0; 24 | // D_800E0D80.unk94 = D_800E0D80.unk96; 25 | // idx = D_800E0D80.unkC; 26 | // tmp = D_800E0D80.unkE; 27 | // D_800E0D80.unk10 = (D_8002BC10[idx] * tmp) >> 15; 28 | // D_800E0D80.unk12 = (D_8002BD0E[-idx] * tmp) >> 15; 29 | // D_800E0D80.unk24 = 1; 30 | // D_800E0D80.unk14 = 0x7FFC; 31 | // D_800E0D80.unk16 = 0; 32 | // func_151F3C34(func_151F3C4C, tmp, 64); 33 | // } 34 | -------------------------------------------------------------------------------- /conker/src/game_439B0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15016500(void) { 8 | D_800D1940 = (u8)0; 9 | D_800D1941 = (u8)0; 10 | D_800D1944 = 0; 11 | D_800D1948 = 0; 12 | D_800D194C = 0; 13 | D_800D1950 = 0; 14 | bzero(D_800D1958, 48); // bzero 15 | D_800D1988 = 0.0f; 16 | D_800D198C = 0.0f; 17 | D_800D1990 = 0.0f; 18 | D_800D1994 = (u8)0; 19 | D_800D1995 = (u8)0; 20 | D_800D1998 = 0; 21 | } 22 | 23 | // grim looking loop 24 | #pragma GLOBAL_ASM("asm/nonmatchings/game_439B0/func_15016588.s") 25 | -------------------------------------------------------------------------------- /conker/src/game_447B0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15017300(s16 arg0, s16 arg1) { 8 | s32 i; 9 | s16 tmp; 10 | 11 | tmp = arg0; 12 | bzero(&D_800D2138, 524); 13 | D_800D2138 = tmp; 14 | 15 | for (i = 0; i < 16; i++) { 16 | if ((1 << i) & arg1) { 17 | func_15085710(i, 0, D_80087270[i]); 18 | D_800D2457 = D_800D2456 = 6; 19 | func_15085710(i, 5, D_8008726C); 20 | func_15085710(i, 2, D_80087260); 21 | if (D_800BE616 != 0) { 22 | func_15085710(i, 9, D_80087264); 23 | } 24 | } 25 | func_1501748C(arg1); 26 | } 27 | D_800D2340 = arg1; 28 | D_800D2132 = 0; 29 | } 30 | 31 | void func_1501748C(s16 arg0) { 32 | } 33 | 34 | void func_15017498(void) { 35 | bzero(&D_800D2138, 524); 36 | } 37 | 38 | // double-loop 39 | #pragma GLOBAL_ASM("asm/nonmatchings/game_447B0/func_150174C0.s") 40 | 41 | void func_15017578(s32 arg0) { 42 | u32 tmp = 0; 43 | D_800D23C0 = func_1502B5C8(&tmp, 3, 12, arg0, 4); 44 | D_80087380 = tmp / 24; 45 | func_150174C0(D_800DBF00); 46 | } 47 | -------------------------------------------------------------------------------- /conker/src/game_44A90.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_150175E0(void) { 8 | if ((D_800BE616 == 0) && ((D_800D2E4C->unk18 & 1) == 0)) { 9 | D_800D2457 = D_800D2456 = 3; 10 | } else { 11 | D_800D2457 = D_800D2456 = 6; 12 | } 13 | } 14 | 15 | #pragma GLOBAL_ASM("asm/nonmatchings/game_44A90/func_15017640.s") 16 | // void func_15017640(void) { 17 | // s32 i; 18 | // D_800D2458 = 0; 19 | // D_800D2588 = 0; 20 | // 21 | // D_800D2438[0] = 0.0f; 22 | // D_800D2438[1] = 0.0f; 23 | // D_800D2438[2] = 0.0f; 24 | // 25 | // D_800D2428[0] = D_8009DCB4[0]; 26 | // D_800D2428[1] = D_8009DCB4[1]; 27 | // D_800D2428[2] = D_8009DCB4[2]; 28 | // 29 | // D_800D2444 = 0; 30 | // D_800D245C = 0; 31 | // 32 | // for (i = 0; i < 6; i++) { 33 | // D_800D2410[i] = 1.0f; 34 | // } 35 | // 36 | // D_800D246D = 0; 37 | // D_800D247D = 0; 38 | // 39 | // D_800D2460[1][13] = 0; 40 | // D_800D2460[2][13] = 0; 41 | // D_800D2460[3][13] = 0; 42 | // D_800D2460[0][13] = 0; 43 | // 44 | // D_800D24C0 = 0; 45 | // bzero(&D_800D24C8, 0xC0); 46 | // guPerspective(&D_800D23D0, &D_800D2454, 50.0f, 60.599998474121094f, 53.0f, D_800968B0, 1.0f); 47 | // } 48 | -------------------------------------------------------------------------------- /conker/src/game_44C40.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15017790(void) { 8 | func_1509C120(); 9 | bzero(D_800D2E4C, 0x1B); 10 | bzero(&D_800D2E50, 0x10); 11 | bzero(&D_800D2E60, 9); 12 | bzero(&D_800D2E70, 0xCC); 13 | D_800D2E44 = (u8)0; 14 | } 15 | 16 | void func_150177F8(void) { 17 | func_1509BA04(1); 18 | bzero(&D_800D2F48, 0xC); 19 | func_150A00F0(); 20 | D_800D2DB0 = D_800968C0; 21 | D_800D2E41 = 0xA; 22 | D_800D2E42 = 6; 23 | D_800D3858 = 0; 24 | D_800D2E44 = 0; 25 | } 26 | 27 | void func_15017868(void) { 28 | u16 *temp_v0; 29 | s32 i; 30 | 31 | for (i = 0; i < D_800D2F3C; i++) { 32 | temp_v0 = func_1509B704((s16)D_800D2F40[i]); 33 | if ((temp_v0 != 0) && ((temp_v0[0] & 0x1000) != 0)) { 34 | temp_v0[1] = D_800BE9F0; 35 | } 36 | 37 | } 38 | func_1509BA04(0); 39 | func_1509B4A0(*(((s16*)&D_800BE9F0)+1), 1); // er? 40 | } 41 | 42 | #pragma GLOBAL_ASM("asm/nonmatchings/game_44C40/func_15017930.s") 43 | #pragma GLOBAL_ASM("asm/nonmatchings/game_44C40/func_15017B20.s") 44 | #pragma GLOBAL_ASM("asm/nonmatchings/game_44C40/func_15017FA4.s") 45 | -------------------------------------------------------------------------------- /conker/src/game_6E240.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | 6 | void func_15040D90(s32 arg0) { 7 | 8 | } 9 | 10 | #pragma GLOBAL_ASM("asm/nonmatchings/game_6E240/func_15040D9C.s") 11 | 12 | #pragma GLOBAL_ASM("asm/nonmatchings/game_6E240/func_15040FCC.s") 13 | 14 | void func_1504129C(void) { 15 | s32 i = 0; 16 | do {} while (++i < 0x18000000); 17 | } 18 | -------------------------------------------------------------------------------- /conker/src/game_70200.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15042D50(void) { 8 | D_800CBD64 = 0; 9 | func_15043384(0); 10 | } 11 | 12 | void func_15042D78(u8 arg0) { 13 | D_800CBD74 = arg0; 14 | } 15 | 16 | #pragma GLOBAL_ASM("asm/nonmatchings/game_70200/func_15042D94.s") 17 | #pragma GLOBAL_ASM("asm/nonmatchings/game_70200/func_15042E3C.s") 18 | #pragma GLOBAL_ASM("asm/nonmatchings/game_70200/func_15042ECC.s") 19 | 20 | void func_150432BC(f32 arg0) { 21 | D_800CBD80 = arg0; 22 | } 23 | 24 | void func_150432CC(s32 arg0, s32 arg1) { 25 | D_800CBD74 = D_800CBD74 | 1; 26 | D_800CBD74 = D_800CBD74; 27 | D_800CBD7C = arg1; 28 | D_800CBD78 = arg0; 29 | } 30 | 31 | void func_150432FC(s16 arg0, s16 arg1) { 32 | D_800CBD70 = arg0; 33 | D_800CBD72 = arg1; 34 | } 35 | 36 | void func_1504332C(u8 arg0, u8 arg1, u8 arg2, u8 arg3) { 37 | D_800CBD60 = arg0; 38 | D_800CBD61 = arg1; 39 | D_800CBD62 = arg2; 40 | D_800CBD63 = arg3; 41 | } 42 | 43 | #pragma GLOBAL_ASM("asm/nonmatchings/game_70200/func_15043384.s") 44 | 45 | void func_15043A00(struct105 *arg0, s32 arg1, s32 arg2) { 46 | if (arg0 != 0) { 47 | arg0->unk0 = arg1; // are these structs? 48 | arg0->unk4 = arg2; 49 | arg0->unkC = 0; 50 | arg0->unk8 = 0; 51 | } 52 | } 53 | 54 | // something with memcpy 55 | #pragma GLOBAL_ASM("asm/nonmatchings/game_70200/func_15043A20.s") 56 | #pragma GLOBAL_ASM("asm/nonmatchings/game_70200/func_15043AC8.s") 57 | 58 | #pragma GLOBAL_ASM("asm/nonmatchings/game_70200/func_15043B70.s") 59 | #pragma GLOBAL_ASM("asm/nonmatchings/game_70200/func_15043BB8.s") 60 | 61 | #pragma GLOBAL_ASM("asm/nonmatchings/game_70200/func_15043CA4.s") 62 | -------------------------------------------------------------------------------- /conker/src/game_71240.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_15043D90(Mtx *m, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9) { 8 | f32 sp18[4][4]; 9 | 10 | func_150A8050(&sp18, arg1, arg2, arg3); 11 | sp18[3][0] = arg7; 12 | sp18[3][1] = arg8; 13 | sp18[3][2] = arg9; 14 | sp18[0][0] *= arg4; 15 | sp18[0][1] *= arg4; 16 | sp18[0][2] *= arg4; 17 | sp18[1][0] *= arg5; 18 | sp18[1][1] *= arg5; 19 | sp18[1][2] *= arg5; 20 | sp18[2][0] *= arg6; 21 | sp18[2][1] *= arg6; 22 | sp18[2][2] *= arg6; 23 | guMtxF2L(&sp18, m); 24 | } 25 | 26 | void func_15043E68(Mtx *m, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6) { 27 | f32 sp18[4][4]; 28 | 29 | func_150A8050(&sp18, arg1, arg2, arg3); 30 | sp18[3][0] = arg4; 31 | sp18[3][1] = arg5; 32 | sp18[3][2] = arg6; 33 | guMtxF2L(&sp18, m); 34 | } 35 | 36 | void func_15043EC8(f32 mtx[4][4], f32 x, f32 y, f32 z, f32 arg4, f32 arg5, f32 arg6) { 37 | mtx[3][0] = arg4; 38 | mtx[3][1] = arg5; 39 | mtx[3][2] = arg6; 40 | mtx[0][0] *= x; 41 | mtx[0][1] *= x; 42 | mtx[0][2] *= x; 43 | mtx[1][0] *= y; 44 | mtx[1][1] *= y; 45 | mtx[1][2] *= y; 46 | mtx[2][0] *= z; 47 | mtx[2][1] *= z; 48 | mtx[2][2] *= z; 49 | } 50 | 51 | void func_15043F6C(f32 arg0[4][4], f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9) { 52 | func_150A9B0C(arg0, arg1, arg2, arg3, arg4, arg5, arg6); 53 | arg0[3][0] = arg7; 54 | arg0[3][1] = arg8; 55 | arg0[3][2] = arg9; 56 | arg0[0][3] = 0.0f; 57 | arg0[1][3] = 0.0f; 58 | arg0[2][3] = 0.0f; 59 | arg0[3][3] = 1.0f; 60 | } 61 | 62 | void func_15043FF0(vertex *arg0, struct113 *arg1) { 63 | arg0->x = arg1->unk18; 64 | arg0->y = arg1->unk1A; 65 | arg0->z = arg1->unk1C; 66 | arg0->x += arg1->unk38 * 0.000015258789f; // this is 1 / 65536 67 | arg0->y += arg1->unk3A * 0.000015258789f; 68 | arg0->z += arg1->unk3C * 0.000015258789f; 69 | } 70 | 71 | #pragma GLOBAL_ASM("asm/nonmatchings/game_71240/func_150440A0.s") 72 | -------------------------------------------------------------------------------- /conker/src/game_71770.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_150442C0(f32 arg0[4][4], f32 x, f32 y, f32 z) { 8 | arg0[3][0] += x * arg0[0][0] + y * arg0[1][0] + z * arg0[2][0]; 9 | arg0[3][1] += x * arg0[0][1] + y * arg0[1][1] + z * arg0[2][1]; 10 | arg0[3][2] += x * arg0[0][2] + y * arg0[1][2] + z * arg0[2][2]; 11 | } 12 | -------------------------------------------------------------------------------- /conker/src/game_75E60.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | #pragma GLOBAL_ASM("asm/nonmatchings/game_75E60/func_150489B0.s") 8 | // NON-MATCHING: not convinced this is correct 9 | // f32 func_150489B0(u8 arg0) { 10 | // f32 ret; 11 | // 12 | // if (arg0 >= 65) { 13 | // if (arg0 >= 129) { 14 | // if (arg0 >= 193) { 15 | // ret = D_8009A620[-arg0]; 16 | // } else { 17 | // ret = -D_8009A020[arg0]; 18 | // } 19 | // } else { 20 | // ret = -D_8009A420[-arg0]; 21 | // } 22 | // } else { 23 | // ret = D_8009A220[arg0]; 24 | // } 25 | // 26 | // return ret; 27 | // } 28 | 29 | void func_15048A40(u8 arg0) { 30 | func_150489B0((arg0 - 0x40) & 0xFF); 31 | } 32 | 33 | f32 func_15048A70(f32 arg0, f32 arg1) { 34 | f32 tmp = arg0 - arg1; 35 | if (tmp > 180.0f) { 36 | arg0 -= 360.0f; 37 | } else { 38 | if (tmp <= -180.0f) { 39 | arg1 -= 360.0f; 40 | } 41 | } 42 | return arg1 - arg0; 43 | } 44 | 45 | s32 func_15048AD0(s32 arg0, s32 arg1) { 46 | s32 temp_v0 = arg0 - arg1; 47 | if (temp_v0 >= 181) { 48 | arg0 = arg0 - 360; 49 | } else { 50 | if (temp_v0 < -179) { 51 | arg1 = arg1 - 360; 52 | } 53 | } 54 | return arg1 - arg0; 55 | } 56 | -------------------------------------------------------------------------------- /conker/src/game_76710.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | // wtf? 8 | #pragma GLOBAL_ASM("asm/nonmatchings/game_76710/func_15049260.s") 9 | 10 | void func_150492CC(f32 arg0, f32 arg1, f32 arg2) { 11 | D_800CC220 = arg0; 12 | D_800CC224 = arg1; 13 | D_800CC228 = arg2; 14 | D_800CC22C = arg0 / 2; 15 | D_800CC230 = arg1 / 2; 16 | D_800CC234 = arg2 / 2; 17 | 18 | if (arg0 == 0.0f) { 19 | arg0 = 0.001f; 20 | } 21 | 22 | D_800CC238 = arg1 / arg0; 23 | D_800CC23C = arg2 / arg0; 24 | } 25 | 26 | // too many temp vars 27 | #pragma GLOBAL_ASM("asm/nonmatchings/game_76710/func_15049350.s") 28 | -------------------------------------------------------------------------------- /conker/src/game_BC430.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | #pragma GLOBAL_ASM("asm/nonmatchings/game_BC430/func_1508EF80.s") 8 | -------------------------------------------------------------------------------- /conker/src/game_CB1C0.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | 6 | s32 func_1509DD10(s32 arg0) { 7 | return 1; 8 | } 9 | 10 | s32 func_1509DD20(s32 arg0) { 11 | return 1; 12 | } 13 | 14 | s32 func_1509DD30(s32 arg0) { 15 | return 1; 16 | } 17 | 18 | s32 func_1509DD40(s32 arg0) { 19 | return 1; 20 | } 21 | 22 | s32 func_1509DD50(s32 arg0, struct214 *arg1) { 23 | func_15177F90(arg1->unk7, 0, arg1->unkB, arg1->unkC, arg1->unk10, arg1->unk14, arg1->unk18, 0x7FFF, 0xFF, arg1->unk1C, 0); 24 | return 1; 25 | } 26 | 27 | s32 func_1509DDC4(s32 arg0, u8 arg1) { 28 | func_15178E14(arg0 & 0xff, arg0); 29 | return 0; 30 | } 31 | 32 | s32 func_15084000(s32); 33 | void func_15178C34(u8, s32, s32, s32, s32); 34 | void func_15178BE4(u8, f32*, s32); 35 | s32 func_15178C9C(u8 arg0, s32 arg1); 36 | #pragma GLOBAL_ASM("asm/nonmatchings/game_CB1C0/func_1509DDFC.s") 37 | // NON-MATCHING: what is the logic here!? 38 | // s32 func_1509DDFC(s32 arg0, s32 arg1, struct215 *arg2) { 39 | // // if (arg1 == 1) { 40 | // // return 0; 41 | // // } 42 | // // if (arg1 == 0) { 43 | // // func_15178BE4(arg0 & 0xFF, &D_800CC2D0[func_15084000(arg2->unk8 & ~0x2000)].unk14, arg2->unkC.s.unk2); 44 | // // return 1; 45 | // // } 46 | // // if (arg1 != 1) { 47 | // // func_15178C34(arg0 & 0xFF, arg2->unk8, arg2->unkC.i.unk0, arg2->unk10, arg2->unk14); 48 | // // return 1; 49 | // // } 50 | // 51 | // switch (arg1) { 52 | // case 1: 53 | // return 0; 54 | // case 0: 55 | // func_15178BE4(arg0 & 0xFF, &D_800CC2D0[func_15084000(arg2->unk8 & ~0x2000)].unk14, arg2->unkC.s.unk2); 56 | // return 1; 57 | // default: 58 | // func_15178C34(arg0 & 0xFF, arg2->unk8, arg2->unkC.i.unk0, arg2->unk10, arg2->unk14); 59 | // return 1; 60 | // } 61 | // } 62 | 63 | s32 func_1509DEC4(s32 arg0, s32 arg1, struct215 *arg2) { 64 | if (arg1 == 0) { 65 | s32 mask = ~0x2000; 66 | return func_15178C9C(arg0 & 0xff, func_15084000(arg2->unk8 & mask)); 67 | } 68 | return 0; 69 | } 70 | -------------------------------------------------------------------------------- /conker/src/game_D4C20.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | // handwritten memset? 8 | #pragma GLOBAL_ASM("asm/nonmatchings/game_D4C20/func_150A7770.s") 9 | -------------------------------------------------------------------------------- /conker/src/game_D5160.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | #pragma GLOBAL_ASM("asm/nonmatchings/game_D5160/func_150A7CB0.s") 5 | // NON-MATCHING: sw/jr in wrong order 6 | // void func_150A7CB0(f32 mtx[4][4], s32 x, s32 y, s32 z) { 7 | // ((s32)mtx[0][0]) = x; 8 | // ((s32)mtx[0][1]) = 0; 9 | // ((s32)mtx[0][2]) = 0; 10 | // ((s32)mtx[0][3]) = 0; 11 | // ((s32)mtx[1][0]) = 0; 12 | // ((s32)mtx[1][1]) = y; 13 | // ((s32)mtx[1][2]) = 0; 14 | // ((s32)mtx[1][3]) = 0; 15 | // ((s32)mtx[2][0]) = 0; 16 | // ((s32)mtx[2][1]) = 0; 17 | // ((s32)mtx[2][2]) = z; 18 | // ((s32)mtx[2][3]) = 0; 19 | // ((s32)mtx[3][0]) = 0; 20 | // ((s32)mtx[3][1]) = 0; 21 | // mtx[3][3] = 1.0f; 22 | // // fakematch to "help"... 23 | // dummy_label_123:; 24 | // ((s32)mtx[3][2]) = 0; 25 | // } 26 | -------------------------------------------------------------------------------- /conker/src/game_D51B0.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | 6 | // s16 / f32 matrix 7 | #pragma GLOBAL_ASM("asm/nonmatchings/game_D51B0/func_150A7D00.s") 8 | -------------------------------------------------------------------------------- /conker/src/game_D5250.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | 6 | // setting W values in identity matrix 7 | #pragma GLOBAL_ASM("asm/nonmatchings/game_D5250/func_150A7DA0.s") 8 | // NON-MATCHING: same issues as other matrix funcs 9 | // void func_150A7DA0(f32 arg0[4][4], s32 arg1, s32 arg2, s32 arg3) { 10 | // if (0) {}; 11 | // ((s32)arg0[0][1]) = 0; 12 | // (arg0[0][0]) = 1.0f; 13 | // dummy_label_418035: ; 14 | // ((s32)arg0[0][2]) = 0; 15 | // ((s32)arg0[0][3]) = 0; 16 | // ((s32)arg0[1][0]) = 0; 17 | // (arg0[1][1]) = 1.0f; 18 | // ((s32)arg0[1][2]) = 0; 19 | // ((s32)arg0[1][3]) = 0; 20 | // ((s32)arg0[2][0]) = 0; 21 | // ((s32)arg0[2][1]) = 0; 22 | // (arg0[2][2]) = 1.0f; 23 | // ((s32)arg0[2][3]) = 0; 24 | // ((s32)arg0[3][0]) = arg1; 25 | // ((s32)arg0[3][1]) = arg2; 26 | // ((s32)arg0[3][2]) = arg3; 27 | // (arg0[3][3]) = 1.0f; 28 | // } 29 | -------------------------------------------------------------------------------- /conker/src/game_D5500.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | // is this handwritten?? 6 | #pragma GLOBAL_ASM("asm/nonmatchings/game_D5500/func_150A8050.s") 7 | -------------------------------------------------------------------------------- /conker/src/init/data/data_2C200.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | f32 D_8002C200 = 0.009999999776482582; 4 | f32 D_8002C204 = 0.0; 5 | f64 D_8002C208 = 40.74366543152521; 6 | f32 D_8002C210 = 0.7111111283302307; 7 | f32 D_8002C214 = 0.009999999776482582; 8 | f64 D_8002C218 = 40.74366543152521; 9 | f32 D_8002C220 = 3015.0; 10 | f32 D_8002C224 = 36000000.0; 11 | f32 D_8002C228 = 6000.0; 12 | f32 D_8002C22C = 0.04183333367109299; 13 | f32 D_8002C230 = 1290.0; 14 | f32 D_8002C234 = 0.37166666984558105; 15 | f32 D_8002C238 = 24000.0; 16 | f32 D_8002C23C = 0.0; 17 | f32 D_8002C240 = 0.0; 18 | f32 D_8002C244 = 0.0; 19 | f32 D_8002C248 = 0.0; 20 | f32 D_8002C24C = 0.0; 21 | -------------------------------------------------------------------------------- /conker/src/init/data/data_2C3F0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | s32 D_8002C3F0 = 589833000; // 9.114742874391214e-18 4 | f32 D_8002C3F4 = 0.0f; 5 | f32 D_8002C3F8 = 0.009999999776482582; 6 | f32 D_8002C3FC = 0.10000000149011612; 7 | -------------------------------------------------------------------------------- /conker/src/init/data/data_2C400.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | f32 D_8002C400 = 367.0; 4 | f32 D_8002C404 = 0.30000001192092896; 5 | f32 D_8002C408 = 0.0; 6 | f32 D_8002C40C = 0.0; 7 | -------------------------------------------------------------------------------- /conker/src/init/data/data_2C6B0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char D_8002C6B0[] = "snd %d has been freed too early - %d\n\n\n\n\n"; 4 | char D_8002C6DC[] = "-2 sound has been freed too early - %d\n\n\n\n\n"; 5 | u32 D_8002C708 = 0x10015D84; 6 | u32 D_8002C70C = 0x1001645C; 7 | -------------------------------------------------------------------------------- /conker/src/init/data/data_2C750.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | f32 D_8002C750 = 1000000.0; 4 | f32 D_8002C754 = 0.0; 5 | f32 D_8002C758 = 0.0; 6 | f32 D_8002C75C = 0.0; 7 | -------------------------------------------------------------------------------- /conker/src/init/data/data_2C810.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | f32 D_8002C810 = 2.5640627573356416e-29; 4 | f32 D_8002C814 = 65535.0; 5 | f32 D_8002C818 = 0.0; 6 | f32 D_8002C81C = 0.0; 7 | f32 D_8002C820 = 26755.0; 8 | f32 D_8002C824 = 0.0; 9 | f32 D_8002C828 = 0.0; 10 | f32 D_8002C82C = 0.0; 11 | f32 D_8002C830 = 26755.0; 12 | f32 D_8002C834 = 7723.0; 13 | f32 D_8002C838 = 7723.0; 14 | f32 D_8002C83C = 0.0; 15 | f64 D_8002C840 = 1.99996; 16 | f32 D_8002C848 = 1.999959945678711; 17 | f32 D_8002C84C = 0.0; 18 | -------------------------------------------------------------------------------- /conker/src/init_12560.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_10012560(s32 arg0) { 8 | func_15043BB8(&D_800427A0); 9 | } 10 | 11 | void func_10012588(s32 arg0) { 12 | func_15016170(arg0); 13 | func_15043A00(&D_800427A0, &D_800427B0, 64); 14 | func_151F3C1C(func_10012560); 15 | } 16 | 17 | void func_100125CC(s32 arg0) { 18 | s32 res = func_151F2CDC(); 19 | if ((arg0 != 30) || (D_800BE9F8 != 27)) { 20 | if (res == 1) { 21 | func_151F2D6C(0, 11010); 22 | return; 23 | } 24 | if (res != 0) { 25 | func_151F2BA8(); 26 | } 27 | } 28 | } 29 | 30 | void func_1001263C(s32 arg0, s32 arg1, s32 arg2) { 31 | s32 temp_v0; 32 | s32 sp18; 33 | 34 | sp18 = 0; 35 | temp_v0 = func_1502B020(&sp18, 2, 22, arg0); 36 | D_800427F4 = (s16) arg0; 37 | if ((temp_v0 != 0) && (sp18 != 0)) { 38 | func_151F2D6C(arg1, 0); 39 | func_151F2DFC(arg2, 1); 40 | if (arg0 != 0xD2) { 41 | func_151F2E4C(10, 11000); 42 | } else { 43 | func_151F2E4C(0, 0); 44 | } 45 | func_151F2960(temp_v0, sp18); 46 | } 47 | } 48 | 49 | void func_100126E8(s32 arg0, s32 arg1) { 50 | func_15043CA4(&D_800427A0, arg0, arg1); 51 | } 52 | 53 | s32 func_10012718(u16 arg0, struct127 *arg1, s32 arg2, s16 arg3, u16 arg4) { 54 | s32 sp3C; 55 | s32 sp38; 56 | s32 sp34; 57 | 58 | if (arg1->camera != 0) { 59 | func_1001263C(arg0, arg2, 64); 60 | } else { 61 | func_100114D0(arg1->x_position, arg1->y_position, arg1->z_position, arg2, arg4, arg3, &sp3C, &sp38, &sp34); 62 | func_1001263C(arg0, sp38, sp3C); 63 | } 64 | return 1; 65 | } 66 | 67 | s32 func_100127D0(void) { 68 | s32 tmp = func_151F2CDC(); 69 | 70 | if (tmp == 1 || tmp == 2 || tmp == 5) { 71 | return 1; 72 | } 73 | return 0; 74 | } 75 | -------------------------------------------------------------------------------- /conker/src/init_1E480.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void n_alSynDelete(void) { 8 | D_8002BA44->unk0 = 0; 9 | } 10 | -------------------------------------------------------------------------------- /conker/src/init_1E4A0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | s32 func_1001E4A0(s16 arg0, s32 arg1, s32 arg2) { 8 | n_alFxNew(&D_8002BA44->unk48[arg0].unk20, arg1, arg0, arg2); 9 | return D_8002BA44->unk48[arg0].unk20; 10 | } 11 | -------------------------------------------------------------------------------- /conker/src/init_2070.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | s32 func_10002070(s32 arg0, s32 arg1, s32 arg2) { 8 | return 1; 9 | } 10 | 11 | #pragma GLOBAL_ASM("asm/nonmatchings/init_2070/func_10002088.s") 12 | // NOT MATCHING: stack is incorrect 13 | // void func_10002088(s32 arg0, s32 arg1, s32 arg2, s32 arg3) { 14 | // D_80035500 = 0; 15 | // func_100020D0(func_10002070, 0, arg1, &arg1); 16 | // } 17 | 18 | // this is a beast: 19 | #pragma GLOBAL_ASM("asm/nonmatchings/init_2070/func_100020D0.s") 20 | 21 | // contains a jump table 22 | #pragma GLOBAL_ASM("asm/nonmatchings/init_2070/func_10002718.s") 23 | -------------------------------------------------------------------------------- /conker/src/init_210C0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | #pragma GLOBAL_ASM("asm/nonmatchings/init_210C0/func_100210C0.s") 8 | -------------------------------------------------------------------------------- /conker/src/init_22460.c: -------------------------------------------------------------------------------- 1 | #include "n_synthInternals.h" 2 | 3 | 4 | // modified n_alResamplePull 5 | #pragma GLOBAL_ASM("asm/nonmatchings/init_22460/func_10022460.s") 6 | // NON-MATCHING: same issues as the other functions in this range 7 | // struct21 *func_10022460(struct42 *arg0, struct119 *arg1, struct21 *arg2) { 8 | // struct21 *sp34; 9 | // s16 sp32; 10 | // s32 sp2C; 11 | // s32 sp28; 12 | // f32 sp24; 13 | // struct21 *sp20; 14 | // struct21 *sp1C; 15 | // 16 | // sp34 = arg2; 17 | // sp32 = 368; // 0x170; 18 | // if (arg0->unk50 != 0) { 19 | // sp34 = func_100214F0(arg0, &sp32, 0xB8, arg2); 20 | // sp20 = sp34 = &sp34->unk8; 21 | // sp20->unk0 = (sp32 & 0xFFFFFF) | 0xA000000; 22 | // sp20->unk4 = ((((s32 )arg1 & 0xFFFF) << 16) | 368); 23 | // } else { 24 | // if (D_8002C840 < (f64) arg0->unk4C) { 25 | // arg0->unk4C = D_8002C848; 26 | // } 27 | // arg0->unk4C = (s32) (arg0->unk4C * 32768.0f); 28 | // arg0->unk4C /= 32768.0f; 29 | // sp24 = arg0->unk54 + (arg0->unk4C * 184.0f); 30 | // sp2C = sp24; 31 | // arg0->unk54 = (sp24 - sp2C); 32 | // sp34 = func_100214F0(arg0, &sp32, sp2C, arg2); 33 | // sp28 = arg0->unk4C * 32768.0f; 34 | // 35 | // sp1C = sp34 = &sp34->unk8; 36 | // sp1C->unk0 = ((osVirtualToPhysical(arg0->unk48) & 0xFFFFFF) | 0x5000000); 37 | // sp1C->unk4 = (((arg0->unk58 & 3) << 30) | ((sp28 & 0xFFFF) << 14) | ((sp32 & 0xFFF) * 4)); 38 | // arg0->unk58 = 0; 39 | // } 40 | // return sp34; 41 | // } 42 | -------------------------------------------------------------------------------- /conker/src/init_2E50.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | extern void (*jtbl_8002C080[])(void); 8 | #pragma GLOBAL_ASM("asm/nonmatchings/init_2E50/func_10002E50.s") 9 | // NON-MATCHING: lots to figure out 10 | // void func_10002E50(struct158 *arg0) { 11 | // s32 phi_s0; 12 | // struct188 tmp; 13 | // 14 | // tmp.unk8 = NULL; 15 | // 16 | // do { 17 | // osRecvMesg(arg0->unk8, &tmp.unk8, 1); 18 | // switch (tmp.unk8->unk0 - 0xA) { 19 | // case 7: 20 | // // TODO: figure this out from the asm 21 | // osStopThread(0); 22 | // osRecvMesg(arg0->unk10, &tmp, 1); 23 | // phi_s0 = 0; 24 | // break; 25 | // case 1: 26 | // jtbl_8002C080[tmp.unk8->unk0 - 0xA](); 27 | // break; 28 | // case 2: 29 | // osRecvMesg(arg0->unk10, &tmp, 1); 30 | // phi_s0 = arg0->unk14(1, &tmp.unk8->unkC, &tmp.unk8->unk8, &tmp.unk8->unk10); 31 | // break; 32 | // case 5: 33 | // osRecvMesg(arg0->unk10, &tmp, 1); 34 | // phi_s0 = arg0->unk18(&tmp.unk8->unk14, 0, &tmp.unk8->unkC, &tmp.unk8->unk8, &tmp.unk8->unk10); 35 | // break; 36 | // case 6: 37 | // osRecvMesg(arg0->unk10, &tmp, 1); 38 | // phi_s0 = arg0->unk18(&tmp.unk8->unk14, 1, &tmp.unk8->unkC, &tmp.unk8->unk8, &tmp.unk8->unk10); 39 | // break; 40 | // case 0: 41 | // osSendMesg(tmp.unk8->unk4, tmp.unk8, 0); 42 | // phi_s0 = -1; 43 | // break; 44 | // default: 45 | // phi_s0 = -1; 46 | // } 47 | // if (phi_s0 != 0) { 48 | // continue; 49 | // } 50 | // osRecvMesg(arg0->unkC, &tmp.unk4, 1); 51 | // osSendMesg(tmp.unk8->unk4, tmp.unk8, 0); 52 | // osSendMesg(arg0->unk10, 0, 0); 53 | // if (tmp.unk8->unk0 != 0xB) { 54 | // continue; 55 | // } 56 | // D_8003A573 = (u8)0; 57 | // } while (1); 58 | // } 59 | -------------------------------------------------------------------------------- /conker/src/init_38C0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_100038C0(s32 arg0, s32 arg1, s32 arg2, s32 arg3) { 8 | s32 dummy; 9 | if (dummy) {}; 10 | } 11 | -------------------------------------------------------------------------------- /conker/src/init_38E0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | #pragma GLOBAL_ASM("asm/nonmatchings/init_38E0/func_100038E0.s") 8 | // NON-MATCHING: wtf is this 9 | // s32 func_100038E0(void) { 10 | // D_80038070 = 0xBC000C02; // -0.007815362885594368 ? 11 | // D_80038074 = (u16)0x4040; 12 | // D_BC000C02 = (u16)0x4040; 13 | // return 0xBC000C02; 14 | // } 15 | 16 | s32 func_1000390C(void) { 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /conker/src/init_3920.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_10003920(void) { 8 | D_80038080 = 0; 9 | } 10 | -------------------------------------------------------------------------------- /conker/src/init_3930.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | void func_10003930(void) { 7 | if (D_80038080) { 8 | D_80038090 = 0x807F5000; 9 | D_80038094 = 0x807FE000; 10 | D_8003809C = 0x807FE000; 11 | D_80038098 = 0x807F5000; 12 | } else { 13 | D_80038090 = 0x803F5000; 14 | D_80038094 = 0x803FE000; 15 | D_8003809C = 0x803FE000; 16 | D_80038098 = 0x803F5000; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /conker/src/init_39B0.c: -------------------------------------------------------------------------------- 1 | void func_100039B0(void) { 2 | } 3 | -------------------------------------------------------------------------------- /conker/src/init_39C0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_100039C0(void) { 8 | OSViMode *mode; 9 | 10 | D_800BE620 = 292; // screen width px 11 | D_800BE624 = 216; // screen height px 12 | D_800380A0 = (f32) D_800BE620 / 292.0f; 13 | D_800380A4 = (f32) D_800BE624 / 216.0f; 14 | D_800BE9C4 = allocate_memory(D_800BE620 * D_800BE624 * 2, 255, 3, 0); 15 | func_10003ACC(0, 0, 0); 16 | func_15015FBC(D_800BE620, D_800BE624); 17 | if (D_80000300 == 2) { 18 | mode = &D_8002ABE0; 19 | } else { 20 | mode = &D_8002AB90; 21 | } 22 | osViSetMode(mode); 23 | osViSwapBuffer((void *)D_8002AAE8[D_800BE9C0 ^ 1]); 24 | } 25 | 26 | #pragma GLOBAL_ASM("asm/nonmatchings/init_39C0/func_10003ACC.s") 27 | -------------------------------------------------------------------------------- /conker/src/init_3BD0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | // NON-MATCHING: who knows what this is.. 8 | #pragma GLOBAL_ASM("asm/nonmatchings/init_3BD0/func_10003BD0.s") 9 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/cents2ratio.c: -------------------------------------------------------------------------------- 1 | /* 2 | * alCents2Ratio() 3 | * 4 | * Calculates the pitch shift ratio from the number of cents according to 5 | * ratio = 2^(cents/1200) 6 | * 7 | * This is accurate to within one cent for ratios up an octave and down 8 | * two ocataves. 9 | */ 10 | 11 | #include 12 | 13 | 14 | f32 alCents2Ratio(s32 cents) { 15 | f32 x; 16 | f32 ratio = 1.0f; 17 | 18 | if (cents >= 0) { 19 | x = 1.0005778074264526f; /* 2^(1/1200) */ 20 | } else { 21 | x = 0.999422550201416f; /* 2^(-1/1200) */ 22 | cents = -cents; 23 | } 24 | while (cents) { 25 | if (cents & 1) { 26 | ratio *= x; 27 | } 28 | x *= x; 29 | cents >>= 1; 30 | } 31 | return ratio; 32 | } 33 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/code_17AA0.c: -------------------------------------------------------------------------------- 1 | #include "n_libaudio.h" 2 | 3 | 4 | // this was the very first function to be successfully translated to C 5 | 6 | // n_alSeqpPlay or n_alCSPPlay? 7 | void func_10017AA0(N_ALCSPlayer *seqp) 8 | { 9 | N_ALEvent evt; 10 | evt.type = AL_SEQP_PLAY_EVT; 11 | 12 | n_alEvtqPostEvent(&seqp->evtq, &evt, 0, 2); 13 | } 14 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/code_17D80.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "n_libaudio.h" 3 | 4 | void func_10017D80(N_ALCSPlayer *seqp, u8 chan, u8 prog) 5 | { 6 | N_ALEvent evt; 7 | 8 | evt.type = AL_SEQP_MIDI_EVT; 9 | evt.msg.midi.ticks = 0; 10 | evt.msg.midi.status = AL_MIDI_ControlChange | chan; // AL_MIDI_ChannelModeSelect? 11 | evt.msg.midi.byte1 = 10; 12 | evt.msg.midi.byte2 = prog; 13 | 14 | n_alEvtqPostEvent(&seqp->evtq, &evt, 0, 2); 15 | } 16 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/code_18C60.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "n_libaudio.h" 3 | #include "n_seqp.h" 4 | 5 | 6 | void func_10018C60(N_ALSeqPlayer *seqp) { 7 | N_ALEvent evt; 8 | 9 | evt.type = AL_TRACK_END; 10 | n_alEvtqPostEvent(&seqp->evtq, &evt, 0, 2); 11 | } 12 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/code_18CB0.c: -------------------------------------------------------------------------------- 1 | /*==================================================================== 2 | * 3 | * Copyright 1993, Silicon Graphics, Inc. 4 | * All Rights Reserved. 5 | * 6 | * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, 7 | * Inc.; the contents of this file may not be disclosed to third 8 | * parties, copied or duplicated in any form, in whole or in part, 9 | * without the prior written permission of Silicon Graphics, Inc. 10 | * 11 | * RESTRICTED RIGHTS LEGEND: 12 | * Use, duplication or disclosure by the Government is subject to 13 | * restrictions as set forth in subdivision (c)(1)(ii) of the Rights 14 | * in Technical Data and Computer Software clause at DFARS 15 | * 252.227-7013, and/or in similar or successor clauses in the FAR, 16 | * DOD or NASA FAR Supplement. Unpublished - rights reserved under the 17 | * Copyright Laws of the United States. 18 | *====================================================================*/ 19 | 20 | 21 | #include 22 | #include "n_libaudio.h" 23 | 24 | 25 | void func_10018CB0(N_ALCSPlayer *seqp, ALCSeq *seq) 26 | { 27 | N_ALEvent evt; 28 | 29 | evt.type = AL_SEQP_SEQ_EVT; 30 | evt.msg.spseq.seq = seq; 31 | 32 | n_alEvtqPostEvent(&seqp->evtq, &evt, 0, 2); 33 | } 34 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/cseq.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #ifndef __cseq__ 5 | #define __cseq__ 6 | 7 | 8 | char __alCSeqNextDelta(ALCSeq *seq, s32 *pDeltaTicks); 9 | 10 | 11 | #endif /* __cseq__ */ 12 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/init_17870.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | void func_10017870(u8 arg0) { 8 | s32 i; 9 | 10 | D_800428C0 = (u8)0; 11 | D_800428C1 = (u8)0; 12 | D_800428C2 = (u8)0; 13 | 14 | switch (arg0) { 15 | 16 | case 1: 17 | D_800428C1 = (u8)1; 18 | break; 19 | case 3: 20 | D_800428C2 = (u8)1; 21 | break; 22 | case 4: 23 | D_800428C0 = (u8)1; 24 | break; 25 | } 26 | 27 | for(i = 0; i < 2; i++) { 28 | func_10017944(i, 0); 29 | } 30 | } 31 | 32 | void func_10017944(s32 arg0, u32 arg1) { 33 | if (arg1 == 0) { 34 | arg1 = D_800428C8[arg0]; 35 | } 36 | 37 | D_800428C4[arg0] = 0; 38 | D_800428C6[arg0] = 0; 39 | 40 | switch (arg1) 41 | { 42 | case 2: 43 | if (D_800428C0 != 0) { 44 | D_800428C6[arg0] = 1; 45 | } 46 | break; 47 | case 3: 48 | if (D_800428C0 != 0) { 49 | D_800428C4[arg0] = 1; 50 | } 51 | break; 52 | case 4: 53 | if (D_800428C1 == 0) { 54 | D_800428C4[arg0] = 1; 55 | } 56 | break; 57 | case 5: 58 | if (D_800428C1 == 0) { 59 | D_800428C4[arg0] = 1; 60 | D_800428C6[arg0] = 1; 61 | } 62 | break; 63 | } 64 | 65 | D_800428C8[arg0] = arg1; 66 | } 67 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/init_17A80.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // get_csp_state 4 | s32 func_10017A80(N_ALCSPlayer *seqp) { 5 | return seqp->state; 6 | } 7 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/init_17AF0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | void func_10017AF0(N_ALCSPlayer *seqp, s32 arg1) { 5 | seqp->unk84 = arg1; 6 | } 7 | 8 | void func_10017B04(N_ALCSPlayer *seqp, s32 chan, u8 arg2) { 9 | seqp->chanState[chan].unk17 = arg2; 10 | } 11 | 12 | void func_10017B30(N_ALCSPlayer *seqp) { 13 | s32 chan; 14 | 15 | seqp->chanMask = 0xFFFF; 16 | for (chan = 0; chan < seqp->maxChannels; chan++) 17 | { 18 | seqp->chanState[chan].unkE = 0xFF; 19 | seqp->chanState[chan].unkD = 0xFF; 20 | } 21 | } 22 | 23 | void func_10017BB8(N_ALCSPlayer *seqp, s32 arg1) { 24 | func_1001E400(seqp, 0, arg1 | 0xB0, 252, 0); 25 | } 26 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/init_17C00.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | void func_10017C00(N_ALCSPlayer *seqp, s32 arg1) { 5 | seqp->chanMask |= 1 << arg1; 6 | func_1001E400(seqp, 0, arg1 | 0xB0, 0xFC, 0xFF); 7 | } 8 | 9 | void func_10017C68(N_ALCSPlayer *seqp, s32 arg1, u8 arg2, u8 arg3) { 10 | func_1001E400(seqp, 0, arg1 | 0xB0, 0xFD, arg3); 11 | func_1001E400(seqp, 0, arg1 | 0xB0, 0xFF, arg2); 12 | } 13 | 14 | void func_10017CE0(N_ALCSPlayer *seqp, s32 arg1, u8 arg2) { 15 | func_1001E400(seqp, 0, arg1 | 0xB0, 0x41, arg2); 16 | } 17 | 18 | void func_10017D30(N_ALCSPlayer *seqp, s32 arg1, u8 arg2) { 19 | func_1001E400(seqp, 0, arg1 | 0xB0, 0xFC, arg2); 20 | } 21 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/init_17DF0.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | void func_10017DF0(N_ALCSPlayer *csp, f32 arg1, f32 arg2) { 5 | N_ALEvent event; 6 | 7 | event.type = 25; 8 | event.msg.unknown0.unk0 = arg1; 9 | event.msg.unknown0.unk4 = arg2; 10 | 11 | n_alEvtqPostEvent(&csp->evtq, &event, 0, 2); 12 | } 13 | 14 | void func_10017E4C(N_ALCSPlayer *csp, u8 chan, u8 arg2) { 15 | N_ALEvent event; 16 | 17 | event.type = 2; // AL_SEQP_MIDI_EVT ? 18 | /* likely a custom event */ 19 | event.msg.midi.ticks = 0; 20 | event.msg.midi.status = chan | 0xB0; 21 | event.msg.midi.byte1 = 92; 22 | event.msg.midi.byte2 = arg2; 23 | 24 | n_alEvtqPostEvent(&csp->evtq, &event, 0, 2); 25 | } 26 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/init_17F10.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | void func_10017F10(N_ALCSPlayer *seqp, u8 arg1, u8 arg2, u8 arg3, s32 arg4) { 5 | 6 | N_ALEvent evt; 7 | evt.type = 0x1A; 8 | evt.msg.unknown2.unk0 = arg1; 9 | evt.msg.unknown2.unk1 = arg2; 10 | evt.msg.unknown2.unk2 = arg3; 11 | evt.msg.unknown2.unk4 = arg4; 12 | 13 | n_alEvtqPostEvent(&seqp->evtq, &evt, 0, 2); 14 | } 15 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/init_18D00.c: -------------------------------------------------------------------------------- 1 | #include "n_libaudio.h" 2 | 3 | 4 | void func_10018D00(N_ALCSPlayer *seqp, s16 vol) 5 | { 6 | N_ALEvent evt; 7 | 8 | evt.type = AL_SEQP_VOL_EVT; 9 | evt.msg.spvol.vol = vol; 10 | 11 | n_alEvtqPostEvent(&seqp->evtq, &evt, 0, 2); 12 | } 13 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/init_18D50.c: -------------------------------------------------------------------------------- 1 | #include "n_libaudio.h" 2 | 3 | 4 | void func_10018D50(N_ALCSPlayer *seqp) 5 | { 6 | N_ALEvent evt; 7 | 8 | evt.type = AL_SEQP_STOP_EVT; 9 | 10 | n_alEvtqPostEvent(&seqp->evtq, &evt, 0, 2); 11 | } 12 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/init_1D900.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "n_synthInternals.h" 4 | 5 | 6 | void func_1001CF38(s32, f32); 7 | extern Acmd *(func_1001E530)(s32, Acmd *); 8 | 9 | 10 | void n_alSynSetFXMix( N_ALVoice *v, u8 fxmix) { 11 | ALParam *update; 12 | 13 | if (v->pvoice) { 14 | update = __n_allocParam(); 15 | ALFailIf(update == 0, ERR_ALSYN_NO_UPDATE); 16 | 17 | update->delta = n_syn->paramSamples + v->pvoice->offset; 18 | update->type = AL_FILTER_SET_FXAMT; 19 | update->data.i = fxmix; 20 | update->next = 0; 21 | n_alEnvmixerParam(v->pvoice, AL_FILTER_ADD_UPDATE, update); 22 | } 23 | } 24 | 25 | s32 func_1001D9B0(s16 arg0) { 26 | N_ALMainBus *sp4; 27 | 28 | sp4 = n_syn->mainBus; 29 | if (sp4->filter.handler == func_1001E530) { 30 | return n_syn->auxBus[arg0].sources; 31 | } else { 32 | return 0; 33 | } 34 | } 35 | 36 | // this is not right. 37 | #pragma GLOBAL_ASM("asm/nonmatchings/libultra/audio/init_1D900/func_1001DA28.s") 38 | // s32 func_1001DA28(s16 arg0) { 39 | // N_ALMainBus *sp4; 40 | // 41 | // sp4 = n_syn->mainBus; 42 | // if (sp4->filter.handler == func_1001E530) { 43 | // return n_syn->auxBus[arg0].sources; 44 | // } else { 45 | // return 0; 46 | // } 47 | // } 48 | 49 | void func_1001DAA0(s32 arg0, s16 arg1, s32 arg2) { 50 | s32 sp1C = arg0; 51 | func_1001ED6C(sp1C, arg1, arg2); 52 | } 53 | 54 | // probably not right but... 55 | void func_1001DAE4(ALVoiceConfig *arg0, s16 arg1, s32 *arg2) { 56 | if (arg1 == 8) { 57 | arg0->fxBus = (f32) *arg2 * 0.1f; 58 | } else if (arg1 == 9) { 59 | arg0->priority = *arg2; 60 | } 61 | func_1001CF38(arg0, n_syn->outputRate); 62 | } 63 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/init_1E2A0.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "n_synthInternals.h" 4 | 5 | // n_alSynSetPan 6 | void func_1001E2A0(N_ALVoice *v, u8 pan) { 7 | ALParam *update; 8 | 9 | if (v->pvoice) { 10 | update = __n_allocParam(); 11 | ALFailIf(update == 0, ERR_ALSYN_NO_UPDATE); 12 | 13 | update->delta = n_syn->paramSamples + v->pvoice->offset; 14 | update->type = AL_FILTER_SET_PAN; 15 | update->data.i = pan; 16 | update->next = 0; 17 | n_alEnvmixerParam(v->pvoice, AL_FILTER_ADD_UPDATE, update); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/init_1E350.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "n_synthInternals.h" 4 | 5 | 6 | void func_1001E350(N_ALVoice *v, u8 fxmix) { 7 | ALParam *update; 8 | 9 | if (v->pvoice) { 10 | update = __n_allocParam(); 11 | ALFailIf(update == 0, ERR_ALSYN_NO_UPDATE); 12 | 13 | update->delta = n_syn->paramSamples + v->pvoice->offset; 14 | update->type = 17; 15 | update->data.i = fxmix; 16 | update->next = 0; 17 | n_alEnvmixerParam(v->pvoice, AL_FILTER_ADD_UPDATE, update); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/init_1E400.c: -------------------------------------------------------------------------------- 1 | #include "n_synthInternals.h" 2 | 3 | 4 | // non-vanilla n_alCSPSendMidi or n_alSeqpSendMidi 5 | void func_1001E400(N_ALCSPlayer *seqp, s32 deltaTime, u8 status, u8 byte1, u8 byte2) { 6 | N_ALEvent evt; 7 | ALMicroTime delta; 8 | 9 | evt.type = AL_SEQP_MIDI_EVT; 10 | evt.msg.midi.ticks = 0; 11 | evt.msg.midi.status = status; 12 | evt.msg.midi.byte1 = byte1; 13 | evt.msg.midi.byte2 = byte2; 14 | evt.msg.midi.duration = 0; 15 | 16 | delta = deltaTime; 17 | n_alEvtqPostEvent(&seqp->evtq, &evt, delta, 2); 18 | } 19 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/n_cseqnextdelta.c: -------------------------------------------------------------------------------- 1 | /*==================================================================== 2 | * cseq.c 3 | * 4 | * Copyright 1993, Silicon Graphics, Inc. 5 | * All Rights Reserved. 6 | * 7 | * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, 8 | * Inc.; the contents of this file may not be disclosed to third 9 | * parties, copied or duplicated in any form, in whole or in part, 10 | * without the prior written permission of Silicon Graphics, Inc. 11 | * 12 | * RESTRICTED RIGHTS LEGEND: 13 | * Use, duplication or disclosure by the Government is subject to 14 | * restrictions as set forth in subdivision (c)(1)(ii) of the Rights 15 | * in Technical Data and Computer Software clause at DFARS 16 | * 252.227-7013, and/or in similar or successor clauses in the FAR, 17 | * DOD or NASA FAR Supplement. Unpublished - rights reserved under the 18 | * Copyright Laws of the United States. 19 | *====================================================================*/ 20 | 21 | #include 22 | #include 23 | #include 24 | #include "cseq.h" 25 | 26 | 27 | /* 28 | Note: If there are no valid tracks (ie. all tracks have 29 | reached the end of their data stream), then return FALSE 30 | to indicate that there is no next event. 31 | */ 32 | char __alCSeqNextDelta(ALCSeq *seq, s32 *pDeltaTicks) 33 | { 34 | u32 i; 35 | u32 firstTime = 0xFFFFFFFF; 36 | u32 lastTicks = seq->lastDeltaTicks; 37 | 38 | if (!seq->validTracks) 39 | return FALSE; 40 | 41 | for(i = 0; i < 16 ; i++) 42 | { 43 | if((seq->validTracks >> i) & 1) 44 | { 45 | if(seq->deltaFlag) 46 | seq->evtDeltaTicks[i] -= lastTicks; 47 | 48 | if(seq->evtDeltaTicks[i] < firstTime) 49 | firstTime = seq->evtDeltaTicks[i]; 50 | } 51 | } 52 | 53 | seq->deltaFlag = 0; 54 | *pDeltaTicks = firstTime; 55 | 56 | return TRUE; 57 | } 58 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/n_cseqp.h: -------------------------------------------------------------------------------- 1 | /*==================================================================== 2 | * 3 | * Copyright 1993, Silicon Graphics, Inc. 4 | * All Rights Reserved. 5 | * 6 | * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, 7 | * Inc.; the contents of this file may not be disclosed to third 8 | * parties, copied or duplicated in any form, in whole or in part, 9 | * without the prior written permission of Silicon Graphics, Inc. 10 | * 11 | * RESTRICTED RIGHTS LEGEND: 12 | * Use, duplication or disclosure by the Government is subject to 13 | * restrictions as set forth in subdivision (c)(1)(ii) of the Rights 14 | * in Technical Data and Computer Software clause at DFARS 15 | * 252.227-7013, and/or in similar or successor clauses in the FAR, 16 | * DOD or NASA FAR Supplement. Unpublished - rights reserved under the 17 | * Copyright Laws of the United States. 18 | *====================================================================*/ 19 | 20 | #ifndef __N_CSEQP__ 21 | #define __N_CSEQP__ 22 | 23 | void __n_CSPPostNextSeqEvent(N_ALCSPlayer *seqp); 24 | 25 | 26 | #endif /* __N_CSEQP__ */ 27 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/n_cspgettempo.c: -------------------------------------------------------------------------------- 1 | /*==================================================================== 2 | * 3 | * Copyright 1993, Silicon Graphics, Inc. 4 | * All Rights Reserved. 5 | * 6 | * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, 7 | * Inc.; the contents of this file may not be disclosed to third 8 | * parties, copied or duplicated in any form, in whole or in part, 9 | * without the prior written permission of Silicon Graphics, Inc. 10 | * 11 | * RESTRICTED RIGHTS LEGEND: 12 | * Use, duplication or disclosure by the Government is subject to 13 | * restrictions as set forth in subdivision (c)(1)(ii) of the Rights 14 | * in Technical Data and Computer Software clause at DFARS 15 | * 252.227-7013, and/or in similar or successor clauses in the FAR, 16 | * DOD or NASA FAR Supplement. Unpublished - rights reserved under the 17 | * Copyright Laws of the United States. 18 | *====================================================================*/ 19 | 20 | #include 21 | #include "n_libaudio.h" 22 | 23 | s32 n_alCSPGetTempo(N_ALCSPlayer *seqp) 24 | { 25 | /* sct 1/8/96 - If no target sequence has been set, just return zero (instead of crashing). */ 26 | if (seqp->target == NULL) 27 | return 0; 28 | 29 | return seqp->uspt/seqp->target->qnpt; 30 | } 31 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/n_sl.c: -------------------------------------------------------------------------------- 1 | /*==================================================================== 2 | * 3 | * Copyright 1993, Silicon Graphics, Inc. 4 | * All Rights Reserved. 5 | * 6 | * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, 7 | * Inc.; the contents of this file may not be disclosed to third 8 | * parties, copied or duplicated in any form, in whole or in part, 9 | * without the prior written permission of Silicon Graphics, Inc. 10 | * 11 | * RESTRICTED RIGHTS LEGEND: 12 | * Use, duplication or disclosure by the Government is subject to 13 | * restrictions as set forth in subdivision (c)(1)(ii) of the Rights 14 | * in Technical Data and Computer Software clause at DFARS 15 | * 252.227-7013, and/or in similar or successor clauses in the FAR, 16 | * DOD or NASA FAR Supplement. Unpublished - rights reserved under the 17 | * Copyright Laws of the United States. 18 | *====================================================================*/ 19 | 20 | #include "n_synthInternals.h" 21 | 22 | // FIXME: when we can... 23 | // N_ALGlobals *n_alGlobals=0; 24 | // N_ALSynth *n_syn=0; 25 | 26 | void n_alInit(N_ALGlobals *g, ALSynConfig *c) 27 | { 28 | if (!n_alGlobals) { /* already initialized? */ 29 | n_alGlobals = g; 30 | if(!n_syn) { 31 | n_syn = &n_alGlobals->drvr; 32 | n_alSynNew(c); 33 | } 34 | } 35 | } 36 | 37 | void n_alClose(N_ALGlobals *glob) 38 | { 39 | if (n_alGlobals) { 40 | n_alSynDelete(); 41 | n_alGlobals = 0; 42 | n_syn = 0; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/n_synaddplayer.c: -------------------------------------------------------------------------------- 1 | /*==================================================================== 2 | * 3 | * Copyright 1993, Silicon Graphics, Inc. 4 | * All Rights Reserved. 5 | * 6 | * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, 7 | * Inc.; the contents of this file may not be disclosed to third 8 | * parties, copied or duplicated in any form, in whole or in part, 9 | * without the prior written permission of Silicon Graphics, Inc. 10 | * 11 | * RESTRICTED RIGHTS LEGEND: 12 | * Use, duplication or disclosure by the Government is subject to 13 | * restrictions as set forth in subdivision (c)(1)(ii) of the Rights 14 | * in Technical Data and Computer Software clause at DFARS 15 | * 252.227-7013, and/or in similar or successor clauses in the FAR, 16 | * DOD or NASA FAR Supplement. Unpublished - rights reserved under the 17 | * Copyright Laws of the United States. 18 | *====================================================================*/ 19 | #include 20 | #include "n_synthInternals.h" 21 | 22 | 23 | void n_alSynAddPlayer(ALPlayer *client) 24 | { 25 | OSIntMask mask = osSetIntMask(OS_IM_NONE); 26 | 27 | client->samplesLeft = n_syn->curSamples; 28 | 29 | client->next = n_syn->head; 30 | n_syn->head = client; 31 | 32 | osSetIntMask(mask); 33 | } 34 | 35 | void n_alSynAddSndPlayer(ALPlayer *client) 36 | { 37 | OSIntMask mask = osSetIntMask(OS_IM_NONE); 38 | 39 | client->samplesLeft = n_syn->curSamples; 40 | 41 | #if 1 42 | client->next = n_syn->head; 43 | n_syn->head = client; 44 | #endif 45 | 46 | #if 0 47 | if(!(n_syn->n_sndp)) 48 | n_syn->n_sndp = client; 49 | #endif 50 | 51 | osSetIntMask(mask); 52 | } 53 | 54 | #if 0 55 | void n_alSynAddSeqPlayer( ALPlayer *client) 56 | { 57 | OSIntMask mask = osSetIntMask(OS_IM_NONE); 58 | 59 | client->samplesLeft = n_syn->curSamples; 60 | 61 | #if 1 62 | client->next = n_syn->head; 63 | n_syn->head = client; 64 | #endif 65 | 66 | if( !(n_syn->n_seqp1) ) 67 | n_syn->n_seqp1 = client; 68 | else if( !(n_syn->n_seqp2) ) 69 | n_syn->n_seqp2 = client; 70 | 71 | osSetIntMask(mask); 72 | } 73 | #endif 74 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/n_synfreevoice.c: -------------------------------------------------------------------------------- 1 | /*==================================================================== 2 | * 3 | * Copyright 1993, Silicon Graphics, Inc. 4 | * All Rights Reserved. 5 | * 6 | * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, 7 | * Inc.; the contents of this file may not be disclosed to third 8 | * parties, copied or duplicated in any form, in whole or in part, 9 | * without the prior written permission of Silicon Graphics, Inc. 10 | * 11 | * RESTRICTED RIGHTS LEGEND: 12 | * Use, duplication or disclosure by the Government is subject to 13 | * restrictions as set forth in subdivision (c)(1)(ii) of the Rights 14 | * in Technical Data and Computer Software clause at DFARS 15 | * 252.227-7013, and/or in similar or successor clauses in the FAR, 16 | * DOD or NASA FAR Supplement. Unpublished - rights reserved under the 17 | * Copyright Laws of the United States. 18 | *====================================================================*/ 19 | #include 20 | #include 21 | 22 | #include 23 | #include "n_synthInternals.h" 24 | 25 | 26 | void n_alSynFreeVoice( N_ALVoice *voice) 27 | { 28 | N_ALFreeParam *update; 29 | 30 | if (voice->pvoice) { 31 | if (voice->pvoice->offset) { /* if voice was stolen */ 32 | update = (N_ALFreeParam *)__n_allocParam(); 33 | ALFailIf(update == 0, ERR_ALSYN_NO_UPDATE); 34 | 35 | /* 36 | * set voice data 37 | */ 38 | #ifdef SAMPLE_ROUND 39 | update->delta = SAMPLE184( n_syn->paramSamples + voice->pvoice->offset); 40 | #else 41 | update->delta = n_syn->paramSamples + voice->pvoice->offset; 42 | #endif 43 | update->type = AL_FILTER_FREE_VOICE; 44 | update->pvoice = voice->pvoice; 45 | 46 | n_alEnvmixerParam(voice->pvoice, AL_FILTER_ADD_UPDATE, update); 47 | } else { 48 | _n_freePVoice( voice->pvoice); 49 | } 50 | voice->pvoice = 0; 51 | } 52 | if (voice->unk14 != 0) { 53 | n_syn->dma(voice->unk14); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/n_synsetpan.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "n_synthInternals.h" 4 | 5 | 6 | /* NOTE: might not actually be pan! */ 7 | void n_alSynSetPan( N_ALVoice *v, u8 pan) 8 | { 9 | ALParam *update; 10 | 11 | if (v->pvoice) { 12 | 13 | /* 14 | * get new update struct from the free list 15 | */ 16 | update = __n_allocParam(); 17 | ALFailIf(update == 0, ERR_ALSYN_NO_UPDATE); 18 | 19 | /* 20 | * set offset and pan data 21 | */ 22 | #ifdef SAMPLE_ROUND 23 | update->delta = SAMPLE184( n_syn->paramSamples + v->pvoice->offset); 24 | #else 25 | update->delta = n_syn->paramSamples + v->pvoice->offset; 26 | #endif 27 | update->type = 18; /* custom */ 28 | update->data.i = pan; 29 | update->next = 0; 30 | 31 | n_alEnvmixerParam(v->pvoice, AL_FILTER_ADD_UPDATE, update); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/n_synsetpitch.c: -------------------------------------------------------------------------------- 1 | /*==================================================================== 2 | * 3 | * Copyright 1993, Silicon Graphics, Inc. 4 | * All Rights Reserved. 5 | * 6 | * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, 7 | * Inc.; the contents of this file may not be disclosed to third 8 | * parties, copied or duplicated in any form, in whole or in part, 9 | * without the prior written permission of Silicon Graphics, Inc. 10 | * 11 | * RESTRICTED RIGHTS LEGEND: 12 | * Use, duplication or disclosure by the Government is subject to 13 | * restrictions as set forth in subdivision (c)(1)(ii) of the Rights 14 | * in Technical Data and Computer Software clause at DFARS 15 | * 252.227-7013, and/or in similar or successor clauses in the FAR, 16 | * DOD or NASA FAR Supplement. Unpublished - rights reserved under the 17 | * Copyright Laws of the United States. 18 | *====================================================================*/ 19 | 20 | #include 21 | #include 22 | #include "n_synthInternals.h" 23 | 24 | void n_alSynSetPitch( N_ALVoice *v, f32 pitch) 25 | { 26 | ALParam *update; 27 | 28 | if (v->pvoice) { 29 | /* 30 | * get new update struct from the free list 31 | */ 32 | 33 | update = __n_allocParam(); 34 | ALFailIf(update == 0, ERR_ALSYN_NO_UPDATE); 35 | 36 | /* 37 | * set offset and pitch data 38 | */ 39 | #ifdef SAMPLE_ROUND 40 | update->delta = SAMPLE184( n_syn->paramSamples + v->pvoice->offset); 41 | #else 42 | update->delta = n_syn->paramSamples + v->pvoice->offset; 43 | #endif 44 | update->type = AL_FILTER_SET_PITCH; 45 | update->data.f = pitch; 46 | update->next = 0; 47 | 48 | n_alEnvmixerParam(v->pvoice, AL_FILTER_ADD_UPDATE, update); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/n_synsetpitch2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "n_synthInternals.h" 4 | 5 | 6 | // set pitch 2 ? 7 | void func_1001CA90( N_ALVoice *v, f32 pitch) { 8 | ALParam *update; 9 | 10 | if (v->pvoice) { 11 | /* 12 | * get new update struct from the free list 13 | */ 14 | 15 | update = __n_allocParam(); 16 | ALFailIf(update == 0, ERR_ALSYN_NO_UPDATE); 17 | 18 | /* 19 | * set offset and pitch data 20 | */ 21 | #ifdef SAMPLE_ROUND 22 | update->delta = SAMPLE184( n_syn->paramSamples + v->pvoice->offset); 23 | #else 24 | update->delta = n_syn->paramSamples + v->pvoice->offset; 25 | #endif 26 | update->type = 19; 27 | update->data.f = pitch; 28 | update->next = 0; 29 | 30 | n_alEnvmixerParam(v->pvoice, AL_FILTER_ADD_UPDATE, update); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/n_synsetpriority.c: -------------------------------------------------------------------------------- 1 | /*==================================================================== 2 | * 3 | * Copyright 1993, Silicon Graphics, Inc. 4 | * All Rights Reserved. 5 | * 6 | * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, 7 | * Inc.; the contents of this file may not be disclosed to third 8 | * parties, copied or duplicated in any form, in whole or in part, 9 | * without the prior written permission of Silicon Graphics, Inc. 10 | * 11 | * RESTRICTED RIGHTS LEGEND: 12 | * Use, duplication or disclosure by the Government is subject to 13 | * restrictions as set forth in subdivision (c)(1)(ii) of the Rights 14 | * in Technical Data and Computer Software clause at DFARS 15 | * 252.227-7013, and/or in similar or successor clauses in the FAR, 16 | * DOD or NASA FAR Supplement. Unpublished - rights reserved under the 17 | * Copyright Laws of the United States. 18 | *====================================================================*/ 19 | 20 | #include "n_synthInternals.h" 21 | 22 | void n_alSynSetPriority( N_ALVoice *voice, s16 priority) 23 | { 24 | voice->priority = priority; 25 | } 26 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/n_synsetvol.c: -------------------------------------------------------------------------------- 1 | /*==================================================================== 2 | * 3 | * Copyright 1993, Silicon Graphics, Inc. 4 | * All Rights Reserved. 5 | * 6 | * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, 7 | * Inc.; the contents of this file may not be disclosed to third 8 | * parties, copied or duplicated in any form, in whole or in part, 9 | * without the prior written permission of Silicon Graphics, Inc. 10 | * 11 | * RESTRICTED RIGHTS LEGEND: 12 | * Use, duplication or disclosure by the Government is subject to 13 | * restrictions as set forth in subdivision (c)(1)(ii) of the Rights 14 | * in Technical Data and Computer Software clause at DFARS 15 | * 252.227-7013, and/or in similar or successor clauses in the FAR, 16 | * DOD or NASA FAR Supplement. Unpublished - rights reserved under the 17 | * Copyright Laws of the United States. 18 | *====================================================================*/ 19 | 20 | #include 21 | #include 22 | #include "n_synthInternals.h" 23 | 24 | void n_alSynSetVol( N_ALVoice *v, s16 volume, ALMicroTime t) 25 | { 26 | ALParam *update; 27 | ALFilter *f; 28 | 29 | if (v->pvoice) { 30 | /* 31 | * get new update struct from the free list 32 | */ 33 | update = __n_allocParam(); 34 | ALFailIf(update == 0, ERR_ALSYN_NO_UPDATE); 35 | 36 | /* 37 | * set offset and volume data 38 | */ 39 | #ifdef SAMPLE_ROUND 40 | update->delta = SAMPLE184( n_syn->paramSamples + v->pvoice->offset); 41 | #else 42 | update->delta = n_syn->paramSamples + v->pvoice->offset; 43 | #endif 44 | update->type = AL_FILTER_SET_VOLUME; 45 | update->data.i = volume; 46 | 47 | #ifdef SAMPLE_ROUND 48 | update->moredata.i = SAMPLE184( _n_timeToSamples( t) ); 49 | #else 50 | update->moredata.i = _n_timeToSamples( t); 51 | #endif 52 | update->next = 0; 53 | 54 | n_alEnvmixerParam(v->pvoice, AL_FILTER_ADD_UPDATE, update); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /conker/src/libultra/audio/n_synstopvoice.c: -------------------------------------------------------------------------------- 1 | /*==================================================================== 2 | * 3 | * Copyright 1993, Silicon Graphics, Inc. 4 | * All Rights Reserved. 5 | * 6 | * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, 7 | * Inc.; the contents of this file may not be disclosed to third 8 | * parties, copied or duplicated in any form, in whole or in part, 9 | * without the prior written permission of Silicon Graphics, Inc. 10 | * 11 | * RESTRICTED RIGHTS LEGEND: 12 | * Use, duplication or disclosure by the Government is subject to 13 | * restrictions as set forth in subdivision (c)(1)(ii) of the Rights 14 | * in Technical Data and Computer Software clause at DFARS 15 | * 252.227-7013, and/or in similar or successor clauses in the FAR, 16 | * DOD or NASA FAR Supplement. Unpublished - rights reserved under the 17 | * Copyright Laws of the United States. 18 | *====================================================================*/ 19 | 20 | #include 21 | #include 22 | #include "n_synthInternals.h" 23 | 24 | 25 | void n_alSynStopVoice(N_ALVoice *v) 26 | { 27 | ALParam *update; 28 | ALFilter *f; 29 | 30 | if (v->pvoice) { 31 | 32 | update = __n_allocParam(); 33 | ALFailIf(update == 0, ERR_ALSYN_NO_UPDATE); 34 | 35 | #ifdef SAMPLE_ROUND 36 | update->delta = SAMPLE184( n_syn->paramSamples + v->pvoice->offset); 37 | #else 38 | update->delta = n_syn->paramSamples + v->pvoice->offset; 39 | #endif 40 | update->type = AL_FILTER_STOP_VOICE; 41 | update->next = 0; 42 | 43 | n_alEnvmixerParam(v->pvoice, AL_FILTER_ADD_UPDATE, update); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /conker/src/libultra/gu/cosf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | 6 | #pragma GLOBAL_ASM("asm/nonmatchings/libultra/gu/cosf/cosf.s") 7 | -------------------------------------------------------------------------------- /conker/src/libultra/gu/guMtxF2L.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | 6 | #pragma GLOBAL_ASM("asm/nonmatchings/libultra/gu/guMtxF2L/guMtxF2L.s") 7 | -------------------------------------------------------------------------------- /conker/src/libultra/gu/guMtxIdentF.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | 6 | #pragma GLOBAL_ASM("asm/nonmatchings/libultra/gu/guMtxIdentF/guMtxIdentF.s") 7 | // NON-MATCHING: assume handwritten like OOT 8 | // void guMtxIdentF(f32 mf[4][4]) { 9 | // if (0) {}; 10 | // ((s32)mf[0][1]) = (s32)0; 11 | // mf[0][0] = 1; 12 | // dummy_label:; 13 | // ((s32)mf[0][2]) = 0; 14 | // ((s32)mf[0][3]) = 0; 15 | // ((s32)mf[1][0]) = 0; 16 | // mf[1][1] = 1; 17 | // ((s32)mf[1][2]) = 0; 18 | // ((s32)mf[1][3]) = 0; 19 | // ((s32)mf[2][0]) = 0; 20 | // ((s32)mf[2][1]) = 0; 21 | // mf[2][2] = 1; 22 | // ((s32)mf[2][3]) = 0; 23 | // ((s32)mf[3][0]) = 0; 24 | // ((s32)mf[3][1]) = 0; 25 | // ((s32)mf[3][2]) = 0; 26 | // mf[3][3] = 1; 27 | // } 28 | -------------------------------------------------------------------------------- /conker/src/libultra/gu/guNormalize.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | 6 | #pragma GLOBAL_ASM("asm/nonmatchings/libultra/gu/guNormalize/guNormalize.s") 7 | -------------------------------------------------------------------------------- /conker/src/libultra/gu/guPerspectiveF.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | void guPerspectiveF(f32 mf[4][4], u16 *perspNorm, f32 fovy, f32 aspect, f32 near, f32 far, f32 scale) { 5 | f32 yscale; 6 | s32 row, col; 7 | 8 | guMtxIdentF(mf); 9 | aspect *= 0.008726646192371845f; // PI / 180.0f 10 | yscale = cosf(aspect) / sinf(aspect); 11 | mf[0][0] = yscale; 12 | fovy *= 0.008726646192371845f; // PI / 180.0f 13 | mf[1][1] = cosf(fovy) / sinf(fovy); 14 | mf[2][2] = (near + far) / (near - far); 15 | mf[2][3] = -1.0f; 16 | mf[3][2] = (2.0f * near * far) / (near - far); 17 | mf[3][3] = 0.0f; 18 | 19 | for (row = 0; row < 4; row++) { 20 | for (col = 0; col < 4; col++) { 21 | mf[row][col] = mf[row][col] * scale; 22 | } 23 | } 24 | 25 | if (perspNorm != NULL) { 26 | if ((near + far) <= 2.0f) { 27 | *perspNorm = 0xFFFF; 28 | } else { 29 | *perspNorm = (s16) (u32) (131072.0f / (near + far)); 30 | if (*perspNorm <= 0) { 31 | *perspNorm = 1; 32 | } 33 | } 34 | } 35 | } 36 | 37 | void guPerspective(Mtx *m, u16 *perspNorm, float fovy, float aspect, float near, float far, float scale) { 38 | f32 mtx[4][4]; 39 | 40 | guPerspectiveF(&mtx, perspNorm, fovy, aspect, near, far, scale); 41 | guMtxF2L(&mtx, m); 42 | } 43 | -------------------------------------------------------------------------------- /conker/src/libultra/gu/guRotateF.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | #define PI 3.14159265358979323846f 5 | 6 | void guRotateF(float m[4][4], f32 a, f32 x, f32 y, f32 z) { 7 | f32 sin_a; 8 | f32 cos_a; 9 | f32 sp2C; 10 | f32 sp28; 11 | f32 sp24; 12 | f32 xx; 13 | f32 yy; 14 | f32 zz; 15 | 16 | guNormalize(&x, &y, &z); 17 | a *= PI / 180.0f; 18 | sin_a = sinf(a); 19 | cos_a = cosf(a); 20 | 21 | sp2C = x * y * (1.0f - cos_a); 22 | sp28 = y * z * (1.0f - cos_a); 23 | sp24 = z * x * (1.0f - cos_a); 24 | 25 | guMtxIdentF(m); 26 | xx = x * x; 27 | m[0][0] = (1.0f - xx) * cos_a + xx; 28 | m[2][1] = sp28 - x * sin_a; 29 | m[1][2] = sp28 + x * sin_a; 30 | yy = y * y; 31 | m[1][1] = (1.0f - yy) * cos_a + yy; 32 | m[2][0] = sp24 + y * sin_a; 33 | m[0][2] = sp24 - y * sin_a; 34 | zz = z * z; 35 | m[2][2] = (1.0f - zz) * cos_a + zz; 36 | m[1][0] = sp2C - z * sin_a; 37 | m[0][1] = sp2C + z * sin_a; 38 | } 39 | 40 | void guRotate(Mtx *m, f32 a, f32 x, f32 y, f32 z) { 41 | f32 mf[4][4]; 42 | guRotateF(mf, a, x, y, z); 43 | guMtxF2L(mf, m); 44 | } 45 | -------------------------------------------------------------------------------- /conker/src/libultra/gu/mtxcatl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | void guMtxXFML(Mtx *m, float x, float y, float z, float *ox, float *oy, float *oz) { 6 | f32 mf[4][4]; 7 | 8 | guMtxL2F(&mf, m); 9 | guMtxXFMF(&mf, x, y, z, ox, oy, oz); 10 | } 11 | 12 | void guMtxCatL(Mtx *m, Mtx *n, Mtx *res) { 13 | f32 mf[4][4]; 14 | f32 nf[4][4]; 15 | f32 resf[4][4]; 16 | 17 | guMtxL2F(&mf, m); 18 | guMtxL2F(&nf, n); 19 | guMtxCatF(&mf, &nf, &resf); 20 | guMtxF2L2(&resf, res); 21 | } 22 | -------------------------------------------------------------------------------- /conker/src/libultra/gu/sinf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | 6 | #pragma GLOBAL_ASM("asm/nonmatchings/libultra/gu/sinf/sinf.s") 7 | -------------------------------------------------------------------------------- /conker/src/libultra/io/ai.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | s32 __osAiDeviceBusy(void) 5 | { 6 | register s32 status = IO_READ(AI_STATUS_REG); 7 | if (status & AI_STATUS_FIFO_FULL) 8 | 9 | return 1; 10 | 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /conker/src/libultra/io/aigetstat.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | u32 osAiGetStatus() 4 | { 5 | return IO_READ(AI_STATUS_REG); 6 | } 7 | -------------------------------------------------------------------------------- /conker/src/libultra/io/aisetfreq.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../os/osint.h" 3 | 4 | s32 osAiSetFrequency(u32 frequency) 5 | { 6 | register f32 f = osViClock / (f32)frequency + .5f; 7 | register u32 dacRate = f; 8 | register u8 bitRate; 9 | // dacRate ; 10 | if (dacRate < AI_MIN_DAC_RATE) 11 | return -1; 12 | bitRate = dacRate / 66; 13 | if (bitRate > AI_MAX_BIT_RATE) 14 | bitRate = AI_MAX_BIT_RATE; 15 | IO_WRITE(AI_DACRATE_REG, dacRate - 1); 16 | IO_WRITE(AI_BITRATE_REG, bitRate - 1); 17 | IO_WRITE(AI_CONTROL_REG, AI_CONTROL_DMA_ON); 18 | return osViClock / (s32)dacRate; 19 | } 20 | -------------------------------------------------------------------------------- /conker/src/libultra/io/aisetnextbuf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "../os/osint.h" 4 | 5 | #pragma GLOBAL_ASM("asm/nonmatchings/libultra/io/aisetnextbuf/osAiSetNextBuffer.s") 6 | // NON-MATCHING: matches won't OK until .bss is figured out (i think?) 7 | // s32 osAiSetNextBuffer(void *bufPtr, u32 size) 8 | // { 9 | // static u8 hdwrBugFlag = 0; 10 | // char *bptr = bufPtr; 11 | // if (hdwrBugFlag != 0) 12 | // bptr = (u32)bufPtr - 0x2000; 13 | // 14 | // if ((((s32)bufPtr + size) & 0x3fff) == 0x2000) 15 | // hdwrBugFlag = 1; 16 | // else 17 | // hdwrBugFlag = 0; 18 | // 19 | // if (__osAiDeviceBusy()) 20 | // return -1; 21 | // 22 | // IO_WRITE(AI_DRAM_ADDR_REG, osVirtualToPhysical(bptr)); 23 | // IO_WRITE(AI_LEN_REG, size); 24 | // return 0; 25 | // } 26 | -------------------------------------------------------------------------------- /conker/src/libultra/io/pfschecker2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "functions.h" 3 | #include "variables.h" 4 | 5 | 6 | #pragma GLOBAL_ASM("asm/nonmatchings/libultra/io/pfschecker2/osPfsChecker2.s") 7 | 8 | #pragma GLOBAL_ASM("asm/nonmatchings/libultra/io/pfschecker2/corrupted_init2.s") 9 | 10 | #pragma GLOBAL_ASM("asm/nonmatchings/libultra/io/pfschecker2/corrupted2.s") 11 | -------------------------------------------------------------------------------- /conker/src/libultra/io/siint.h: -------------------------------------------------------------------------------- 1 | #ifndef _SIINT_H 2 | #define _SIINT_H 3 | #include 4 | #include 5 | 6 | void __osSiGetAccess(void); 7 | void __osSiRelAccess(void); 8 | int __osSiDeviceBusy(void); 9 | void __osSiCreateAccessQueue(void); 10 | #endif 11 | -------------------------------------------------------------------------------- /conker/src/libultra/io/sptask.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #pragma GLOBAL_ASM("asm/nonmatchings/libultra/io/sptask/_VirtualToPhysicalTask.s") 4 | 5 | void osSpTaskLoad(OSTask *intp) 6 | { 7 | 8 | OSTask *tp; 9 | tp = _VirtualToPhysicalTask(intp); 10 | if (tp->t.flags & OS_TASK_YIELDED) 11 | { 12 | tp->t.ucode_data = tp->t.yield_data_ptr; 13 | tp->t.ucode_data_size = tp->t.yield_data_size; 14 | intp->t.flags &= ~OS_TASK_YIELDED; 15 | if (tp->t.flags & OS_TASK_LOADABLE) 16 | tp->t.ucode = (u64 *)IO_READ((u32)intp->t.yield_data_ptr + OS_YIELD_DATA_SIZE - 4); 17 | } 18 | osWritebackDCache(tp, sizeof(OSTask)); 19 | __osSpSetStatus(SP_CLR_YIELD | SP_CLR_YIELDED | SP_CLR_TASKDONE | SP_SET_INTR_BREAK); 20 | while (__osSpSetPc(SP_IMEM_START) == -1) 21 | ; 22 | 23 | while (__osSpRawStartDma(1, (SP_IMEM_START - sizeof(*tp)), tp, 24 | sizeof(OSTask)) == -1) 25 | ; 26 | 27 | while (__osSpDeviceBusy()) 28 | ; 29 | 30 | while (__osSpRawStartDma(1, SP_IMEM_START, tp->t.ucode_boot, 31 | tp->t.ucode_boot_size) == -1) 32 | ; 33 | } 34 | 35 | void osSpTaskStartGo(OSTask *tp) { 36 | while(__osSpDeviceBusy()) 37 | ; 38 | __osSpSetStatus(SP_SET_INTR_BREAK | SP_CLR_SSTEP | SP_CLR_BROKE | SP_CLR_HALT); 39 | } 40 | -------------------------------------------------------------------------------- /conker/src/libultra/os/createthread.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | 5 | void __osCleanupThread(void); 6 | extern OSThread *__osActiveQueue; 7 | 8 | void osCreateThread(OSThread *t, OSId id, void (*entry)(void *), void *arg, void *sp, OSPri p) 9 | { 10 | register u32 saveMask; 11 | OSIntMask mask; 12 | t->id = id; 13 | t->priority = p; 14 | t->next = NULL; 15 | t->queue = NULL; 16 | t->context.pc = (u32)entry; 17 | t->context.a0 = (u64)arg; 18 | t->context.sp = (u64)sp - 16; 19 | t->context.ra = (u64)__osCleanupThread; 20 | mask = OS_IM_ALL; 21 | t->context.sr = SR_IMASK | SR_EXL | SR_IE | 0x4000000; // | 0x4000000 not in libreultra 22 | t->context.rcp = (mask & RCP_IMASK) >> RCP_IMASKSHIFT; 23 | t->context.fpcsr = (u32)(FPCSR_FS | FPCSR_EV); 24 | t->fp = 0; 25 | t->state = OS_STATE_STOPPED; 26 | t->flags = 0; 27 | saveMask = __osDisableInt(); 28 | t->tlnext = __osActiveQueue; 29 | __osActiveQueue = t; 30 | __osRestoreInt(saveMask); 31 | } 32 | -------------------------------------------------------------------------------- /conker/src/libultra/os/getthreadpri.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern OSThread *__osRunningThread; 4 | OSPri osGetThreadPri(OSThread *thread) 5 | { 6 | if (thread == NULL) 7 | thread = __osRunningThread; 8 | return thread->priority; 9 | } 10 | -------------------------------------------------------------------------------- /conker/src/libultra/os/initialize.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "functions.h" 4 | #include "variables.h" 5 | 6 | 7 | #pragma GLOBAL_ASM("asm/nonmatchings/libultra/os/initialize/__osInitialize_common.s") 8 | -------------------------------------------------------------------------------- /conker/src/libultra/os/osint.h: -------------------------------------------------------------------------------- 1 | #ifndef _OSINT_H 2 | #define _OSINT_H 3 | #include 4 | typedef struct __OSEventState 5 | { 6 | OSMesgQueue *messageQueue; 7 | OSMesg message; 8 | } __OSEventState; 9 | extern struct __osThreadTail 10 | { 11 | OSThread *next; 12 | OSPri priority; 13 | } __osThreadTail; 14 | 15 | //maybe should be in exceptasm.h? 16 | extern void __osEnqueueAndYield(OSThread **); 17 | extern void __osDequeueThread(OSThread **, OSThread *); 18 | extern void __osEnqueueThread(OSThread **, OSThread *); 19 | extern OSThread *__osPopThread(OSThread **); 20 | extern void __osDispatchThread(void); 21 | 22 | extern void __osSetTimerIntr(OSTime); 23 | extern OSTime __osInsertTimer(OSTimer *); 24 | extern void __osTimerInterrupt(void); 25 | extern u32 __osProbeTLB(void *); 26 | extern int __osSpDeviceBusy(void); 27 | 28 | extern OSThread *__osRunningThread; 29 | extern OSThread *__osActiveQueue; 30 | extern OSThread *__osFaultedThread; 31 | extern OSThread *__osRunQueue; 32 | 33 | extern OSTimer *__osTimerList; 34 | extern OSTimer __osBaseTimer; 35 | extern OSTime __osCurrentTime; 36 | extern u32 __osBaseCounter; 37 | extern u32 __osViIntrCount; 38 | extern u32 __osTimerCounter; 39 | 40 | extern __OSEventState __osEventStateTab[OS_NUM_EVENTS]; 41 | 42 | 43 | //not sure if this should be here 44 | extern s32 osViClock; 45 | extern void __osTimerServicesInit(void); 46 | extern s32 __osAiDeviceBusy(void); 47 | extern int __osDpDeviceBusy(void); 48 | #endif 49 | -------------------------------------------------------------------------------- /conker/symbol_addrs.debug.txt: -------------------------------------------------------------------------------- 1 | osCreateThread = 0x10003700; 2 | bzero = 0x10006F70; 3 | __osSetSR = 0x100072B0; 4 | __osGetSR = 0x100072C0; 5 | __osSetFpcCsr = 0x100072D0; 6 | osStartThread = 0x100072E0; 7 | osSetThreadPri = 0x10007430; 8 | -------------------------------------------------------------------------------- /conker/symbol_addrs.ects.txt: -------------------------------------------------------------------------------- 1 | osCreateThread = 0x10003500; 2 | bzero = 0x10006870; 3 | __osSetSR = 0x10006BB0; 4 | __osGetSR = 0x10006BC0; 5 | __osSetFpcCsr = 0x10006BD0; 6 | osStartThread = 0x10006BE0; 7 | osSetThreadPri = 0x10006D30; 8 | osInvalICache = 0x10006E10; 9 | osInvalDCache = 0x10006E90; 10 | __osDisableInt = 0x10006F40; 11 | __osRestoreInt = 0x10006F60; 12 | memcpy = 0x10006F80; 13 | osRecvMesg = 0x10007450; 14 | osStopThread = 0x10007590; 15 | osSendMesg = 0x10007650; 16 | osCreateMesgQueue = 0x10007860; 17 | osSetEventMesg = 0x10007890; 18 | osGetThreadPri = 0x10007900; 19 | osPiRawStartDma = 0x10007920; 20 | osVirtualToPhysical = 0x10007DF0; 21 | osWritebackDCache = 0x10007E70; 22 | __osSpSetStatus = 0x10007EF0; 23 | __osSpSetPc = 0x10007F00; 24 | __osSpRawStartDma = 0x10007F40; 25 | __osSpDeviceBusy = 0x10007FD0; 26 | __osTimerServicesInit = 0x10008000; 27 | __osTimerInterrupt = 0x1000808C; 28 | __osSetTimerIntr = 0x10008204; 29 | __osInsertTimer = 0x10008278; 30 | __osGetActiveQueue = 0x10008550; 31 | __osViSwapContext = 0x10008560; 32 | osGetCount = 0x100088C0; 33 | __osDequeueThread = 0x100088D0; 34 | osSetIntMask = 0x10008910; 35 | osPiStartDma = 0x100089B0; 36 | osDestroyThread = 0x10008AC0; 37 | osViBlack = 0x10008BC0; 38 | osWritebackDCacheAll = 0x10008C30; 39 | osPiGetStatus = 0x10008C60; 40 | osUnmapTLB = 0x10008C70; 41 | osMapTLB = 0x10008CB0; 42 | __osSpRawReadIo = 0x10008D70; 43 | __osSpRawWriteIo = 0x10008DC0; 44 | osPiRawReadIo = 0x10008E10; 45 | __osSetHWIntrRoutine = 0x10009130; 46 | __osProbeTLB = 0x10009A40; 47 | __osSetCompare = 0x10009B00; 48 | osJamMesg = 0x10009B10; 49 | osPiGetCmdQueue = 0x10009C60; 50 | __osSiDeviceBusy = 0x10009C90; 51 | osViSetMode = 0x101F5990; 52 | osViSwapBuffer = 0x101F5A00; 53 | -------------------------------------------------------------------------------- /conker/tools/asm-differ: -------------------------------------------------------------------------------- 1 | ../../tools/asm-differ -------------------------------------------------------------------------------- /conker/tools/mips_to_c: -------------------------------------------------------------------------------- 1 | ../../tools/mips_to_c -------------------------------------------------------------------------------- /conker/undefined_funcs.debug.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkst/conker/71dd8c178a276591f0993946de43241433501da7/conker/undefined_funcs.debug.txt -------------------------------------------------------------------------------- /conker/undefined_funcs.ects.txt: -------------------------------------------------------------------------------- 1 | osVirtualToPhysical = 0x10007DF0; 2 | -------------------------------------------------------------------------------- /conker/undefined_funcs.eu.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkst/conker/71dd8c178a276591f0993946de43241433501da7/conker/undefined_funcs.eu.txt -------------------------------------------------------------------------------- /conker/undefined_funcs.us.txt: -------------------------------------------------------------------------------- 1 | __osDevMgrMain = 0x10002E50; 2 | __n_CSPHandleMetaMsg = 0x10015044; 3 | -------------------------------------------------------------------------------- /conker/undefined_syms.debug.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkst/conker/71dd8c178a276591f0993946de43241433501da7/conker/undefined_syms.debug.txt -------------------------------------------------------------------------------- /conker/undefined_syms.ects.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkst/conker/71dd8c178a276591f0993946de43241433501da7/conker/undefined_syms.ects.txt -------------------------------------------------------------------------------- /conker/undefined_syms.eu.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkst/conker/71dd8c178a276591f0993946de43241433501da7/conker/undefined_syms.eu.txt -------------------------------------------------------------------------------- /conker/undefined_syms.us.txt: -------------------------------------------------------------------------------- 1 | D_1002AAD0 = 0x1002AAD0; 2 | D_160036F3 = 0x160036F3; 3 | D_16003848 = 0x16003848; 4 | D_1600388C = 0x1600388C; 5 | D_16003890 = 0x16003890; 6 | D_1600389C = 0x1600389C; 7 | D_160038A0 = 0x160038A0; 8 | D_160038A4 = 0x160038A4; 9 | D_16003AF0 = 0x16003AF0; 10 | D_16003AF4 = 0x16003AF4; 11 | D_16003B1C = 0x16003B1C; 12 | D_16003B20 = 0x16003B20; 13 | D_16003B28 = 0x16003B28; 14 | D_16003B4C = 0x16003B4C; 15 | D_800860C0 = 0x800860C0; 16 | D_80089AAC = 0x80089AAC; 17 | D_80089AD4 = 0x80089AD4; 18 | D_80089EE8 = 0x80089EE8; 19 | D_80089EF0 = 0x80089EF0; 20 | D_80089EF8 = 0x80089EF8; 21 | D_80089F2C = 0x80089F2C; 22 | D_8008A688 = 0x8008A688; 23 | D_8008A7B0 = 0x8008A7B0; 24 | D_8008A8D8 = 0x8008A8D8; 25 | D_8008B4D0 = 0x8008B4D0; 26 | D_8008B4D4 = 0x8008B4D4; 27 | D_80090314 = 0x80090314; 28 | D_80098DD8 = 0x80098DD8; 29 | D_80098DE0 = 0x80098DE0; 30 | D_80098DE8 = 0x80098DE8; 31 | D_80099440 = 0x80099440; 32 | D_8009A13C = 0x8009A13C; 33 | D_800A1FB0 = 0x800A1FB0; 34 | D_800A1FBC = 0x800A1FBC; 35 | D_800A2148 = 0x800A2148; 36 | D_800A2154 = 0x800A2154; 37 | D_800A548C = 0x800A548C; 38 | D_800A56AC = 0x800A56AC; 39 | D_800A691C = 0x800A691C; 40 | D_800A6928 = 0x800A6928; 41 | D_800A6958 = 0x800A6958; 42 | D_800A6A0C = 0x800A6A0C; 43 | D_800C18B8 = 0x800C18B8; 44 | D_800CC521 = 0x800CC521; 45 | D_800CC5A0 = 0x800CC5A0; 46 | 47 | D_8002BA44 = 0x8002BA44; 48 | D_8002C080 = 0x8002C080; 49 | D_8002C0A0 = 0x8002C0A0; 50 | D_8002C410 = 0x8002C410; 51 | D_8002C460 = 0x8002C460; 52 | D_8002C4CC = 0x8002C4CC; 53 | D_8002C520 = 0x8002C520; 54 | D_80095A30 = 0x80095A30; 55 | -------------------------------------------------------------------------------- /diff_settings.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | VERSION="us" 4 | 5 | def apply(config, args): 6 | config["baseimg"] = f"baserom.{VERSION}.z64" 7 | config["myimg"] = f"build/conker.{VERSION}.z64" 8 | config["mapfile"] = f"build/conker.{VERSION}.map" 9 | config["source_directories"] = ["src", "src_eu", "src_debug", "include"] 10 | -------------------------------------------------------------------------------- /game.debug.rzip.yaml: -------------------------------------------------------------------------------- 1 | basename: conker 2 | options: 3 | target_path: assets/game.debug.rzip.bin 4 | base_path: . 5 | asset_path: assets/game 6 | extensions_path: tools/splat_ext 7 | segments: 8 | - name: code 9 | type: rzip 10 | xor: 0x8039CCCA 11 | start: 0x0 12 | - [0x14E5CC, "bin", "code_padding"] # zero padding 13 | - name: data 14 | type: rzip 15 | start: 0x150EA0 16 | subsegments: 17 | - [0x150EA0, "compressed"] # compressed .data 18 | - [0x165A70, "bin", "data_padding"] # zero padding 19 | - [0x167600] # 1,472,000 bytes 20 | -------------------------------------------------------------------------------- /game.eu.rzip.yaml: -------------------------------------------------------------------------------- 1 | options: 2 | target_path: assets/game.eu.rzip.bin 3 | base_path: . 4 | asset_path: assets/game 5 | extensions_path: tools/splat_ext 6 | segments: 7 | - name: code 8 | type: rzip 9 | xor: 0x8039CCCA 10 | start: 0x0 11 | - [0x143CA4, "bin", "code_padding"] # (almost) zero padding 12 | - name: data 13 | type: rzip 14 | start: 0x145ED8 15 | subsegments: 16 | - [0x145ED8, "compressed"] # compressed .data 17 | - [0x15A36C, "bin", "data_padding"] # zero padding 18 | - [0x15C638] # 1,427,000 bytes 19 | -------------------------------------------------------------------------------- /game.us.rzip.yaml: -------------------------------------------------------------------------------- 1 | options: 2 | target_path: assets/game.us.rzip.bin 3 | base_path: . 4 | asset_path: assets/game 5 | extensions_path: tools/splat_ext 6 | segments: 7 | - name: code 8 | type: rzip 9 | xor: 0x8039CCCA 10 | start: 0x0 11 | - [0x144700, "bin", "code_padding"] # (almost) zero padding 12 | - name: data 13 | type: rzip 14 | start: 0x145ED8 15 | subsegments: 16 | - [0x145ED8, "compressed"] # compressed .data 17 | - [0x15A388, "bin", "data_padding"] # zero padding 18 | - [0x15C638] # 1,427,000 bytes 19 | -------------------------------------------------------------------------------- /ido/ido5.3_recomp/Makefile: -------------------------------------------------------------------------------- 1 | IRIX_ROOT := ../ido5.3_compiler 2 | 3 | cc: OPT_CFLAGS := -O2 4 | cfe: OPT_CFLAGS := -O2 5 | uopt: OPT_CFLAGS := -O2 6 | ugen: OPT_CFLAGS := -O2 7 | as1: OPT_CFLAGS := -O2 8 | acpp: OPT_CFLAGS := -O2 9 | 10 | RECOMP := recomp 11 | 12 | ugen_c.c: RECOMP_FLAGS := --conservative 13 | 14 | all: cc cfe uopt ugen as1 acpp copt ujoin uld umerge usplit err.english.cc 15 | 16 | clean: 17 | $(RM) cc* cfe* uopt* ugen* as1* acpp* copt* ujoin* uld* umerge* usplit* err.english.cc $(RECOMP) libc_impl.o 18 | 19 | $(RECOMP): recomp.cpp 20 | $(CXX) $^ -o $@ -std=c++11 -O2 -Wno-switch `pkg-config --cflags --libs capstone` 21 | 22 | libc_impl.o: libc_impl.c libc_impl.h 23 | $(CC) $< -c -fno-strict-aliasing -O2 -DIDO53 24 | 25 | err.english.cc: $(IRIX_ROOT)/usr/lib/err.english.cc 26 | cp $^ $@ 27 | 28 | cc_c.c: $(IRIX_ROOT)/usr/bin/cc $(RECOMP) 29 | ./$(RECOMP) $(RECOMP_FLAGS) $< > $@ 30 | 31 | %_c.c: $(IRIX_ROOT)/usr/lib/% $(RECOMP) 32 | ./$(RECOMP) $(RECOMP_FLAGS) $< > $@ 33 | 34 | %: %_c.c libc_impl.o 35 | $(CC) libc_impl.o $< -o $@ $(OPT_CFLAGS) -fno-strict-aliasing -lm -no-pie 36 | 37 | .PHONY: all clean 38 | -------------------------------------------------------------------------------- /ido/ido5.3_recomp/README.md: -------------------------------------------------------------------------------- 1 | To reproduce this directory: 2 | 3 | ```sh 4 | cd 5 | git clone https://github.com/n64decomp/sm64.git 6 | cd sm64/tools/ido5.3_recomp 7 | make all --jobs 8 | # copy everything 9 | cp ./* ../../../conker/ido/ido5.3_recomp/ 10 | ``` 11 | -------------------------------------------------------------------------------- /ido/ido5.3_recomp/acpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkst/conker/71dd8c178a276591f0993946de43241433501da7/ido/ido5.3_recomp/acpp -------------------------------------------------------------------------------- /ido/ido5.3_recomp/as1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkst/conker/71dd8c178a276591f0993946de43241433501da7/ido/ido5.3_recomp/as1 -------------------------------------------------------------------------------- /ido/ido5.3_recomp/cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkst/conker/71dd8c178a276591f0993946de43241433501da7/ido/ido5.3_recomp/cc -------------------------------------------------------------------------------- /ido/ido5.3_recomp/cfe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkst/conker/71dd8c178a276591f0993946de43241433501da7/ido/ido5.3_recomp/cfe -------------------------------------------------------------------------------- /ido/ido5.3_recomp/copt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkst/conker/71dd8c178a276591f0993946de43241433501da7/ido/ido5.3_recomp/copt -------------------------------------------------------------------------------- /ido/ido5.3_recomp/header.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "libc_impl.h" 9 | #include "helpers.h" 10 | 11 | #define RM_RN 0 12 | #define RM_RZ 1 13 | #define RM_RP 2 14 | #define RM_RM 3 15 | 16 | union FloatReg { 17 | float f[2]; 18 | uint32_t w[2]; 19 | double d; 20 | }; 21 | 22 | #define cvt_w_d(f) \ 23 | ((fcsr & RM_RZ) ? ((isnan(f) || f <= -2147483649.0 || f >= 2147483648.0) ? (fcsr |= 0x40, 2147483647) : (int)f) : (assert(0), 0)) 24 | 25 | #define cvt_w_s(f) cvt_w_d((double)f) 26 | 27 | static union FloatReg f0 = {{0, 0}}, f2 = {{0, 0}}, f4 = {{0, 0}}, f6 = {{0, 0}}, f8 = {{0, 0}}, 28 | f10 = {{0, 0}}, f12 = {{0, 0}}, f14 = {{0, 0}}, f16 = {{0, 0}}, f18 = {{0, 0}}, f20 = {{0, 0}}, 29 | f22 = {{0, 0}}, f24 = {{0, 0}}, f26 = {{0, 0}}, f28 = {{0, 0}}, f30 = {{0, 0}}; 30 | static uint32_t fcsr = 1; 31 | -------------------------------------------------------------------------------- /ido/ido5.3_recomp/helpers.h: -------------------------------------------------------------------------------- 1 | #ifndef HELPERS_H 2 | #define HELPERS_H 3 | 4 | #include 5 | 6 | #define MEM_U32(a) (*(uint32_t *)(mem + a)) 7 | #define MEM_S32(a) (*(int32_t *)(mem + a)) 8 | #define MEM_U16(a) (*(uint16_t *)(mem + ((a) ^ 2))) 9 | #define MEM_S16(a) (*(int16_t *)(mem + ((a) ^ 2))) 10 | #define MEM_U8(a) (*(uint8_t *)(mem + ((a) ^ 3))) 11 | #define MEM_S8(a) (*(int8_t *)(mem + ((a) ^ 3))) 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /ido/ido5.3_recomp/recomp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkst/conker/71dd8c178a276591f0993946de43241433501da7/ido/ido5.3_recomp/recomp -------------------------------------------------------------------------------- /ido/ido5.3_recomp/ugen: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkst/conker/71dd8c178a276591f0993946de43241433501da7/ido/ido5.3_recomp/ugen -------------------------------------------------------------------------------- /ido/ido5.3_recomp/ujoin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkst/conker/71dd8c178a276591f0993946de43241433501da7/ido/ido5.3_recomp/ujoin -------------------------------------------------------------------------------- /ido/ido5.3_recomp/uld: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkst/conker/71dd8c178a276591f0993946de43241433501da7/ido/ido5.3_recomp/uld -------------------------------------------------------------------------------- /ido/ido5.3_recomp/umerge: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkst/conker/71dd8c178a276591f0993946de43241433501da7/ido/ido5.3_recomp/umerge -------------------------------------------------------------------------------- /ido/ido5.3_recomp/uopt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkst/conker/71dd8c178a276591f0993946de43241433501da7/ido/ido5.3_recomp/uopt -------------------------------------------------------------------------------- /ido/ido5.3_recomp/usplit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkst/conker/71dd8c178a276591f0993946de43241433501da7/ido/ido5.3_recomp/usplit -------------------------------------------------------------------------------- /packages.txt: -------------------------------------------------------------------------------- 1 | binutils-mips-linux-gnu 2 | build-essential 3 | less 4 | libglib2.0 5 | python3 6 | python3-pip 7 | unzip 8 | wget 9 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | ansiwrap 2 | attrs 3 | capstone 4 | colorama 5 | cxxfilt 6 | pycparser 7 | pylibyaml 8 | pynacl 9 | pypng 10 | python-Levenshtein 11 | python-ranges 12 | pyyaml 13 | toml 14 | watchdog 15 | -------------------------------------------------------------------------------- /tools/extract_compressed.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import yaml 3 | 4 | import rareunzip as ru 5 | 6 | def main(config_file, infile, outdir): 7 | if not outdir.endswith("/"): 8 | outdir += "/" 9 | 10 | with open(config_file, "r") as f: 11 | config = yaml.safe_load(f.read()) 12 | with open(infile, "rb") as b: 13 | data = b.read() 14 | for file in config["files"]: 15 | start = file["start"] 16 | end = start + file["compressed"] 17 | expected_length = file["uncompressed"] 18 | if end > len(data): 19 | print("bad config!", file) 20 | break 21 | filename = f"{outdir}{start:08X}.bin" 22 | chunk = data[start:end] 23 | try: 24 | res = ru.runzip(chunk) 25 | except: 26 | print("bad zip", file) 27 | continue 28 | if len(res) != expected_length: 29 | print("bad file!", file) 30 | continue 31 | with open(filename, "wb") as o: 32 | o.write(res) 33 | 34 | 35 | if len(sys.argv) < 4: 36 | print("usage: python3 %s " % sys.argv[0]) 37 | else: 38 | main(sys.argv[1], sys.argv[2], sys.argv[3]) 39 | -------------------------------------------------------------------------------- /tools/gzip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkst/conker/71dd8c178a276591f0993946de43241433501da7/tools/gzip -------------------------------------------------------------------------------- /tools/rareunzip.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import zlib 3 | 4 | 5 | def runzip_with_leftovers(data): 6 | d = zlib.decompressobj(wbits=-15) # raw deflate bytestream 7 | res = d.decompress(data[4:]) # drop 4 byte length header 8 | return (res, d.unused_data) 9 | 10 | def runzip(data): 11 | res, leftovers = runzip_with_leftovers(data) 12 | return res 13 | 14 | def main(): 15 | with open(sys.argv[1], "rb") as f: 16 | with open(sys.argv[2], "wb") as o: 17 | o.write(runzip(f.read())) 18 | 19 | 20 | if __name__ == '__main__': 21 | if len(sys.argv) < 3: 22 | print("usage %s infile outfile" % sys.argv[0]) 23 | else: 24 | main() 25 | -------------------------------------------------------------------------------- /tools/rarezip.py: -------------------------------------------------------------------------------- 1 | import os 2 | import struct 3 | import sys 4 | import subprocess 5 | 6 | def compress_file(filepath, level=9): 7 | # force use of the gzip that sits along this file 8 | gzip = os.path.join(os.path.dirname(os.path.realpath(__file__)), "gzip") 9 | args = [gzip, f"-{level}", "--no-name", "-c", filepath] 10 | res = subprocess.run(args, capture_output=True) 11 | if res.returncode != 0: 12 | return None 13 | gzip_compressed = res.stdout 14 | uncompressed_length = struct.unpack("i", uncompressed_length) + gzip_compressed[10:-8] 16 | 17 | # def rzip(data, level=9): 18 | # compressed = zlib.compress(data, level=level) 19 | # compressed = compressed[2:] # drop header 20 | # compressed = compressed[:-4] # drop crc32 21 | # compressed = struct.pack('>I', len(data)) + compressed # prepend uncompressed size 22 | # return compressed 23 | 24 | def main(infile, outfile, level): 25 | with open(outfile, "wb") as o: 26 | o.write(compress_file(infile, level=level)) 27 | 28 | 29 | if __name__ == '__main__': 30 | if len(sys.argv) < 3: 31 | print("usage %s infile outfile" % sys.argv[0]) 32 | else: 33 | main(sys.argv[1], sys.argv[2], 9 if len(sys.argv) < 4 else int(sys.argv[3])) 34 | -------------------------------------------------------------------------------- /tools/splat_ext/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkst/conker/71dd8c178a276591f0993946de43241433501da7/tools/splat_ext/__init__.py -------------------------------------------------------------------------------- /tools/splat_ext/rareunzip.py: -------------------------------------------------------------------------------- 1 | ../rareunzip.py --------------------------------------------------------------------------------