├── .github └── workflows │ ├── build.yml │ └── codeql-analysis.yml ├── .gitignore ├── BSDmakefile ├── LICENSE ├── Makefile ├── README ├── doc ├── huc │ ├── clibref.txt │ ├── clibref_fr.txt │ ├── huc_doc.htm │ ├── mmldoc.txt │ ├── overlays.txt │ └── random.txt ├── hucc │ └── hucc_function_ref.md ├── nes │ ├── cpu_inst.txt │ ├── history.txt │ ├── index.txt │ ├── neshdr20.txt │ └── usage.txt └── pce │ ├── AC_Regs_WIP.txt │ ├── concepts.txt │ ├── cpu.txt │ ├── cpu_inst.txt │ ├── history.txt │ ├── index.txt │ ├── library.txt │ ├── psg.txt │ ├── sprites.txt │ ├── techdoc.txt │ ├── usage-3.25.txt │ ├── usage.txt │ ├── vce.txt │ └── vdc.txt ├── examples ├── Makefile ├── asm │ ├── Makefile │ ├── elmer │ │ ├── .gitignore │ │ ├── LICENSE_1_0.txt │ │ ├── Make_ex.inc │ │ ├── Makefile │ │ ├── README.md │ │ ├── cd-core-1stage │ │ │ ├── Makefile │ │ │ ├── core-1stage.cue │ │ │ └── stage1.asm │ │ ├── cd-core-2stage │ │ │ ├── Makefile │ │ │ ├── core-2stage.cue │ │ │ └── stage2.asm │ │ ├── cd-core-scsitest │ │ │ ├── Makefile │ │ │ ├── core-scsitest.cue │ │ │ ├── scsitest.asm │ │ │ └── test-tone.wav │ │ ├── data │ │ │ ├── alice.ram │ │ │ ├── alice.vdc │ │ │ ├── error-bkg-16.png │ │ │ ├── error-bkg-31.png │ │ │ ├── error-spr-15.png │ │ │ ├── pointer.png │ │ │ ├── pointer.spr │ │ │ ├── red_queen-16k.vox │ │ │ ├── saz_vce.zx0 │ │ │ ├── saz_vdc.zx0 │ │ │ ├── saz_vdc.zx0.256 │ │ │ ├── testspr.png │ │ │ ├── texture.chr │ │ │ ├── texture.png │ │ │ └── umbrella-16k.vox │ │ ├── doc │ │ │ ├── adpcm.txt │ │ │ ├── arcade-card.txt │ │ │ ├── huc6280.txt │ │ │ ├── iso-646.txt │ │ │ ├── multitap.txt │ │ │ ├── pcengine-notes.txt │ │ │ ├── syscard-cd-ipl.txt │ │ │ └── syscard-irq1.txt │ │ ├── font │ │ │ ├── README.md │ │ │ ├── font8x12-syscard.dat │ │ │ ├── font8x12-syscard.fon │ │ │ ├── font8x16-syscard-bold.dat │ │ │ ├── font8x16-syscard-bold.fon │ │ │ ├── font8x16-syscard-bold.zx0 │ │ │ ├── font8x8-ascii-bold-short.dat │ │ │ ├── font8x8-ascii-bold-short.fon │ │ │ ├── font8x8-ascii-bold-short.zx0 │ │ │ ├── font8x8-ascii-exos.dat │ │ │ ├── font8x8-ascii-exos.fon │ │ │ ├── font8x8-ascii-exos.zx0 │ │ │ ├── font8x8-bold-short-etswst-pt.fon │ │ │ ├── font8x8-bold-short-iso646-de.fon │ │ │ ├── font8x8-bold-short-iso646-en.fon │ │ │ ├── font8x8-bold-short-iso646-es.fon │ │ │ ├── font8x8-bold-short-iso646-fr.fon │ │ │ ├── font8x8-bold-short-iso646-it.fon │ │ │ ├── font8x8-bold-short-iso646-jp.fon │ │ │ ├── font8x8-stage1-exos.dat │ │ │ ├── font8x8-stage1-exos.fon │ │ │ └── font8x8-syscard3.fon │ │ ├── include │ │ │ ├── acd.asm │ │ │ ├── adpcm.asm │ │ │ ├── bare-startup.asm │ │ │ ├── cdrom.asm │ │ │ ├── crc16.asm │ │ │ ├── crc32.asm │ │ │ ├── fastmath.asm │ │ │ ├── font.asm │ │ │ ├── huc-gfx.asm │ │ │ ├── ipl-scd.dat │ │ │ ├── joypad-extra.asm │ │ │ ├── kickc-final.asm │ │ │ ├── kickc.asm │ │ │ ├── math.asm │ │ │ ├── mb128-base.asm │ │ │ ├── movie.asm │ │ │ ├── ted2-fat32.asm │ │ │ ├── ted2-sd.asm │ │ │ ├── ted2.asm │ │ │ ├── tty.asm │ │ │ ├── unpack-lzsa1.asm │ │ │ └── unpack-lzsa2.asm │ │ ├── ipl-scd │ │ │ ├── Makefile │ │ │ └── ipl-scd.asm │ │ ├── kickc │ │ │ ├── bios.h │ │ │ ├── huc-gfx.h │ │ │ ├── kickc.h │ │ │ ├── pce.ld │ │ │ ├── pce.tgt │ │ │ └── pcengine.h │ │ ├── make.cmd │ │ ├── rom-bare-buftest │ │ │ ├── Makefile │ │ │ └── buftest.asm │ │ ├── rom-bare-dmatest │ │ │ ├── Makefile │ │ │ └── dmatest.asm │ │ ├── rom-bare-hello │ │ │ ├── Makefile │ │ │ └── hello.asm │ │ ├── rom-bare-mwrtest │ │ │ ├── Makefile │ │ │ └── mwrtest.asm │ │ ├── rom-bare-rcrtest │ │ │ ├── Makefile │ │ │ ├── c8hvuld.bat │ │ │ ├── c8hvuld.chr │ │ │ ├── rcrtest.asm │ │ │ └── testspr.png │ │ ├── rom-bare-tiatest │ │ │ ├── Makefile │ │ │ └── tiatest.asm │ │ ├── rom-core-hello │ │ │ ├── Makefile │ │ │ └── hello.asm │ │ ├── rom-core-hugerom │ │ │ ├── Makefile │ │ │ ├── hugerom.asm │ │ │ └── hugerom.s2i │ │ ├── rom-core-okitest │ │ │ ├── Makefile │ │ │ ├── core-okitest.cue │ │ │ ├── okitest.asm │ │ │ └── readme.txt │ │ ├── rom-kickc-hello │ │ │ ├── Makefile │ │ │ ├── compile.sh │ │ │ ├── hello.asm │ │ │ └── hello.c │ │ ├── rom-kickc-shmup │ │ │ ├── Makefile │ │ │ ├── bullet.pcx │ │ │ ├── charwalk.pcx │ │ │ ├── compile.sh │ │ │ ├── explosion.pcx │ │ │ ├── scene.png │ │ │ ├── ship.pcx │ │ │ ├── shmup.asm │ │ │ └── shmup.c │ │ ├── scd-bios-hello-error │ │ │ ├── Makefile │ │ │ ├── bios-hello-error.cue │ │ │ ├── error.asm │ │ │ └── hello.asm │ │ ├── scd-bios-hello │ │ │ ├── Makefile │ │ │ ├── bios-hello.cue │ │ │ └── hello.asm │ │ ├── scd-core-1stage-error │ │ │ ├── Makefile │ │ │ ├── core-1stage-error.cue │ │ │ ├── error.asm │ │ │ └── stage1.asm │ │ ├── scd-core-1stage │ │ │ ├── Makefile │ │ │ ├── core-1stage.cue │ │ │ └── stage1.asm │ │ ├── scd-core-2stage-error │ │ │ ├── Makefile │ │ │ ├── core-2stage-error.cue │ │ │ ├── error.asm │ │ │ └── stage2.asm │ │ ├── scd-core-2stage │ │ │ ├── Makefile │ │ │ ├── core-2stage.cue │ │ │ └── stage2.asm │ │ ├── scd-core-fastcd │ │ │ ├── Makefile │ │ │ ├── core-fastcd.cue │ │ │ └── fastcd.asm │ │ ├── ted2-bios-romcd │ │ │ ├── Makefile │ │ │ ├── readme.txt │ │ │ ├── syscard3-ted2.inc │ │ │ └── ted2romcd.asm │ │ ├── ted2-bios-usbcd │ │ │ ├── Makefile │ │ │ ├── readme.txt │ │ │ └── ted2usbcd.asm │ │ ├── ted2-core-gulliver │ │ │ ├── Makefile │ │ │ └── gulliver.asm │ │ ├── ted2-core-hwdetect │ │ │ ├── Makefile │ │ │ └── hwdetect.asm │ │ ├── ted2-core-sdcard │ │ │ ├── Makefile │ │ │ └── sdcard.asm │ │ └── ted2-test-sherlock │ │ │ ├── Makefile │ │ │ ├── README.txt │ │ │ ├── SHERLOCK.DAT │ │ │ ├── dat2csv.c │ │ │ ├── sherlock-hack.asm │ │ │ └── sherlock-ted2.asm │ └── make.cmd ├── huc │ ├── Make_ex.inc │ ├── Makefile │ ├── acd │ │ ├── Makefile │ │ ├── ac_test.c │ │ ├── ac_test.cue │ │ ├── pce_bat.bin │ │ ├── pce_bat1.bin │ │ ├── pce_pal.bin │ │ ├── pce_pal1.bin │ │ ├── pce_tile.bin │ │ └── pce_tile1.bin │ ├── make.cmd │ ├── overlay │ │ ├── Makefile │ │ ├── cderr.c │ │ ├── data.bin │ │ ├── data1.bin │ │ ├── globals.h │ │ ├── overlay.cue │ │ ├── prog1.c │ │ ├── prog2.c │ │ └── prog3.c │ ├── promotion │ │ ├── Makefile │ │ ├── promotion.c │ │ ├── readme.txt │ │ ├── tilemap#files.txt │ │ ├── tilemap#tiles.png │ │ ├── tilemap.pcx │ │ ├── tilemap.pmp │ │ ├── tilemap.pmp#layer~Layer 1#map001.stm │ │ └── tilemap.tlc │ ├── scroll │ │ ├── Makefile │ │ ├── scroll.c │ │ └── scroll.pcx │ ├── sgx │ │ ├── Makefile │ │ ├── pce_bat1.bin │ │ ├── pce_pal1.bin │ │ ├── pce_tile1.bin │ │ ├── sgx_test.c │ │ └── sgx_test.cue │ └── shmup │ │ ├── Makefile │ │ ├── bullet.pcx │ │ ├── charwalk.pcx │ │ ├── explosion.pcx │ │ ├── scene.png │ │ ├── ship.pcx │ │ ├── shmup.c │ │ └── shmup.cue ├── hucc │ ├── Make_ex.inc │ ├── Makefile │ ├── chrblkmap │ │ ├── Makefile │ │ ├── chrblkmap.c │ │ └── make.cmd │ ├── make.cmd │ ├── multimap │ │ ├── Makefile │ │ ├── make.cmd │ │ └── multimap.c │ ├── scroll │ │ ├── Makefile │ │ ├── make.cmd │ │ ├── scroll.c │ │ └── scroll.pcx │ ├── seran │ │ ├── README.md │ │ ├── blank.png │ │ ├── river-falls.png │ │ ├── river-froth.png │ │ ├── river-shore.gif │ │ ├── river-shore.png │ │ ├── river-water.gif │ │ ├── river-water.png │ │ ├── rpg-east-extra.png │ │ ├── rpg-east-hit.png │ │ ├── rpg-east-map.png │ │ ├── rpg-east-msk.png │ │ ├── rpg-west-basic.png │ │ ├── rpg-west-extra.png │ │ ├── rpg-west-hit.png │ │ ├── rpg-west-map.png │ │ ├── rpg-west-msk.png │ │ ├── seran-enter.png │ │ ├── seran-hit.png │ │ ├── seran-map.png │ │ ├── seran-msk.png │ │ ├── seran-shore.gif │ │ ├── seran-shore.png │ │ ├── seran-water.gif │ │ └── seran-water.png │ ├── sgx │ │ ├── Makefile │ │ ├── make.cmd │ │ ├── pce_bat1.bin │ │ ├── pce_pal1.bin │ │ ├── pce_tile1.bin │ │ ├── sgx_test.c │ │ └── sgx_test.cue │ └── shmup │ │ ├── Makefile │ │ ├── bullet.pcx │ │ ├── charwalk.pcx │ │ ├── explosion.pcx │ │ ├── make.cmd │ │ ├── scene.png │ │ ├── ship.pcx │ │ ├── shmup.c │ │ └── shmup.cue └── make.cmd ├── include ├── huc │ ├── AC.h │ ├── ac_init.asm │ ├── ac_lib.asm │ ├── cdrom.asm │ ├── cdrom.inc │ ├── equ.inc │ ├── font.inc │ ├── func.inc │ ├── huc.asm │ ├── huc.h │ ├── huc.inc │ ├── huc_bram.asm │ ├── huc_gfx.asm │ ├── huc_math.asm │ ├── huc_misc.asm │ ├── huc_opt.inc │ ├── joypad.asm │ ├── lib3_versions.asm │ ├── lib_exclude.asm │ ├── library.asm │ ├── library.inc │ ├── libslot1.asm │ ├── libslot2.asm │ ├── libslot3.asm │ ├── limits.h │ ├── macro.inc │ ├── malloc.c │ ├── math.asm │ ├── mouse.asm │ ├── scroll.asm │ ├── sgx.h │ ├── sgx_gfx.asm │ ├── sgx_load_map.asm │ ├── sound.inc │ ├── sprites.inc │ ├── st.c │ ├── st.h │ ├── standard.inc │ ├── startup.asm │ ├── startup.inc │ ├── stddef.h │ ├── stdlib.h │ ├── string.h │ ├── system.inc │ └── vdc.inc └── hucc │ ├── blkmap.asm │ ├── chrmap.asm │ ├── common.asm │ ├── core-config.inc │ ├── core-kernel.asm │ ├── core-stage1.asm │ ├── core-stage1.s2i │ ├── core-startup.asm │ ├── core.inc │ ├── data │ ├── font8x8-bold-short-ascii.dat │ └── font8x8-bold-short-iso646-fr.dat │ ├── globals.h │ ├── huc.h │ ├── hucc-baselib.asm │ ├── hucc-baselib.h │ ├── hucc-blkmap.h │ ├── hucc-chrmap.h │ ├── hucc-codegen.asm │ ├── hucc-config.inc │ ├── hucc-deprecated.inc │ ├── hucc-final-extra.asm │ ├── hucc-final.asm │ ├── hucc-gfx.asm │ ├── hucc-gfx.h │ ├── hucc-math.asm │ ├── hucc-old-line.asm │ ├── hucc-old-line.h │ ├── hucc-old-map.asm │ ├── hucc-old-map.h │ ├── hucc-old-scroll.asm │ ├── hucc-old-scroll.h │ ├── hucc-old-spr.asm │ ├── hucc-old-spr.h │ ├── hucc-printf.asm │ ├── hucc-scroll.asm │ ├── hucc-scroll.h │ ├── hucc-sound.inc │ ├── hucc-string.asm │ ├── hucc-string.h │ ├── hucc-systemcard.asm │ ├── hucc-systemcard.h │ ├── hucc-zx0.h │ ├── hucc.asm │ ├── joypad.asm │ ├── limits.h │ ├── pceas.inc │ ├── pcengine.inc │ ├── random.asm │ ├── squares.asm │ ├── stddef.h │ ├── stdio.h │ ├── stdlib.h │ ├── string.h │ ├── ted2.inc │ ├── unpack-zx0.asm │ ├── vce.asm │ └── vdc.asm ├── src ├── Make_src.inc ├── Makefile ├── Maketarg.inc ├── huc │ ├── Makefile │ ├── code.c │ ├── code.h │ ├── const.c │ ├── const.h │ ├── data.c │ ├── data.h │ ├── defs.h │ ├── enum.c │ ├── enum.h │ ├── error.c │ ├── error.h │ ├── expr.c │ ├── expr.h │ ├── fastcall.h │ ├── function.c │ ├── function.h │ ├── gen.c │ ├── gen.h │ ├── initials.c │ ├── initials.h │ ├── io.c │ ├── io.h │ ├── lex.c │ ├── lex.h │ ├── main.c │ ├── main.h │ ├── optimize.c │ ├── optimize.h │ ├── pragma.c │ ├── pragma.h │ ├── preproc.c │ ├── preproc.h │ ├── primary.c │ ├── primary.h │ ├── pseudo.c │ ├── pseudo.h │ ├── stmt.c │ ├── stmt.h │ ├── struct.c │ ├── struct.h │ ├── sym.c │ ├── sym.h │ ├── uncrustify.cfg │ ├── version.h │ ├── version.h.in │ ├── while.c │ └── while.h ├── hucc │ ├── Makefile │ ├── code.c │ ├── code.h │ ├── const.c │ ├── const.h │ ├── data.c │ ├── data.h │ ├── defs.h │ ├── enum.c │ ├── enum.h │ ├── error.c │ ├── error.h │ ├── expr.c │ ├── expr.h │ ├── fastcall.h │ ├── function.c │ ├── function.h │ ├── gen.c │ ├── gen.h │ ├── initials.c │ ├── initials.h │ ├── io.c │ ├── io.h │ ├── lex.c │ ├── lex.h │ ├── main.c │ ├── main.h │ ├── msbuild │ │ ├── hucc.sln │ │ ├── hucc.vcxproj │ │ └── hucc.vcxproj.filters │ ├── optimize.c │ ├── optimize.h │ ├── pragma.c │ ├── pragma.h │ ├── preproc.c │ ├── preproc.h │ ├── primary.c │ ├── primary.h │ ├── pseudo.c │ ├── pseudo.h │ ├── stmt.c │ ├── stmt.h │ ├── struct.c │ ├── struct.h │ ├── sym.c │ ├── sym.h │ ├── uncrustify.cfg │ ├── version.h │ ├── version.h.in │ ├── while.c │ └── while.h ├── isolink │ ├── Makefile │ ├── main.c │ ├── main.h │ └── uncrustify.cfg ├── mkit │ ├── Makefile │ ├── as │ │ ├── Makefile │ │ ├── assemble.c │ │ ├── atari.c │ │ ├── atari.h │ │ ├── code.c │ │ ├── command.c │ │ ├── crc.c │ │ ├── defs.h │ │ ├── expr.c │ │ ├── expr.h │ │ ├── externs.h │ │ ├── func.c │ │ ├── input.c │ │ ├── inst.h │ │ ├── macro.c │ │ ├── main.c │ │ ├── map.c │ │ ├── mml.c │ │ ├── msbuild │ │ │ ├── pceas.sln │ │ │ ├── pceas.vcxproj │ │ │ └── pceas.vcxproj.filters │ │ ├── nes.c │ │ ├── nes.h │ │ ├── output.c │ │ ├── overlay.h │ │ ├── pce.c │ │ ├── pce.h │ │ ├── pcx.c │ │ ├── pngreadwrite │ │ │ ├── Makefile │ │ │ ├── adler32.c │ │ │ ├── compress.c │ │ │ ├── crc32.c │ │ │ ├── crc32.h │ │ │ ├── deflate.c │ │ │ ├── deflate.h │ │ │ ├── inffast.c │ │ │ ├── inffast.h │ │ │ ├── inffixed.h │ │ │ ├── inflate.c │ │ │ ├── inflate.h │ │ │ ├── inftrees.c │ │ │ ├── inftrees.h │ │ │ ├── png.c │ │ │ ├── png.h │ │ │ ├── pngconf.h │ │ │ ├── pngdebug.h │ │ │ ├── pngerror.c │ │ │ ├── pngget.c │ │ │ ├── pnginfo.h │ │ │ ├── pnglibconf.h │ │ │ ├── pngmem.c │ │ │ ├── pngpriv.h │ │ │ ├── pngread.c │ │ │ ├── pngrio.c │ │ │ ├── pngrtran.c │ │ │ ├── pngrutil.c │ │ │ ├── pngset.c │ │ │ ├── pngstruct.h │ │ │ ├── pngtrans.c │ │ │ ├── pngusr.h │ │ │ ├── pngwio.c │ │ │ ├── pngwrite.c │ │ │ ├── pngwtran.c │ │ │ ├── pngwutil.c │ │ │ ├── readme.txt │ │ │ ├── trees.c │ │ │ ├── trees.h │ │ │ ├── zconf.h │ │ │ ├── zlib.h │ │ │ ├── zutil.c │ │ │ └── zutil.h │ │ ├── proc.c │ │ ├── protos.h │ │ ├── salvador │ │ │ ├── LICENSE.cc0.md │ │ │ ├── LICENSE.divsufsort.md │ │ │ ├── LICENSE.salvador.md │ │ │ ├── LICENSE.zlib.md │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── README.salvador.md │ │ │ ├── divsufsort.c │ │ │ ├── divsufsort.h │ │ │ ├── divsufsort_config.h │ │ │ ├── divsufsort_private.h │ │ │ ├── divsufsort_utils.c │ │ │ ├── format.h │ │ │ ├── libsalvador.h │ │ │ ├── matchfinder.c │ │ │ ├── matchfinder.h │ │ │ ├── shrink.c │ │ │ ├── shrink.h │ │ │ ├── sssort.c │ │ │ └── trsort.c │ │ ├── symbol.c │ │ ├── uncrustify.cfg │ │ ├── vars.h │ │ ├── version.h │ │ ├── version.h.in │ │ ├── xgetopt.c │ │ └── xgetopt.h │ ├── develo │ │ ├── Makefile │ │ ├── execmx.c │ │ ├── getrom.c │ │ ├── lib │ │ │ ├── Makefile │ │ │ ├── command.c │ │ │ ├── crc16.h │ │ │ ├── develo.h │ │ │ ├── error.c │ │ │ ├── init.c │ │ │ ├── mx.c │ │ │ ├── slave.c │ │ │ └── xfer.c │ │ └── perun.c │ ├── index.txt │ └── readme.txt ├── plugins │ ├── Makefile │ ├── huremap │ │ ├── Makefile │ │ ├── huremap.c │ │ ├── msbuild │ │ │ ├── huremap.sln │ │ │ ├── huremap.vcxproj │ │ │ └── huremap.vcxproj.filters │ │ └── remap.txt │ ├── husetpalette │ │ ├── Makefile │ │ ├── husetpalette.c │ │ ├── msbuild │ │ │ ├── husetpalette.sln │ │ │ ├── husetpalette.vcxproj │ │ │ └── husetpalette.vcxproj.filters │ │ ├── resource.h │ │ ├── resource.rc │ │ └── targetver.h │ ├── huzerozero │ │ ├── Makefile │ │ ├── huzerozero.c │ │ └── msbuild │ │ │ ├── huzerozero.sln │ │ │ ├── huzerozero.vcxproj │ │ │ └── huzerozero.vcxproj.filters │ └── plugins.ini └── tools │ ├── Makefile │ ├── hulz │ ├── Makefile │ ├── elmer.h │ ├── hulz.c │ └── targetver.h │ ├── mml │ ├── BEAST.MML │ ├── LABYRINT.MML │ ├── Makefile │ ├── SAPHIRE.MML │ ├── STEP.MML │ ├── TAKOIKA.MML │ └── mml.c │ ├── mod2mml │ ├── Makefile │ ├── analyze.c │ ├── analyze.h │ ├── mod2mml.c │ ├── mod2mml.h │ ├── uncrustify.cfg │ └── waves.c │ ├── pce2png │ ├── LICENSE_1_0.TXT │ ├── Makefile │ ├── README.md │ ├── bmpfile.c │ ├── bmpfile.h │ ├── elmer.h │ ├── errorcode.c │ ├── errorcode.h │ ├── lexer.c │ ├── lexer.h │ ├── mappedfile.c │ ├── mappedfile.h │ ├── msbuild │ │ ├── pce2png.sln │ │ ├── pce2png.vcxproj │ │ └── pce2png.vcxproj.filters │ ├── msinttypes │ │ ├── inttypes.h │ │ ├── readme.txt │ │ ├── stdbool.h │ │ └── stdint.h │ ├── pce2png.c │ ├── pce2png.h │ ├── pcxfile.c │ ├── pcxfile.h │ ├── pngfile.c │ ├── pngfile.h │ ├── pngwrite │ │ ├── Makefile │ │ ├── adler32.c │ │ ├── compress.c │ │ ├── crc32.c │ │ ├── crc32.h │ │ ├── deflate.c │ │ ├── deflate.h │ │ ├── png.c │ │ ├── png.h │ │ ├── pngconf.h │ │ ├── pngdebug.h │ │ ├── pngerror.c │ │ ├── pngget.c │ │ ├── pnginfo.h │ │ ├── pnglibconf.h │ │ ├── pngmem.c │ │ ├── pngpriv.h │ │ ├── pngset.c │ │ ├── pngstruct.h │ │ ├── pngtrans.c │ │ ├── pngusr.h │ │ ├── pngwio.c │ │ ├── pngwrite.c │ │ ├── pngwtran.c │ │ ├── pngwutil.c │ │ ├── readme.txt │ │ ├── trees.c │ │ ├── trees.h │ │ ├── zconf.h │ │ ├── zlib.h │ │ ├── zutil.c │ │ └── zutil.h │ ├── pxlmap.c │ ├── pxlmap.h │ ├── sysid.c │ ├── sysid.h │ └── targetver.h │ ├── pcxtool │ ├── Makefile │ └── pcxtool.c │ ├── sym2inc │ ├── LICENSE_1_0.txt │ ├── Makefile │ ├── README.md │ ├── elmer.h │ ├── strlcat.c │ ├── strlcpy.c │ ├── sym2inc.c │ └── targetver.h │ └── wav2vox │ ├── LICENSE_1_0.TXT │ ├── Makefile │ ├── adpcmoki.c │ ├── adpcmoki.h │ ├── elmer.h │ ├── riffio.c │ ├── riffio.h │ ├── targetver.h │ ├── wav2vox.c │ └── wav2vox.h ├── test ├── csum_examples.sh ├── dg │ ├── 20000108-1.c │ ├── 20000623-1.c │ ├── 20010912-1.c │ ├── 20020206-1.c │ ├── 20020210-1.c │ ├── 20020525-1.c │ ├── 20021014-1.c │ ├── 20030805-1.c │ ├── 20031216-1.c │ ├── 980523-1.c │ ├── c99-func-1.c │ ├── c99-func-3.c │ ├── char-compare.c │ ├── doloop-2.c │ ├── fold-abs-2.c │ ├── ftrapv-1.c │ ├── fwrapv-1.c │ ├── loop-2.c │ ├── nrv1.c │ ├── postincr-1.c │ ├── pr10392-1.c │ ├── pr11864-1.c │ ├── pr18241-3.c │ ├── pr18241-4.c │ ├── pr18241-5.c │ ├── pr18921-1.c │ ├── pr20100.c │ ├── pr20115.c │ ├── pr20126.c │ ├── pr26729-1.c │ ├── pr27363.c │ ├── pr27671-2.c │ ├── pr29581-1.c │ ├── pr29581-2.c │ ├── pr29581-3.c │ ├── pr29581-4.c │ ├── pr30286.c │ ├── pr32450.c │ ├── pr33017.c │ ├── pr33676.c │ ├── pr9814-1.c │ ├── short-compare-1.c │ ├── sibcall-7.c │ ├── sms-1.c │ ├── switch-warn-1.c │ ├── switch-warn-2.c │ └── unroll-1.c ├── manual │ ├── overlay.cue │ ├── overlay.sh │ ├── overlay1.c │ └── overlay2.c ├── rsize ├── test_compiler.sh ├── test_examples.sh ├── test_hucc.sh └── tests │ ├── 20000205-1.c │ ├── 20000217-1.c │ ├── 20000224-1.c │ ├── 20000225-1.c │ ├── 20000313-1.c │ ├── 20000314-1.c │ ├── 20000314-3.c │ ├── 20000412-1.c │ ├── 20000412-2.c │ ├── 20000412-6.c │ ├── 20000511-1.c │ ├── 20000605-2.c │ ├── 20000703-1.c │ ├── 20000706-3.c │ ├── 20000706-4.c │ ├── 20000715-1.c │ ├── 20000715-2.c │ ├── 20000717-3.c │ ├── 20000717-4.c │ ├── 20000722-1.c │ ├── 20000726-1.c │ ├── 20000731-2.c │ ├── 20000801-1.c │ ├── 20000801-2.c │ ├── 20000818-1.c │ ├── 20000819-1.c │ ├── 20000910-1.c │ ├── 20001009-1.c │ ├── 20001009-2.c │ ├── 20001011-1.c │ ├── 20001013-1.c │ ├── 20001027-1.c │ ├── 20001130-1.c │ ├── 20001130-2.c │ ├── 20001228-1.c │ ├── 20010106-1.c │ ├── 20010116-1.c │ ├── 20010119-1.c │ ├── 20010206-1.c │ ├── 20010221-1.c │ ├── 20010222-1.c │ ├── 20010224-1.c │ ├── 20010403-1.c │ ├── 20010409-1.c │ ├── 20010422-1.c │ ├── 20010518-1.c │ ├── 20010520-1.c │ ├── 20010605-1.c │ ├── 20010711-1.c │ ├── 20010723-1.c │ ├── 20010910-1.c │ ├── 20010915-1.c │ ├── 20010925-1.c │ ├── 20011008-2.c │ ├── 20011019-1.c │ ├── 20011024-1.c │ ├── 20011109-2.c │ ├── 20011114-1.c │ ├── 20011115-1.c │ ├── 20011121-1.c │ ├── 20011126-2.c │ ├── 20011223-1.c │ ├── 20020107-1.c │ ├── 20020216-1.c │ ├── 20020328-1.c │ ├── 20020402-1.c │ ├── 20020418-1.c │ ├── 20020423-1.c │ ├── 20020517-1.c │ ├── 20020529-1.c │ ├── 20020614-1.c │ ├── 20020716-1.c │ ├── 20020805-1.c │ ├── 20020819-1.c │ ├── 20020904-1.c │ ├── 20020911-1.c │ ├── 20020916-1.c │ ├── 20021010-1.c │ ├── 20021011-1.c │ ├── 20021015-1.c │ ├── 20021111-1.c │ ├── 20021118-3.c │ ├── 20021119-1.c │ ├── 20021120-2.c │ ├── 20021204-1.c │ ├── 20021219-1.c │ ├── 20030105-1.c │ ├── 20030117-1.c │ ├── 20030120-2.c │ ├── 20030128-1.c │ ├── 20030203-1.c │ ├── 20030323-1.c │ ├── 20030401-1.c │ ├── 20030404-1.c │ ├── 20030606-1.c │ ├── 20030715-1.c │ ├── 20030718-1.c │ ├── 20030821-1.c │ ├── 20030828-1.c │ ├── 20030828-2.c │ ├── 20030903-1.c │ ├── 20030909-1.c │ ├── 20030913-1.c │ ├── 20030916-1.c │ ├── 20030920-1.c │ ├── 20031011-1.c │ ├── 20031012-1.c │ ├── 20040223-1.c │ ├── 20040309-1.c │ ├── 20040311-1.c │ ├── 20040319-1.c │ ├── 20040409-1.c │ ├── 20040409-2.c │ ├── 20040409-3.c │ ├── 20040625-1.c │ ├── 20040704-1.c │ ├── 20040706-1.c │ ├── 20040820-1.c │ ├── 20040823-1.c │ ├── 20040917-1.c │ ├── 20041019-1.c │ ├── 20041112-1.c │ ├── 20041126-1.c │ ├── 20041210-1.c │ ├── 20041212-1.c │ ├── 20041213-2.c │ ├── 20050106-1.c │ ├── 20050107-1.c │ ├── 20050119-1.c │ ├── 20050119-2.c │ ├── 20050124-1.c │ ├── 20050125-1.c │ ├── 20050131-1.c │ ├── 20050203-1.c │ ├── 20050218-1.c │ ├── 20050410-1.c │ ├── 20050502-2.c │ ├── 20050826-1.c │ ├── 20050826-2.c │ ├── 20051021-1.c │ ├── 20051104-1.c │ ├── 20051215-1.c │ ├── 20060102-1.c │ ├── 20060910-1.c │ ├── 20060929-1.c │ ├── 20060930-1.c │ ├── 20060930-2.c │ ├── 20061031-1.c │ ├── 20061101-1.c │ ├── 20070212-1.c │ ├── 20070212-2.c │ ├── 20070212-3.c │ ├── 20070424-1.c │ ├── 20070517-1.c │ ├── 20070623-1.c │ ├── 20071011-1.c │ ├── 20200414.c │ ├── 20200415.c │ ├── 20200415_asm1.asm │ ├── 20200415_asm2.asm │ ├── 20200415_asm3.asm │ ├── 20210724.c │ ├── 920202-1.c │ ├── 920409-1.c │ ├── 920428-1.c │ ├── 920429-1.c │ ├── 920501-1.c │ ├── 920501-3.c │ ├── 920506-1.c │ ├── 920520-1.c │ ├── 920603-1.c │ ├── 920612-1.c │ ├── 920612-2.c │ ├── 920721-3.c │ ├── 920730-1.c │ ├── 920731-1.c │ ├── 920810-1.c │ ├── 920812-1.c │ ├── 920909-1.c │ ├── 921006-1.c │ ├── 921123-1.c │ ├── 921207-1.c │ ├── 921218-1.c │ ├── 930123-1.c │ ├── 930408-1.c │ ├── 930429-1.c │ ├── 930429-2.c │ ├── 930513-2.c │ ├── 930518-1.c │ ├── 930526-1.c │ ├── 930527-1.c │ ├── 930529-1.c │ ├── 930622-1.c │ ├── 930719-1.c │ ├── 930725-1.c │ ├── 930916-1.c │ ├── 930929-1.c │ ├── 931009-1.c │ ├── 931012-1.c │ ├── 931017-1.c │ ├── 931102-1.c │ ├── 931110-2.c │ ├── 931228-1.c │ ├── 940115-1.c │ ├── 940122-1.c │ ├── 941101-1.c │ ├── 941110-1.c │ ├── 950322-1.c │ ├── 950426-1.c │ ├── 950605-1.c │ ├── 950621-1.c │ ├── 950706-1.c │ ├── 950714-1.c │ ├── 950809-1.c │ ├── 950929-1.c │ ├── 951003-1.c │ ├── 951115-1.c │ ├── 951204-1.c │ ├── 960218-1.c │ ├── 960219-1.c │ ├── 960311-1.c │ ├── 960311-2.c │ ├── 960312-1.c │ ├── 960317-1.c │ ├── 960419-1.c │ ├── 960521-1.c │ ├── 960830-1.c │ ├── 960909-1.c │ ├── 961004-1.c │ ├── 961017-1.c │ ├── 961026-1.c │ ├── 961112-1.c │ ├── 961122-2.c │ ├── 961125-1.c │ ├── 970923-1.c │ ├── 980424-1.c │ ├── 980505-1.c │ ├── 980505-2.c │ ├── 980506-1.c │ ├── 980506-2.c │ ├── 980506-3.c │ ├── 980526-3.c │ ├── 980602-1.c │ ├── 980617-1.c │ ├── 980618-1.c │ ├── 980701-1.c │ ├── 980707-1.c │ ├── 980929-1.c │ ├── 981019-1.c │ ├── 981130-1.c │ ├── 981206-1.c │ ├── 990106-1.c │ ├── 990106-2.c │ ├── 990127-1.c │ ├── 990208-1.c │ ├── 990211-1.c │ ├── 990222-1.c │ ├── 990404-1.c │ ├── 990513-1.c │ ├── 990524-1.c │ ├── 990527-1.c │ ├── 990604-1.c │ ├── 990628-1.c │ ├── 990804-1.c │ ├── 990827-1.c │ ├── 991023-1.c │ ├── 991202-1.c │ ├── 991202-3.c │ ├── 991216-4.c │ ├── 991227-1.c │ ├── align-1.c │ ├── anon-1.c │ ├── arith-1.c │ ├── compare-1.c │ ├── compare-2.c │ ├── compare-3.c │ ├── conv-3.c │ ├── divcmp-1.c │ ├── divcmp-2.c │ ├── divcmp-3.c │ ├── divcmp-4.c │ ├── divcmp-5.c │ ├── divconst-1.c │ ├── enum-1.c │ ├── enum-2.c │ ├── enum-3.c │ ├── ffs-1.c │ ├── huc-addb.c │ ├── huc-addbi.c │ ├── huc-addub.c │ ├── huc-addxs.c │ ├── huc-asm.c │ ├── huc-asr.c │ ├── huc-blocklocal.c │ ├── huc-byteconst.c │ ├── huc-conditionals.c │ ├── huc-constexpr.c │ ├── huc-enum1.c │ ├── huc-enum2.c │ ├── huc-farptr.c │ ├── huc-farptr2.c │ ├── huc-fastcallnested.c │ ├── huc-faststack.c │ ├── huc-ffs.c │ ├── huc-fptr.c │ ├── huc-fptr2.c │ ├── huc-funcptr.c │ ├── huc-glbptrptr.c │ ├── huc-goto1.c │ ├── huc-gt.c │ ├── huc-idx1.c │ ├── huc-idx2.c │ ├── huc-init1.c │ ├── huc-init2.c │ ├── huc-init3.c │ ├── huc-init4.c │ ├── huc-init5.c │ ├── huc-init6.c │ ├── huc-init7.c │ ├── huc-init8.c │ ├── huc-init9.c │ ├── huc-ldby.c │ ├── huc-load_map-huc.bmp │ ├── huc-load_map-hucc.bmp │ ├── huc-load_map.c │ ├── huc-lstatic1.c │ ├── huc-lstatic2.c │ ├── huc-macro.c │ ├── huc-mod.c │ ├── huc-namespace.c │ ├── huc-neq.c │ ├── huc-nestedstruct.c │ ├── huc-nestedstruct2.c │ ├── huc-octal.c │ ├── huc-preprocont.c │ ├── huc-preproelif.c │ ├── huc-preproif.c │ ├── huc-prepronest.c │ ├── huc-ptrptr1.c │ ├── huc-ptrptr2.c │ ├── huc-put_stuff-huc.bmp │ ├── huc-put_stuff-hucc.bmp │ ├── huc-put_stuff.c │ ├── huc-retptr.c │ ├── huc-sizeof1.c │ ├── huc-sizeofparen.c │ ├── huc-sizeofstruct.c │ ├── huc-sprintf.c │ ├── huc-stbi.c │ ├── huc-strn.c │ ├── huc-structmul.c │ ├── huc-stws.c │ ├── huc-typedef.c │ ├── huc-varptrarr.c │ ├── huc-vram.c │ ├── huc-zerostruct.c │ ├── inst-check.c │ ├── int-compare.c │ ├── loop-1.c │ ├── loop-10.c │ ├── loop-11.c │ ├── loop-12.c │ ├── loop-14.c │ ├── loop-2.c │ ├── loop-2b.c │ ├── loop-2c.c │ ├── loop-2d.c │ ├── loop-2f.c │ ├── loop-2g.c │ ├── loop-3.c │ ├── loop-3b.c │ ├── loop-3c.c │ ├── loop-5.c │ ├── loop-6.c │ ├── loop-7.c │ ├── loop-9.c │ ├── loop-ivopts-2.c │ ├── mayalias-1.c │ ├── mayalias-2.c │ ├── mayalias-3.c │ ├── medce-1.c │ ├── memcpy-1.c │ ├── memcpy-bi.c │ ├── minmax-1.c │ ├── mod-1.c │ ├── packed-1.c │ ├── pending-4.c │ ├── pr16790-1.c │ ├── pr17078-1.c │ ├── pr17133.c │ ├── pr17252.c │ ├── pr19005.c │ ├── pr19606.c │ ├── pr20100-1.c │ ├── pr20466-1.c │ ├── pr21173.c │ ├── pr21964-1.c │ ├── pr22348.c │ ├── pr22429.c │ ├── pr22493-1.c │ ├── pr22630.c │ ├── pr23047.c │ ├── pr23518.c │ ├── pr23604.c │ ├── pr24141.c │ ├── pr24142.c │ ├── pr24716.c │ ├── pr24851.c │ ├── pr25125.c │ ├── pr25737.c │ ├── pr27073.c │ ├── pr27260.c │ ├── pr27285.c │ ├── pr27364.c │ ├── pr27671-1.c │ ├── pr28651.c │ ├── pr29797-1.c │ ├── pr31605.c │ ├── pr32500.c │ ├── pr7284-1.c │ ├── pragma-pack-3.c │ ├── ptr-arith-1.c │ ├── pure-1.c │ ├── shiftopt-1.c │ ├── short-compare-2.c │ ├── strct-pack-2.c │ ├── strct-pack-3.c │ ├── strct-pack-4.c │ ├── string-opt-17.c │ ├── struct-ret-2.c │ ├── switch-1.c │ ├── unaligned-1.c │ ├── unroll-1.c │ ├── usmul.c │ ├── vrp-1.c │ ├── vrp-2.c │ ├── vrp-3.c │ ├── vrp-4.c │ ├── vrp-5.c │ ├── vrp-6.c │ ├── zerolen-1.c │ └── zerolen-2.c ├── tgemu ├── Makefile ├── game.c └── src │ ├── bitflip.h │ ├── changelog │ ├── cpu │ ├── cpuintrf.h │ ├── h6280.c │ ├── h6280.h │ ├── h6280ops.h │ ├── osd_cpu.h │ └── tblh6280.c │ ├── fileio.c │ ├── fileio.h │ ├── license │ ├── makefile │ ├── pce.c │ ├── pce.h │ ├── pcecrc.h │ ├── porting.txt │ ├── psg.c │ ├── psg.h │ ├── readme.txt │ ├── render.c │ ├── render.h │ ├── shared.h │ ├── system.c │ ├── system.h │ ├── types.h │ ├── unix │ └── osd.h │ ├── vce.c │ ├── vce.h │ ├── vdc.c │ └── vdc.h ├── things.todo └── whats.new /BSDmakefile: -------------------------------------------------------------------------------- 1 | # Hack to run gmake if using bmake on a BSD system. 2 | 3 | .if "$(.MAKE.JOBS)" != "" 4 | JOBS = -j$(.MAKE.JOBS) 5 | .endif 6 | 7 | .PHONY: all clean examples test check package 8 | 9 | all clean examples test check package: 10 | gmake $(JOBS) $@ 11 | -------------------------------------------------------------------------------- /doc/huc/clibref_fr.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/doc/huc/clibref_fr.txt -------------------------------------------------------------------------------- /doc/pce/usage-3.25.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/doc/pce/usage-3.25.txt -------------------------------------------------------------------------------- /examples/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for examples 3 | # 4 | 5 | SUBDIRS = hucc huc asm 6 | 7 | all clean: 8 | @$(MAKE) $(SUBDIRS) "COMMAND=$@" 9 | 10 | .PHONY: $(SUBDIRS) 11 | 12 | $(SUBDIRS): 13 | @echo " " 14 | @echo " -----> make $(COMMAND) in $@" 15 | $(MAKE) --directory=$@ $(COMMAND) 16 | 17 | -------------------------------------------------------------------------------- /examples/asm/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for examples/asm 3 | # 4 | 5 | SUBDIRS = elmer 6 | 7 | all clean: 8 | @$(MAKE) $(SUBDIRS) "COMMAND=$@" 9 | 10 | .PHONY: $(SUBDIRS) 11 | 12 | $(SUBDIRS): 13 | @echo " " 14 | @echo " -----> make $(COMMAND) in $@" 15 | $(MAKE) --directory=$@ $(COMMAND) 16 | -------------------------------------------------------------------------------- /examples/asm/elmer/.gitignore: -------------------------------------------------------------------------------- 1 | *.s 2 | *.o 3 | *.bin 4 | *.pce 5 | *.sgx 6 | *.ovl 7 | *.iso 8 | *.lst 9 | *.sym 10 | -------------------------------------------------------------------------------- /examples/asm/elmer/cd-core-1stage/Makefile: -------------------------------------------------------------------------------- 1 | all: core-1stage.iso 2 | 3 | include ../Make_ex.inc 4 | 5 | AFLAGS ?= --overlay --newproc --strip -m -l 2 -S -gL 6 | 7 | SRC_INC = pceas.inc pcengine.inc core.inc core-startup.asm core-kernel.asm joypad.asm 8 | SRC_OVL = stage1.asm core-config.inc 9 | 10 | SRC_ISO = stage1.ovl 11 | 12 | core-1stage.iso: $(SRC_ISO) 13 | $(IL) core-1stage.iso --ipl="1-Stage CD" $(SRC_ISO) 14 | 15 | stage1.ovl: $(SRC_OVL) $(SRC_INC) 16 | $(AS) $(AFLAGS) --cd stage1.asm 17 | -------------------------------------------------------------------------------- /examples/asm/elmer/cd-core-1stage/core-1stage.cue: -------------------------------------------------------------------------------- 1 | FILE core-1stage.iso BINARY 2 | TRACK 01 MODE1/2048 3 | INDEX 01 00:00:00 4 | -------------------------------------------------------------------------------- /examples/asm/elmer/cd-core-2stage/core-2stage.cue: -------------------------------------------------------------------------------- 1 | FILE core-2stage.iso BINARY 2 | TRACK 01 MODE1/2048 3 | INDEX 01 00:00:00 4 | -------------------------------------------------------------------------------- /examples/asm/elmer/cd-core-scsitest/core-scsitest.cue: -------------------------------------------------------------------------------- 1 | FILE test-tone.wav WAVE 2 | TRACK 01 AUDIO 3 | INDEX 01 00:00:00 4 | FILE core-scsitest.iso BINARY 5 | TRACK 02 MODE1/2048 6 | INDEX 01 00:00:00 7 | -------------------------------------------------------------------------------- /examples/asm/elmer/cd-core-scsitest/test-tone.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/cd-core-scsitest/test-tone.wav -------------------------------------------------------------------------------- /examples/asm/elmer/data/alice.ram: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/data/alice.ram -------------------------------------------------------------------------------- /examples/asm/elmer/data/alice.vdc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/data/alice.vdc -------------------------------------------------------------------------------- /examples/asm/elmer/data/error-bkg-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/data/error-bkg-16.png -------------------------------------------------------------------------------- /examples/asm/elmer/data/error-bkg-31.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/data/error-bkg-31.png -------------------------------------------------------------------------------- /examples/asm/elmer/data/error-spr-15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/data/error-spr-15.png -------------------------------------------------------------------------------- /examples/asm/elmer/data/pointer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/data/pointer.png -------------------------------------------------------------------------------- /examples/asm/elmer/data/pointer.spr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/data/pointer.spr -------------------------------------------------------------------------------- /examples/asm/elmer/data/red_queen-16k.vox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/data/red_queen-16k.vox -------------------------------------------------------------------------------- /examples/asm/elmer/data/saz_vce.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/data/saz_vce.zx0 -------------------------------------------------------------------------------- /examples/asm/elmer/data/saz_vdc.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/data/saz_vdc.zx0 -------------------------------------------------------------------------------- /examples/asm/elmer/data/saz_vdc.zx0.256: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/data/saz_vdc.zx0.256 -------------------------------------------------------------------------------- /examples/asm/elmer/data/testspr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/data/testspr.png -------------------------------------------------------------------------------- /examples/asm/elmer/data/texture.chr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/data/texture.chr -------------------------------------------------------------------------------- /examples/asm/elmer/data/texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/data/texture.png -------------------------------------------------------------------------------- /examples/asm/elmer/data/umbrella-16k.vox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/data/umbrella-16k.vox -------------------------------------------------------------------------------- /examples/asm/elmer/doc/iso-646.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/doc/iso-646.txt -------------------------------------------------------------------------------- /examples/asm/elmer/font/font8x12-syscard.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/font/font8x12-syscard.dat -------------------------------------------------------------------------------- /examples/asm/elmer/font/font8x12-syscard.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/font/font8x12-syscard.fon -------------------------------------------------------------------------------- /examples/asm/elmer/font/font8x16-syscard-bold.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/font/font8x16-syscard-bold.dat -------------------------------------------------------------------------------- /examples/asm/elmer/font/font8x16-syscard-bold.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/font/font8x16-syscard-bold.fon -------------------------------------------------------------------------------- /examples/asm/elmer/font/font8x16-syscard-bold.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/font/font8x16-syscard-bold.zx0 -------------------------------------------------------------------------------- /examples/asm/elmer/font/font8x8-ascii-bold-short.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/font/font8x8-ascii-bold-short.dat -------------------------------------------------------------------------------- /examples/asm/elmer/font/font8x8-ascii-bold-short.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/font/font8x8-ascii-bold-short.fon -------------------------------------------------------------------------------- /examples/asm/elmer/font/font8x8-ascii-bold-short.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/font/font8x8-ascii-bold-short.zx0 -------------------------------------------------------------------------------- /examples/asm/elmer/font/font8x8-ascii-exos.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/font/font8x8-ascii-exos.fon -------------------------------------------------------------------------------- /examples/asm/elmer/font/font8x8-ascii-exos.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/font/font8x8-ascii-exos.zx0 -------------------------------------------------------------------------------- /examples/asm/elmer/font/font8x8-bold-short-etswst-pt.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/font/font8x8-bold-short-etswst-pt.fon -------------------------------------------------------------------------------- /examples/asm/elmer/font/font8x8-bold-short-iso646-de.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/font/font8x8-bold-short-iso646-de.fon -------------------------------------------------------------------------------- /examples/asm/elmer/font/font8x8-bold-short-iso646-en.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/font/font8x8-bold-short-iso646-en.fon -------------------------------------------------------------------------------- /examples/asm/elmer/font/font8x8-bold-short-iso646-es.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/font/font8x8-bold-short-iso646-es.fon -------------------------------------------------------------------------------- /examples/asm/elmer/font/font8x8-bold-short-iso646-fr.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/font/font8x8-bold-short-iso646-fr.fon -------------------------------------------------------------------------------- /examples/asm/elmer/font/font8x8-bold-short-iso646-it.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/font/font8x8-bold-short-iso646-it.fon -------------------------------------------------------------------------------- /examples/asm/elmer/font/font8x8-bold-short-iso646-jp.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/font/font8x8-bold-short-iso646-jp.fon -------------------------------------------------------------------------------- /examples/asm/elmer/font/font8x8-stage1-exos.dat: -------------------------------------------------------------------------------- 1 | |ff|``0?fff><>`<|~6kkcfff><<f>>ff><>ff>8< -------------------------------------------------------------------------------- /examples/asm/elmer/font/font8x8-stage1-exos.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/font/font8x8-stage1-exos.fon -------------------------------------------------------------------------------- /examples/asm/elmer/font/font8x8-syscard3.fon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/font/font8x8-syscard3.fon -------------------------------------------------------------------------------- /examples/asm/elmer/include/ipl-scd.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/include/ipl-scd.dat -------------------------------------------------------------------------------- /examples/asm/elmer/ipl-scd/Makefile: -------------------------------------------------------------------------------- 1 | all: ../include/ipl-scd.dat 2 | 3 | include ../Make_ex.inc 4 | 5 | SRC = ipl-scd.asm ../font/font8x8-ascii-exos.dat 6 | 7 | AFLAGS ?= --raw -m -l 2 -S 8 | 9 | ipl-scd.out: $(SRC) 10 | $(AS) $(AFLAGS) --ipl ipl-scd.asm -o ipl-scd.out 11 | 12 | ../include/ipl-scd.dat: ipl-scd.out 13 | ifeq ($(CP),copy) 14 | $(CP) ipl-scd.out ..\include\ipl-scd.dat 15 | else 16 | $(CP) ipl-scd.out ../include/ipl-scd.dat 17 | endif 18 | -------------------------------------------------------------------------------- /examples/asm/elmer/kickc/pce.ld: -------------------------------------------------------------------------------- 1 | ; PCEAS setup for assembling a KickC program. 2 | .include "kickc.asm" 3 | .kickc 4 | -------------------------------------------------------------------------------- /examples/asm/elmer/kickc/pce.tgt: -------------------------------------------------------------------------------- 1 | { 2 | "description": "NEC PC Engine (assembles with PCEAS).", 3 | "cpu": "HUC6280", 4 | "interrupt": "hardware_all", 5 | "link": "pce.ld", 6 | "encoding": "ascii", 7 | "start_address": "0xA000", 8 | "zp_reserve": [ "0x00..0x3F", "0xEC..0xFF" ], 9 | "extension": "bin", 10 | "emulator": "mednafen", 11 | "defines": { 12 | "__PCE__": 1 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /examples/asm/elmer/rom-bare-buftest/Makefile: -------------------------------------------------------------------------------- 1 | all: buftest.pce 2 | 3 | include ../Make_ex.inc 4 | 5 | AFLAGS ?= --newproc --strip -m -l 2 -S -gA 6 | 7 | SRC_INC = pceas.inc pcengine.inc joypad.asm tty.asm vce.asm vdc.asm 8 | SRC_OVL = buftest.asm 9 | 10 | buftest.pce: $(SRC_OVL) $(SRC_INC) 11 | $(AS) $(AFLAGS) --raw buftest.asm 12 | -------------------------------------------------------------------------------- /examples/asm/elmer/rom-bare-dmatest/Makefile: -------------------------------------------------------------------------------- 1 | all: dmatest.pce 2 | 3 | include ../Make_ex.inc 4 | 5 | AFLAGS ?= --newproc --strip -m -l 2 -S -gA 6 | 7 | SRC_INC = pceas.inc pcengine.inc joypad.asm tty.asm vce.asm vdc.asm 8 | SRC_OVL = dmatest.asm 9 | 10 | dmatest.pce: $(SRC_OVL) $(SRC_INC) 11 | $(AS) $(AFLAGS) --raw dmatest.asm 12 | -------------------------------------------------------------------------------- /examples/asm/elmer/rom-bare-hello/Makefile: -------------------------------------------------------------------------------- 1 | all: hello.pce 2 | 3 | include ../Make_ex.inc 4 | 5 | AFLAGS ?= --newproc --strip -m -l 2 -S -gA 6 | 7 | SRC_INC = pceas.inc pcengine.inc core.inc core-startup.asm core-kernel.asm joypad.asm 8 | SRC_OVL = hello.asm core-config.inc 9 | 10 | hello.pce: $(SRC_OVL) $(SRC_INC) 11 | $(AS) $(AFLAGS) --raw hello.asm 12 | -------------------------------------------------------------------------------- /examples/asm/elmer/rom-bare-mwrtest/Makefile: -------------------------------------------------------------------------------- 1 | all: mwrtest.pce 2 | 3 | include ../Make_ex.inc 4 | 5 | AFLAGS ?= --newproc --strip -m -l 2 -S -gA 6 | 7 | SRC_INC = pceas.inc pcengine.inc joypad.asm tty.asm vce.asm vdc.asm 8 | SRC_OVL = mwrtest.asm 9 | 10 | mwrtest.pce: $(SRC_OVL) $(SRC_INC) 11 | $(AS) $(AFLAGS) --raw mwrtest.asm 12 | -------------------------------------------------------------------------------- /examples/asm/elmer/rom-bare-rcrtest/Makefile: -------------------------------------------------------------------------------- 1 | all: rcrtest.pce 2 | 3 | include ../Make_ex.inc 4 | 5 | AFLAGS ?= --newproc --strip -m -l 2 -S -gA 6 | 7 | SRC_INC = pceas.inc pcengine.inc joypad.asm tty.asm vce.asm vdc.asm 8 | SRC_OVL = rcrtest.asm 9 | 10 | rcrtest.pce: $(SRC_OVL) $(SRC_INC) 11 | $(AS) $(AFLAGS) --raw rcrtest.asm 12 | -------------------------------------------------------------------------------- /examples/asm/elmer/rom-bare-rcrtest/c8hvuld.chr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/rom-bare-rcrtest/c8hvuld.chr -------------------------------------------------------------------------------- /examples/asm/elmer/rom-bare-rcrtest/testspr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/rom-bare-rcrtest/testspr.png -------------------------------------------------------------------------------- /examples/asm/elmer/rom-bare-tiatest/Makefile: -------------------------------------------------------------------------------- 1 | all: tiatest.pce 2 | 3 | include ../Make_ex.inc 4 | 5 | AFLAGS ?= --newproc --strip -m -l 2 -S -gA 6 | 7 | SRC_INC = pceas.inc pcengine.inc joypad.asm tty.asm vce.asm vdc.asm 8 | SRC_OVL = tiatest.asm 9 | 10 | tiatest.pce: $(SRC_OVL) $(SRC_INC) 11 | $(AS) $(AFLAGS) --raw tiatest.asm 12 | -------------------------------------------------------------------------------- /examples/asm/elmer/rom-core-hello/Makefile: -------------------------------------------------------------------------------- 1 | all: hello.pce 2 | 3 | include ../Make_ex.inc 4 | 5 | AFLAGS ?= --newproc --strip -m -l 2 -S -gA 6 | 7 | SRC_INC = pceas.inc pcengine.inc core.inc core-startup.asm core-kernel.asm joypad.asm 8 | SRC_OVL = hello.asm core-config.inc 9 | 10 | hello.pce: $(SRC_OVL) $(SRC_INC) 11 | $(AS) $(AFLAGS) --raw hello.asm 12 | -------------------------------------------------------------------------------- /examples/asm/elmer/rom-core-okitest/core-okitest.cue: -------------------------------------------------------------------------------- 1 | FILE core-okitest.iso BINARY 2 | TRACK 01 MODE1/2048 3 | INDEX 01 00:00:00 4 | -------------------------------------------------------------------------------- /examples/asm/elmer/rom-kickc-hello/Makefile: -------------------------------------------------------------------------------- 1 | all: hello.pce 2 | 3 | include ../Make_ex.inc 4 | 5 | AFLAGS ?= --kc --newproc --strip -m -l 2 -S -gA 6 | 7 | SRC_INC = pceas.inc pcengine.inc core.inc core-startup.asm core-kernel.asm joypad.asm kickc.asm kickc-final.asm 8 | SRC_OVL = hello.asm core-config.inc 9 | 10 | hello.pce: $(SRC_OVL) $(SRC_INC) 11 | $(AS) $(AFLAGS) --raw hello.asm 12 | -------------------------------------------------------------------------------- /examples/asm/elmer/rom-kickc-hello/compile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ~/test/kickc/bin/kickc.sh -Sl -Onolongbranchfix -P ../kickc -I ../kickc hello.c 3 | -------------------------------------------------------------------------------- /examples/asm/elmer/rom-kickc-shmup/Makefile: -------------------------------------------------------------------------------- 1 | all: shmup.pce 2 | 3 | include ../Make_ex.inc 4 | 5 | AFLAGS ?= --kc --newproc --strip -m -l 2 -S -gA 6 | 7 | SRC_INC = pceas.inc pcengine.inc core.inc core-startup.asm core-kernel.asm joypad.asm kickc.asm kickc-final.asm 8 | SRC_OVL = shmup.asm core-config.inc 9 | 10 | shmup.pce: $(SRC_OVL) $(SRC_INC) 11 | $(AS) $(AFLAGS) --raw shmup.asm 12 | -------------------------------------------------------------------------------- /examples/asm/elmer/rom-kickc-shmup/bullet.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/rom-kickc-shmup/bullet.pcx -------------------------------------------------------------------------------- /examples/asm/elmer/rom-kickc-shmup/charwalk.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/rom-kickc-shmup/charwalk.pcx -------------------------------------------------------------------------------- /examples/asm/elmer/rom-kickc-shmup/compile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ~/test/kickc/bin/kickc.sh -Sl -Onolongbranchfix -P ../kickc -I ../kickc shmup.c 3 | -------------------------------------------------------------------------------- /examples/asm/elmer/rom-kickc-shmup/explosion.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/rom-kickc-shmup/explosion.pcx -------------------------------------------------------------------------------- /examples/asm/elmer/rom-kickc-shmup/scene.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/rom-kickc-shmup/scene.png -------------------------------------------------------------------------------- /examples/asm/elmer/rom-kickc-shmup/ship.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/rom-kickc-shmup/ship.pcx -------------------------------------------------------------------------------- /examples/asm/elmer/scd-bios-hello-error/bios-hello-error.cue: -------------------------------------------------------------------------------- 1 | FILE bios-hello-error.iso BINARY 2 | TRACK 01 MODE1/2048 3 | INDEX 01 00:00:00 4 | -------------------------------------------------------------------------------- /examples/asm/elmer/scd-bios-hello/Makefile: -------------------------------------------------------------------------------- 1 | all: bios-hello.iso 2 | 3 | include ../Make_ex.inc 4 | 5 | AFLAGS ?= --overlay --newproc --strip -m -l 2 -S -gA 6 | 7 | SRC_INC = pceas.inc pcengine.inc 8 | SRC_OVL = hello.asm 9 | 10 | SRC_ISO = hello.ovl 11 | 12 | bios-hello.iso: $(SRC_ISO) 13 | $(IL) bios-hello.iso --boot="../include/ipl-scd.dat" --ipl="Hello SuperCD" $(SRC_ISO) 14 | 15 | hello.ovl: $(SRC_OVL) $(SRC_INC) 16 | $(AS) $(AFLAGS) --scd hello.asm 17 | -------------------------------------------------------------------------------- /examples/asm/elmer/scd-bios-hello/bios-hello.cue: -------------------------------------------------------------------------------- 1 | FILE bios-hello.iso BINARY 2 | TRACK 01 MODE1/2048 3 | INDEX 01 00:00:00 4 | -------------------------------------------------------------------------------- /examples/asm/elmer/scd-core-1stage-error/core-1stage-error.cue: -------------------------------------------------------------------------------- 1 | FILE core-1stage-error.iso BINARY 2 | TRACK 01 MODE1/2048 3 | INDEX 01 00:00:00 4 | -------------------------------------------------------------------------------- /examples/asm/elmer/scd-core-1stage/Makefile: -------------------------------------------------------------------------------- 1 | all: core-1stage.iso 2 | 3 | include ../Make_ex.inc 4 | 5 | AFLAGS ?= --overlay --newproc --strip -m -l 2 -S -gA 6 | 7 | SRC_INC = pceas.inc pcengine.inc core.inc core-startup.asm core-kernel.asm joypad.asm 8 | SRC_OVL = stage1.asm core-config.inc 9 | 10 | SRC_ISO = stage1.ovl 11 | 12 | core-1stage.iso: $(SRC_ISO) 13 | $(IL) core-1stage.iso --ipl="1-Stage SuperCD" $(SRC_ISO) 14 | 15 | stage1.ovl: $(SRC_OVL) $(SRC_INC) 16 | $(AS) $(AFLAGS) --scd stage1.asm 17 | -------------------------------------------------------------------------------- /examples/asm/elmer/scd-core-1stage/core-1stage.cue: -------------------------------------------------------------------------------- 1 | FILE core-1stage.iso BINARY 2 | TRACK 01 MODE1/2048 3 | INDEX 01 00:00:00 4 | -------------------------------------------------------------------------------- /examples/asm/elmer/scd-core-2stage-error/core-2stage-error.cue: -------------------------------------------------------------------------------- 1 | FILE core-2stage-error.iso BINARY 2 | TRACK 01 MODE1/2048 3 | INDEX 01 00:00:00 4 | -------------------------------------------------------------------------------- /examples/asm/elmer/scd-core-2stage/core-2stage.cue: -------------------------------------------------------------------------------- 1 | FILE core-2stage.iso BINARY 2 | TRACK 01 MODE1/2048 3 | INDEX 01 00:00:00 4 | -------------------------------------------------------------------------------- /examples/asm/elmer/scd-core-fastcd/core-fastcd.cue: -------------------------------------------------------------------------------- 1 | FILE core-fastcd.iso BINARY 2 | TRACK 01 MODE1/2048 3 | INDEX 01 00:00:00 4 | -------------------------------------------------------------------------------- /examples/asm/elmer/ted2-core-gulliver/Makefile: -------------------------------------------------------------------------------- 1 | all: gulliver.pce gulliver.ovl 2 | 3 | include ../Make_ex.inc 4 | 5 | AFLAGS ?= -newproc -strip -m -l 2 -S 6 | 7 | SRC_INC = pceas.inc pcengine.inc core.inc core-startup.asm core-kernel.asm joypad.asm adpcm.asm cdrom.asm movie.asm 8 | SRC_OVL = gulliver.asm core-config.inc 9 | 10 | gulliver.ovl: $(SRC_OVL) $(SRC_INC) gulliver.pce 11 | $(AS) $(AFLAGS) -scd -overlay gulliver.asm 12 | 13 | gulliver.pce: $(SRC_OVL) $(SRC_INC) 14 | $(AS) $(AFLAGS) gulliver.asm 15 | -------------------------------------------------------------------------------- /examples/asm/elmer/ted2-core-hwdetect/Makefile: -------------------------------------------------------------------------------- 1 | all: hwdetect.sgx 2 | 3 | include ../Make_ex.inc 4 | 5 | AFLAGS ?= --newproc --strip -m -l 2 -S -gA 6 | 7 | SRC_INC = pceas.inc pcengine.inc core.inc core-startup.asm core-kernel.asm joypad.asm tty.asm 8 | SRC_OVL = hwdetect.asm core-config.inc 9 | 10 | hwdetect.sgx: $(SRC_OVL) $(SRC_INC) 11 | $(AS) $(AFLAGS) --sgx --raw hwdetect.asm 12 | -------------------------------------------------------------------------------- /examples/asm/elmer/ted2-core-sdcard/Makefile: -------------------------------------------------------------------------------- 1 | all: sdcard.pce 2 | 3 | include ../Make_ex.inc 4 | 5 | AFLAGS ?= --newproc --strip -m -l 2 -S 6 | 7 | SRC_INC = pceas.inc pcengine.inc core.inc core-startup.asm core-kernel.asm joypad.asm tty.asm crc32.asm ted2.asm ted2-sd.asm ted2-fat32.asm 8 | SRC_OVL = sdcard.asm core-config.inc 9 | 10 | sdcard.pce: $(SRC_OVL) $(SRC_INC) 11 | $(AS) $(AFLAGS) --raw sdcard.asm 12 | -------------------------------------------------------------------------------- /examples/asm/elmer/ted2-test-sherlock/SHERLOCK.DAT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/asm/elmer/ted2-test-sherlock/SHERLOCK.DAT -------------------------------------------------------------------------------- /examples/huc/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for examples 3 | # 4 | 5 | SUBDIRS = acd promotion scroll sgx shmup overlay 6 | 7 | all clean: 8 | @$(MAKE) $(SUBDIRS) "COMMAND=$@" 9 | 10 | .PHONY: $(SUBDIRS) 11 | 12 | $(SUBDIRS): 13 | @echo " " 14 | @echo " -----> make $(COMMAND) in $@" 15 | $(MAKE) --directory=$@ $(COMMAND) 16 | 17 | -------------------------------------------------------------------------------- /examples/huc/acd/Makefile: -------------------------------------------------------------------------------- 1 | all: ac_test.iso 2 | 3 | include ../Make_ex.inc 4 | 5 | SRC = ac_test.c 6 | 7 | CFLAGS ?= -v -acd -over -sgx -fno-recursive -msmall 8 | 9 | ac_test.ovl: $(SRC) 10 | $(CC) $(CFLAGS) $(SRC) $(LIBS) 11 | 12 | ac_test.iso: ac_test.ovl 13 | $(IL) $@ -sgx -ipl="ArcadeCard Test" $^ pce_tile.bin pce_bat.bin pce_pal.bin 14 | -------------------------------------------------------------------------------- /examples/huc/acd/ac_test.cue: -------------------------------------------------------------------------------- 1 | FILE ac_test.iso BINARY 2 | TRACK 01 MODE1/2048 3 | INDEX 01 00:00:00 4 | -------------------------------------------------------------------------------- /examples/huc/acd/pce_bat.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/huc/acd/pce_bat.bin -------------------------------------------------------------------------------- /examples/huc/acd/pce_bat1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/huc/acd/pce_bat1.bin -------------------------------------------------------------------------------- /examples/huc/acd/pce_pal.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/huc/acd/pce_pal.bin -------------------------------------------------------------------------------- /examples/huc/acd/pce_pal1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/huc/acd/pce_pal1.bin -------------------------------------------------------------------------------- /examples/huc/acd/pce_tile.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/huc/acd/pce_tile.bin -------------------------------------------------------------------------------- /examples/huc/acd/pce_tile1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/huc/acd/pce_tile1.bin -------------------------------------------------------------------------------- /examples/huc/overlay/Makefile: -------------------------------------------------------------------------------- 1 | all: overlay.iso 2 | 3 | include ../Make_ex.inc 4 | 5 | SRC = prog1.c prog2.c prog3.c 6 | OBJ = prog1.ovl prog2.ovl prog3.ovl 7 | DATA = data.bin data1.bin 8 | 9 | #CFLAGS ?= -v -fno-recursive -msmall -over 10 | CFLAGS ?= -v -msmall -over 11 | 12 | cderr.ovl: cderr.c 13 | $(CC) $(CFLAGS) -cd $< 14 | 15 | %.ovl: %.c 16 | $(CC) $(CFLAGS) -scd $< 17 | 18 | overlay.iso: $(OBJ) cderr.ovl 19 | $(IL) $@ $(OBJ) $(DATA) -cderr cderr.ovl 20 | -------------------------------------------------------------------------------- /examples/huc/overlay/data.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/huc/overlay/data.bin -------------------------------------------------------------------------------- /examples/huc/overlay/data1.bin: -------------------------------------------------------------------------------- 1 | 2 |  -------------------------------------------------------------------------------- /examples/huc/overlay/globals.h: -------------------------------------------------------------------------------- 1 | #define OVL_BOOT 0 2 | #define OVL_PROG1 1 3 | #define OVL_PROG2 2 4 | #define OVL_PROG3 3 5 | #define OVL_VIDEODATA 4 6 | #define OVL_CHARDATA 5 7 | 8 | 9 | char vram_loaded; 10 | 11 | -------------------------------------------------------------------------------- /examples/huc/overlay/overlay.cue: -------------------------------------------------------------------------------- 1 | FILE "overlay.iso" BINARY 2 | TRACK 1 MODE1/2048 3 | INDEX 1 00:00:00 4 | -------------------------------------------------------------------------------- /examples/huc/promotion/Makefile: -------------------------------------------------------------------------------- 1 | all: promotion.pce 2 | 3 | include ../Make_ex.inc 4 | 5 | SRC = promotion.c 6 | 7 | CFLAGS ?= -fno-recursive -msmall 8 | 9 | promotion.pce: $(SRC) 10 | $(CC) $(CFLAGS) $(SRC) $(LIBS) 11 | -------------------------------------------------------------------------------- /examples/huc/promotion/tilemap#files.txt: -------------------------------------------------------------------------------- 1 | tilemap#tiles.png 2 | tilemap.tlc 3 | .\tilemap.pmp#layer~Layer 1#map001.stm 4 | -------------------------------------------------------------------------------- /examples/huc/promotion/tilemap#tiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/huc/promotion/tilemap#tiles.png -------------------------------------------------------------------------------- /examples/huc/promotion/tilemap.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/huc/promotion/tilemap.pcx -------------------------------------------------------------------------------- /examples/huc/promotion/tilemap.pmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/huc/promotion/tilemap.pmp -------------------------------------------------------------------------------- /examples/huc/promotion/tilemap.pmp#layer~Layer 1#map001.stm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/huc/promotion/tilemap.pmp#layer~Layer 1#map001.stm -------------------------------------------------------------------------------- /examples/huc/promotion/tilemap.tlc: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/huc/scroll/Makefile: -------------------------------------------------------------------------------- 1 | all: scroll.pce 2 | 3 | include ../Make_ex.inc 4 | 5 | SRC = scroll.c 6 | 7 | CFLAGS ?= -fno-recursive -msmall 8 | 9 | scroll.pce: $(SRC) 10 | $(CC) $(CFLAGS) $(SRC) $(LIBS) 11 | -------------------------------------------------------------------------------- /examples/huc/scroll/scroll.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/huc/scroll/scroll.pcx -------------------------------------------------------------------------------- /examples/huc/sgx/Makefile: -------------------------------------------------------------------------------- 1 | all: sgx_test.iso sgx_test.sgx 2 | 3 | include ../Make_ex.inc 4 | 5 | SRC = sgx_test.c 6 | 7 | CFLAGS ?= -sgx -fno-recursive -msmall 8 | CDFLAGS = -scd 9 | 10 | sgx_test.iso: $(SRC) sgx_test.sgx 11 | $(CC) $(CFLAGS) $(CDFLAGS) $(SRC) $(LIBS) 12 | 13 | sgx_test.sgx: $(SRC) 14 | $(CC) $(CFLAGS) $(SRC) $(LIBS) 15 | $(MV) sgx_test.pce $@ 16 | -------------------------------------------------------------------------------- /examples/huc/sgx/pce_bat1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/huc/sgx/pce_bat1.bin -------------------------------------------------------------------------------- /examples/huc/sgx/pce_pal1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/huc/sgx/pce_pal1.bin -------------------------------------------------------------------------------- /examples/huc/sgx/pce_tile1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/huc/sgx/pce_tile1.bin -------------------------------------------------------------------------------- /examples/huc/sgx/sgx_test.cue: -------------------------------------------------------------------------------- 1 | FILE sgx_test.iso BINARY 2 | TRACK 01 MODE1/2048 3 | INDEX 01 00:00:00 4 | -------------------------------------------------------------------------------- /examples/huc/shmup/Makefile: -------------------------------------------------------------------------------- 1 | all: shmup.pce shmup.iso 2 | 3 | include ../Make_ex.inc 4 | 5 | CFLAGS = -msmall -fno-recursive 6 | LIBS = 7 | 8 | shmup.pce: shmup.c 9 | $(CC) -fsigned-char $(CFLAGS) $(LIBS) $< 10 | 11 | shmup.iso: shmup.c shmup.pce 12 | $(CC) -scd -fsigned-char $(CFLAGS) $(LIBS) $< 13 | -------------------------------------------------------------------------------- /examples/huc/shmup/bullet.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/huc/shmup/bullet.pcx -------------------------------------------------------------------------------- /examples/huc/shmup/charwalk.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/huc/shmup/charwalk.pcx -------------------------------------------------------------------------------- /examples/huc/shmup/explosion.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/huc/shmup/explosion.pcx -------------------------------------------------------------------------------- /examples/huc/shmup/scene.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/huc/shmup/scene.png -------------------------------------------------------------------------------- /examples/huc/shmup/ship.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/huc/shmup/ship.pcx -------------------------------------------------------------------------------- /examples/huc/shmup/shmup.cue: -------------------------------------------------------------------------------- 1 | FILE "shmup.iso" BINARY 2 | TRACK 1 MODE1/2048 3 | INDEX 1 00:00:00 4 | -------------------------------------------------------------------------------- /examples/hucc/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for examples 3 | # 4 | 5 | SUBDIRS = scroll sgx shmup chrblkmap multimap 6 | 7 | all clean: 8 | @$(MAKE) $(SUBDIRS) "COMMAND=$@" 9 | 10 | .PHONY: $(SUBDIRS) 11 | 12 | $(SUBDIRS): 13 | @echo " " 14 | @echo " -----> make $(COMMAND) in $@" 15 | $(MAKE) --directory=$@ $(COMMAND) 16 | -------------------------------------------------------------------------------- /examples/hucc/chrblkmap/Makefile: -------------------------------------------------------------------------------- 1 | all: chrblkmap.pce 2 | 3 | include ../Make_ex.inc 4 | 5 | SRC = chrblkmap.c 6 | 7 | CFLAGS ?= -v -O2 -fno-recursive -gL 8 | 9 | chrblkmap.pce: $(SRC) 10 | $(CC) $(CFLAGS) $(SRC) $(LIBS) 11 | -------------------------------------------------------------------------------- /examples/hucc/multimap/Makefile: -------------------------------------------------------------------------------- 1 | all: multimap.pce 2 | 3 | include ../Make_ex.inc 4 | 5 | SRC = multimap.c 6 | 7 | CFLAGS ?= -v -O2 -fno-recursive -gL 8 | 9 | multimap.pce: $(SRC) 10 | $(CC) $(CFLAGS) $(SRC) $(LIBS) 11 | -------------------------------------------------------------------------------- /examples/hucc/scroll/Makefile: -------------------------------------------------------------------------------- 1 | all: scroll.pce 2 | 3 | include ../Make_ex.inc 4 | 5 | SRC = scroll.c 6 | 7 | CFLAGS ?= -v -O2 -fno-recursive -gC 8 | 9 | scroll.pce: $(SRC) 10 | $(CC) $(CFLAGS) $(SRC) $(LIBS) 11 | -------------------------------------------------------------------------------- /examples/hucc/scroll/scroll.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/scroll/scroll.pcx -------------------------------------------------------------------------------- /examples/hucc/seran/blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/seran/blank.png -------------------------------------------------------------------------------- /examples/hucc/seran/river-falls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/seran/river-falls.png -------------------------------------------------------------------------------- /examples/hucc/seran/river-froth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/seran/river-froth.png -------------------------------------------------------------------------------- /examples/hucc/seran/river-shore.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/seran/river-shore.gif -------------------------------------------------------------------------------- /examples/hucc/seran/river-shore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/seran/river-shore.png -------------------------------------------------------------------------------- /examples/hucc/seran/river-water.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/seran/river-water.gif -------------------------------------------------------------------------------- /examples/hucc/seran/river-water.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/seran/river-water.png -------------------------------------------------------------------------------- /examples/hucc/seran/rpg-east-extra.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/seran/rpg-east-extra.png -------------------------------------------------------------------------------- /examples/hucc/seran/rpg-east-hit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/seran/rpg-east-hit.png -------------------------------------------------------------------------------- /examples/hucc/seran/rpg-east-map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/seran/rpg-east-map.png -------------------------------------------------------------------------------- /examples/hucc/seran/rpg-east-msk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/seran/rpg-east-msk.png -------------------------------------------------------------------------------- /examples/hucc/seran/rpg-west-basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/seran/rpg-west-basic.png -------------------------------------------------------------------------------- /examples/hucc/seran/rpg-west-extra.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/seran/rpg-west-extra.png -------------------------------------------------------------------------------- /examples/hucc/seran/rpg-west-hit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/seran/rpg-west-hit.png -------------------------------------------------------------------------------- /examples/hucc/seran/rpg-west-map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/seran/rpg-west-map.png -------------------------------------------------------------------------------- /examples/hucc/seran/rpg-west-msk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/seran/rpg-west-msk.png -------------------------------------------------------------------------------- /examples/hucc/seran/seran-enter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/seran/seran-enter.png -------------------------------------------------------------------------------- /examples/hucc/seran/seran-hit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/seran/seran-hit.png -------------------------------------------------------------------------------- /examples/hucc/seran/seran-map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/seran/seran-map.png -------------------------------------------------------------------------------- /examples/hucc/seran/seran-msk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/seran/seran-msk.png -------------------------------------------------------------------------------- /examples/hucc/seran/seran-shore.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/seran/seran-shore.gif -------------------------------------------------------------------------------- /examples/hucc/seran/seran-shore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/seran/seran-shore.png -------------------------------------------------------------------------------- /examples/hucc/seran/seran-water.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/seran/seran-water.gif -------------------------------------------------------------------------------- /examples/hucc/seran/seran-water.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/seran/seran-water.png -------------------------------------------------------------------------------- /examples/hucc/sgx/Makefile: -------------------------------------------------------------------------------- 1 | all: sgx_test.sgx sgx_test.iso 2 | 3 | include ../Make_ex.inc 4 | 5 | SRC = sgx_test.c 6 | 7 | CFLAGS ?= -O2 --sgx -fno-recursive -gA -v 8 | CDFLAGS = --scd 9 | LIBS = 10 | 11 | sgx_test.iso: $(SRC) 12 | $(CC) $(CFLAGS) $(CDFLAGS) $< $(LIBS) 13 | 14 | sgx_test.sgx: $(SRC) sgx_test.iso 15 | $(CC) $(CFLAGS) $< $(LIBS) 16 | -------------------------------------------------------------------------------- /examples/hucc/sgx/pce_bat1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/sgx/pce_bat1.bin -------------------------------------------------------------------------------- /examples/hucc/sgx/pce_pal1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/sgx/pce_pal1.bin -------------------------------------------------------------------------------- /examples/hucc/sgx/pce_tile1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/sgx/pce_tile1.bin -------------------------------------------------------------------------------- /examples/hucc/sgx/sgx_test.cue: -------------------------------------------------------------------------------- 1 | FILE sgx_test.iso BINARY 2 | TRACK 01 MODE1/2048 3 | INDEX 01 00:00:00 4 | -------------------------------------------------------------------------------- /examples/hucc/shmup/Makefile: -------------------------------------------------------------------------------- 1 | all: shmup.sgx shmup.iso 2 | 3 | include ../Make_ex.inc 4 | 5 | CFLAGS = -O2 --sgx -fno-recursive -gC -v 6 | CDFLAGS = --scd 7 | LIBS = 8 | 9 | shmup.iso: shmup.c 10 | $(CC) $(CFLAGS) $(CDFLAGS) $< $(LIBS) 11 | 12 | shmup.sgx: shmup.c shmup.iso 13 | $(CC) $(CFLAGS) $(LIBS) $< 14 | -------------------------------------------------------------------------------- /examples/hucc/shmup/bullet.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/shmup/bullet.pcx -------------------------------------------------------------------------------- /examples/hucc/shmup/charwalk.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/shmup/charwalk.pcx -------------------------------------------------------------------------------- /examples/hucc/shmup/explosion.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/shmup/explosion.pcx -------------------------------------------------------------------------------- /examples/hucc/shmup/scene.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/shmup/scene.png -------------------------------------------------------------------------------- /examples/hucc/shmup/ship.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/examples/hucc/shmup/ship.pcx -------------------------------------------------------------------------------- /examples/hucc/shmup/shmup.cue: -------------------------------------------------------------------------------- 1 | FILE "shmup.iso" BINARY 2 | TRACK 1 MODE1/2048 3 | INDEX 1 00:00:00 4 | -------------------------------------------------------------------------------- /include/huc/lib_exclude.asm: -------------------------------------------------------------------------------- 1 | 2 | ; This is a place holder file. Override this with the same file in your project directory. 3 | ; This file is included as the first thing in startup.asm. If you need defines and macros 4 | ; to appear at the top, this is how you get them there without editing startup.asm 5 | 6 | ; This also services to enable/disable parts of the library via defines/equates. -------------------------------------------------------------------------------- /include/huc/libslot1.asm: -------------------------------------------------------------------------------- 1 | 2 | ; This is a place holder file for custom library include on the asm side. To use this feature, have a file with the same name as 3 | ; this in your project directory and huc will pull from that instead. 4 | -------------------------------------------------------------------------------- /include/huc/libslot2.asm: -------------------------------------------------------------------------------- 1 | 2 | ; This is a place holder file for custom library include on the asm side. To use this feature, have a file with the same name as 3 | ; this in your project directory and huc will pull from that instead. 4 | -------------------------------------------------------------------------------- /include/huc/libslot3.asm: -------------------------------------------------------------------------------- 1 | 2 | ; This is a place holder file for custom library include on the asm side. To use this feature, have a file with the same name as 3 | ; this in your project directory and huc will pull from that instead. 4 | -------------------------------------------------------------------------------- /include/huc/limits.h: -------------------------------------------------------------------------------- 1 | #define INT_MAX 32767 2 | #define INT_MIN -32768 3 | #define UINT_MAX 65535 4 | #define __CHAR_BIT__ 8 5 | #define UCHAR_MAX 255 6 | #define SCHAR_MAX 127 7 | -------------------------------------------------------------------------------- /include/huc/standard.inc: -------------------------------------------------------------------------------- 1 | ; 2 | ; STANDARD.INC - MagicKit standard include file 3 | ; 4 | .include "equ.inc" 5 | .include "macro.inc" 6 | .include "func.inc" 7 | .include "library.inc" 8 | .include "sprites.inc" 9 | .include "vdc.inc" 10 | .include "startup.inc" 11 | -------------------------------------------------------------------------------- /include/huc/stddef.h: -------------------------------------------------------------------------------- 1 | #define NULL (0) 2 | -------------------------------------------------------------------------------- /include/huc/stdlib.h: -------------------------------------------------------------------------------- 1 | #define RAND_MAX 32767 2 | -------------------------------------------------------------------------------- /include/huc/string.h: -------------------------------------------------------------------------------- 1 | /* dummy include file */ 2 | -------------------------------------------------------------------------------- /include/hucc/data/font8x8-bold-short-ascii.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/include/hucc/data/font8x8-bold-short-ascii.dat -------------------------------------------------------------------------------- /include/hucc/data/font8x8-bold-short-iso646-fr.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/include/hucc/data/font8x8-bold-short-iso646-fr.dat -------------------------------------------------------------------------------- /include/hucc/limits.h: -------------------------------------------------------------------------------- 1 | #define INT_MAX 32767 2 | #define INT_MIN -32768 3 | #define UINT_MAX 65535 4 | #define __CHAR_BIT__ 8 5 | #define UCHAR_MAX 255 6 | #define SCHAR_MAX 127 7 | -------------------------------------------------------------------------------- /include/hucc/stddef.h: -------------------------------------------------------------------------------- 1 | #define NULL (0) 2 | -------------------------------------------------------------------------------- /include/hucc/stdlib.h: -------------------------------------------------------------------------------- 1 | #define RAND_MAX 32767 2 | -------------------------------------------------------------------------------- /include/hucc/string.h: -------------------------------------------------------------------------------- 1 | /* dummy include file */ 2 | -------------------------------------------------------------------------------- /src/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for HuC sources 3 | # 4 | 5 | SUBDIRS = huc hucc mkit isolink tools plugins 6 | 7 | all clean: 8 | @$(MAKE) $(SUBDIRS) "COMMAND=$@" 9 | 10 | .PHONY: $(SUBDIRS) 11 | 12 | $(SUBDIRS): 13 | @echo " " 14 | @echo " -----> make $(COMMAND) in $@" 15 | $(MAKE) --directory=$@ $(COMMAND) 16 | 17 | -------------------------------------------------------------------------------- /src/huc/enum.h: -------------------------------------------------------------------------------- 1 | int define_enum (char *sname, int storage); 2 | int find_enum_type (char *name); 3 | int find_enum (char *sname, intptr_t *val); 4 | -------------------------------------------------------------------------------- /src/huc/error.h: -------------------------------------------------------------------------------- 1 | #ifndef _INCLUDE_ERROR_H 2 | #define _INCLUDE_ERROR_H 3 | 4 | void error (char *); 5 | void warning (int, char *); 6 | 7 | void doerror (char *, int); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/huc/fastcall.h: -------------------------------------------------------------------------------- 1 | /* defines */ 2 | #define TYPE_ACC 0x00 3 | #define TYPE_BYTE 0x01 4 | #define TYPE_WORD 0x02 5 | #define TYPE_FARPTR 0x03 6 | #define TYPE_DWORD 0x04 7 | 8 | extern struct fastcall ftemp; 9 | extern struct fastcall *fastcall_tbl[256]; 10 | -------------------------------------------------------------------------------- /src/huc/initials.h: -------------------------------------------------------------------------------- 1 | #include "defs.h" 2 | void add_data_initials (char *symbol_name, int type, int value, TAG_SYMBOL *tag); 3 | int get_item_at (char *symbol_name, int position, TAG_SYMBOL *tag); 4 | int get_size (char *symbol_name); 5 | int find_symbol_initials (char *symbol_name); 6 | -------------------------------------------------------------------------------- /src/huc/optimize.h: -------------------------------------------------------------------------------- 1 | /* File opt.c: 2.1 (83/03/20,16:02:09) */ 2 | /*% cc -O -c % 3 | * 4 | */ 5 | 6 | #ifndef _OPTIMIZE_H 7 | #define _OPTIMIZE_H 8 | 9 | void push_ins (INS *ins); 10 | void flush_ins (void); 11 | void flush_ins_label (int nextlabel); 12 | void gen_asm (INS *inst); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /src/huc/pseudo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * pseudo.h 3 | */ 4 | 5 | #ifndef _PSEUDO_H 6 | #define _PSEUDO_H 7 | 8 | void dopsdinc (void); 9 | void dopsddef (void); 10 | intptr_t outcomma (void); 11 | intptr_t outnameunderline (void); 12 | intptr_t outconst (void); 13 | void doset_bgpalstatement (void); 14 | void doset_sprpalstatement (void); 15 | void doload_spritesstatement (void); 16 | void doload_backgroundstatement (void); 17 | void do_asm_func (intptr_t type); 18 | char *new_string (intptr_t und, char *a); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/huc/struct.h: -------------------------------------------------------------------------------- 1 | int find_tag (char *sname); 2 | int define_struct (char *sname, int storage, int is_struct); 3 | void add_member (char *sname, char identity, char type, int offset, int storage_class, int otag, int ptr_order); 4 | -------------------------------------------------------------------------------- /src/huc/version.h: -------------------------------------------------------------------------------- 1 | #ifndef HUC_VERSION_H 2 | #define HUC_VERSION_H 3 | 4 | #ifndef GIT_VERSION 5 | # define GIT_VERSION "dummy" 6 | #endif /* !GIT_VERSION */ 7 | 8 | #ifndef GIT_DATE 9 | # define GIT_DATE "1987/10/30" 10 | #endif /* !GIT_DATE */ 11 | 12 | #endif /* HUC_VERSION_H */ 13 | -------------------------------------------------------------------------------- /src/huc/version.h.in: -------------------------------------------------------------------------------- 1 | #ifndef HUC_VERSION_H 2 | #define HUC_VERSION_H 3 | 4 | #ifndef GIT_VERSION 5 | # define GIT_VERSION "@GIT_VERSION@" 6 | #endif /* !GIT_VERSION */ 7 | 8 | #ifndef GIT_DATE 9 | # define GIT_DATE @GIT_DATE@ 10 | #endif /* !GIT_DATE */ 11 | 12 | #endif /* HUC_VERSION_H */ 13 | -------------------------------------------------------------------------------- /src/huc/while.h: -------------------------------------------------------------------------------- 1 | #ifndef _WHILE_H 2 | #define _WHILE_H 3 | 4 | void addwhile (intptr_t *ptr); 5 | void delwhile (void); 6 | intptr_t *readwhile (void); 7 | intptr_t *findwhile (void); 8 | intptr_t *readswitch (void); 9 | void addcase (intptr_t val); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/hucc/const.h: -------------------------------------------------------------------------------- 1 | /* File const.h: 2.1 (00/07/17,16:02:19) */ 2 | /*% cc -O -c % 3 | * 4 | */ 5 | 6 | #ifndef _CONST_H 7 | #define _CONST_H 8 | 9 | void new_const (void); 10 | void add_const (char typ); 11 | int array_initializer (char typ, char id, char stor, int k); 12 | int scalar_initializer (char typ, char id, char stor); 13 | int get_string_ptr (char typ); 14 | int get_raw_value (char sep); 15 | int add_buffer (char *p, char c, int is_address); 16 | void dump_const (void); 17 | char *get_const (SYMBOL *); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/hucc/enum.h: -------------------------------------------------------------------------------- 1 | int define_enum (char *sname, int storage); 2 | int find_enum_type (char *name); 3 | int find_enum (char *sname, int *val); 4 | -------------------------------------------------------------------------------- /src/hucc/error.h: -------------------------------------------------------------------------------- 1 | #ifndef _INCLUDE_ERROR_H 2 | #define _INCLUDE_ERROR_H 3 | 4 | void error (char *); 5 | void warning (int, char *); 6 | 7 | void doerror (char *, int); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/hucc/fastcall.h: -------------------------------------------------------------------------------- 1 | /* defines */ 2 | #define TYPE_BYTEACC 0x00 3 | #define TYPE_WORDACC 0x01 4 | #define TYPE_BYTE 0x02 5 | #define TYPE_WORD 0x03 6 | #define TYPE_FARPTR 0x04 7 | #define TYPE_DWORD 0x05 8 | 9 | extern struct fastcall ftemp; 10 | extern struct fastcall *fastcall_tbl[256]; 11 | -------------------------------------------------------------------------------- /src/hucc/initials.h: -------------------------------------------------------------------------------- 1 | #include "defs.h" 2 | void add_data_initials (char *symbol_name, int type, int value, TAG_SYMBOL *tag); 3 | int get_item_at (char *symbol_name, int position, TAG_SYMBOL *tag); 4 | int get_size (char *symbol_name); 5 | int find_symbol_initials (char *symbol_name); 6 | -------------------------------------------------------------------------------- /src/hucc/pseudo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * pseudo.h 3 | */ 4 | 5 | #ifndef _PSEUDO_H 6 | #define _PSEUDO_H 7 | 8 | void dopsdinc (void); 9 | void dopsddef (void); 10 | void do_asm_func (int type); 11 | char *new_string (int und, char *a); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /src/hucc/struct.h: -------------------------------------------------------------------------------- 1 | int find_tag (char *sname); 2 | int define_struct (char *sname, int storage, int is_struct); 3 | void add_member (char *sname, char identity, char type, int offset, int storage_class, int otag, int ptr_order, int funcptr_type, int funcptr_order, int arg_count); 4 | -------------------------------------------------------------------------------- /src/hucc/version.h: -------------------------------------------------------------------------------- 1 | #ifndef HUC_VERSION_H 2 | #define HUC_VERSION_H 3 | 4 | #ifndef GIT_VERSION 5 | # define GIT_VERSION "dummy" 6 | #endif /* !GIT_VERSION */ 7 | 8 | #ifndef GIT_DATE 9 | # define GIT_DATE "1987/10/30" 10 | #endif /* !GIT_DATE */ 11 | 12 | #endif /* HUC_VERSION_H */ 13 | -------------------------------------------------------------------------------- /src/hucc/version.h.in: -------------------------------------------------------------------------------- 1 | #ifndef HUC_VERSION_H 2 | #define HUC_VERSION_H 3 | 4 | #ifndef GIT_VERSION 5 | # define GIT_VERSION "@GIT_VERSION@" 6 | #endif /* !GIT_VERSION */ 7 | 8 | #ifndef GIT_DATE 9 | # define GIT_DATE @GIT_DATE@ 10 | #endif /* !GIT_DATE */ 11 | 12 | #endif /* HUC_VERSION_H */ 13 | -------------------------------------------------------------------------------- /src/hucc/while.h: -------------------------------------------------------------------------------- 1 | #ifndef _WHILE_H 2 | #define _WHILE_H 3 | 4 | void addwhile (int *ptr); 5 | void delwhile (void); 6 | int *readwhile (void); 7 | int *findwhile (void); 8 | int *readswitch (void); 9 | void addcase (int val); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/isolink/main.h: -------------------------------------------------------------------------------- 1 | 2 | #define ISOLINK_VERSION "isolink (" GIT_VERSION ", " GIT_DATE ")" 3 | 4 | 5 | #ifdef _WIN32 6 | #define PATH_SEPARATOR ';' 7 | #define DIR_SEPARATOR '\\' 8 | #define DIR_SEPARATOR_STRING "\\" 9 | #else 10 | #define PATH_SEPARATOR ':' 11 | #define DIR_SEPARATOR '/' 12 | #define DIR_SEPARATOR_STRING "/" 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /src/isolink/uncrustify.cfg: -------------------------------------------------------------------------------- 1 | indent_columns = 3 2 | indent_with_tabs = 0 3 | nl_func_type_name = force 4 | sp_after_ptr_star = remove 5 | nl_func_var_def_blk = 1 6 | nl_if_brace = remove 7 | nl_for_brace = remove 8 | nl_else_brace = remove 9 | sp_else_brace = force 10 | nl_brace_else = remove 11 | sp_brace_else = force 12 | sp_arith = force 13 | -------------------------------------------------------------------------------- /src/mkit/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for HuC sources 3 | # 4 | 5 | SUBDIRS = as 6 | 7 | all clean: 8 | @$(MAKE) $(SUBDIRS) "COMMAND=$@" 9 | 10 | .PHONY: $(SUBDIRS) 11 | 12 | $(SUBDIRS): 13 | @echo " " 14 | @echo " -----> make $(COMMAND) in $@" 15 | $(MAKE) --directory=$@ $(COMMAND) 16 | 17 | -------------------------------------------------------------------------------- /src/mkit/as/pngreadwrite/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start); 12 | -------------------------------------------------------------------------------- /src/mkit/as/salvador/LICENSE.salvador.md: -------------------------------------------------------------------------------- 1 | The salvador code is available under the Zlib license, except for src/matchfinder.c which is placed under the Creative Commons CC0 license. 2 | 3 | Please consult LICENSE.zlib.md and LICENSE.CC0.md for more information. 4 | -------------------------------------------------------------------------------- /src/mkit/as/salvador/README.md: -------------------------------------------------------------------------------- 1 | This is Emmanuel Marty's wonderful salvador compressor source stripped down 2 | into a simple-to-include compression library. 3 | 4 | The only modified file is "libsalvador.h" which has been changed to exclude 5 | the "expand.h" header because we're only interested in compression. 6 | 7 | The original project repository can be found here ... 8 | https://github.com/emmanuel-marty/salvador 9 | -------------------------------------------------------------------------------- /src/mkit/as/salvador/divsufsort_config.h: -------------------------------------------------------------------------------- 1 | #define HAVE_STRING_H 1 2 | #define HAVE_STDLIB_H 1 3 | #define HAVE_MEMORY_H 1 4 | #define HAVE_STDINT_H 1 5 | #define INLINE inline 6 | 7 | #ifdef _MSC_VER 8 | #pragma warning( disable : 4244 ) 9 | #endif /* _MSC_VER */ 10 | -------------------------------------------------------------------------------- /src/mkit/as/salvador/matchfinder.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/src/mkit/as/salvador/matchfinder.c -------------------------------------------------------------------------------- /src/mkit/as/version.h: -------------------------------------------------------------------------------- 1 | #ifndef PCEAS_VERSION_H 2 | #define PCEAS_VERSION_H 3 | 4 | #ifndef GIT_VERSION 5 | # define GIT_VERSION "dummy" 6 | #endif /* !GIT_VERSION */ 7 | 8 | #ifndef GIT_DATE 9 | # define GIT_DATE "1987/10/30" 10 | #endif /* !GIT_DATE */ 11 | 12 | #endif /* PCEAS_VERSION_H */ 13 | -------------------------------------------------------------------------------- /src/mkit/as/version.h.in: -------------------------------------------------------------------------------- 1 | #ifndef PCEAS_VERSION_H 2 | #define PCEAS_VERSION_H 3 | 4 | #ifndef GIT_VERSION 5 | # define GIT_VERSION "@GIT_VERSION@" 6 | #endif /* !GIT_VERSION */ 7 | 8 | #ifndef GIT_DATE 9 | # define GIT_DATE @GIT_DATE@ 10 | #endif /* !GIT_DATE */ 11 | 12 | #endif /* PCEAS_VERSION_H */ 13 | -------------------------------------------------------------------------------- /src/mkit/develo/lib/Makefile: -------------------------------------------------------------------------------- 1 | # DEVELO LIBRARY MAKEFILE [MSDOS] 2 | # 3 | 4 | # 5 | # Defines 6 | # 7 | BASEDIR=..d ..d ..d .. 8 | include ../../../Make_src.inc 9 | 10 | OBJS = init.o xfer.o error.o command.o mx.o slave.o 11 | LIB = libdevel.a 12 | EXE = $(LIB) 13 | 14 | # 15 | # 16 | 17 | all: $(EXE) 18 | 19 | 20 | # RULES 21 | # 22 | $(OBJS) : develo.h 23 | xfer.o : crc16.h 24 | 25 | # EXE 26 | # 27 | $(LIB): $(OBJS) 28 | ar rs $(LIB) $(OBJS) 29 | 30 | # 31 | # Targets 32 | # 33 | include $(MAKETARG) 34 | 35 | -------------------------------------------------------------------------------- /src/mkit/develo/lib/mx.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/src/mkit/develo/lib/mx.c -------------------------------------------------------------------------------- /src/plugins/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for plugins sources for Cosmigo's Pro Motion NG. 3 | # 4 | # https://www.cosmigo.com/ 5 | # 6 | 7 | ifeq ($(OS),Windows_NT) 8 | SUBDIRS = huremap husetpalette huzerozero 9 | 10 | all clean: plugins 11 | @$(MAKE) $(SUBDIRS) "COMMAND=$@" 12 | 13 | plugins: 14 | mkdir -p ../../bin/plugins 15 | 16 | .PHONY: $(SUBDIRS) 17 | 18 | $(SUBDIRS): 19 | @echo " " 20 | @echo " -----> make $(COMMAND) in $@" 21 | $(MAKE) --directory=$@ $(COMMAND) 22 | 23 | else 24 | all clean: 25 | 26 | endif 27 | -------------------------------------------------------------------------------- /src/plugins/husetpalette/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define _WIN32_WINNT _WIN32_WINNT_WINXP 4 | #include 5 | -------------------------------------------------------------------------------- /src/plugins/plugins.ini: -------------------------------------------------------------------------------- 1 | [plugins] 2 | plugin1_exe=C:\huc\bin\plugins\huremap.exe 3 | plugin1_shortcut=R 4 | plugin1_name=Remap Pixel Values 5 | plugin1_type=manipulation 6 | plugin2_exe=C:\huc\bin\plugins\husetpalette.exe 7 | plugin2_shortcut=S 8 | plugin2_name=Set Palette Number 9 | plugin2_type=manipulation 10 | plugin3_exe=C:\huc\bin\plugins\huzerozero.exe 11 | plugin3_shortcut=Z 12 | plugin3_name=Zero Transparent Pixels 13 | plugin3_type=manipulation 14 | -------------------------------------------------------------------------------- /src/tools/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for HuC tools sources 3 | # 4 | 5 | SUBDIRS = pcxtool mod2mml mml wav2vox sym2inc pce2png hulz 6 | 7 | all clean: 8 | @$(MAKE) $(SUBDIRS) "COMMAND=$@" 9 | 10 | .PHONY: $(SUBDIRS) 11 | 12 | $(SUBDIRS): 13 | @echo " " 14 | @echo " -----> make $(COMMAND) in $@" 15 | $(MAKE) --directory=$@ $(COMMAND) 16 | 17 | -------------------------------------------------------------------------------- /src/tools/hulz/targetver.h: -------------------------------------------------------------------------------- 1 | #ifndef _TARGETVER_h 2 | #define _TARGETVER_h 3 | 4 | // Set the minimum supported platform (WINXP/WIN6/WIN7). 5 | #define _WIN32_WINNT _WIN32_WINNT_WINXP 6 | 7 | // Use _WIN32_WINNT to set up NTDDI_VERSION, WINVER, and _WIN32_IE. 8 | #include 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /src/tools/mml/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for mml 2 | # 3 | 4 | # 5 | # Defines 6 | # 7 | BASEDIR=..d ..d .. 8 | include ../../Make_src.inc 9 | CFLAGS += -Wno-char-subscripts -D_GNU_SOURCE 10 | 11 | HDRS = 12 | LIBS = -lm 13 | OBJS = mml.o 14 | EXE = mml$(EXESUFFIX) 15 | 16 | all: $(EXE) 17 | 18 | 19 | $(EXE): $(OBJS) $(HDRS) 20 | $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@ 21 | $(CP) $(EXE) $(BINDIR) 22 | 23 | # 24 | # Targets 25 | # 26 | include $(MAKETARG) 27 | -------------------------------------------------------------------------------- /src/tools/mod2mml/mod2mml.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/src/tools/mod2mml/mod2mml.c -------------------------------------------------------------------------------- /src/tools/pce2png/msinttypes/stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef __STDBOOL_H__ 2 | #define __STDBOOL_H__ 3 | 4 | #ifndef __cplusplus 5 | typedef BOOL bool; 6 | #define true (TRUE) 7 | #define false (FALSE) 8 | #endif 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /src/tools/pce2png/targetver.h: -------------------------------------------------------------------------------- 1 | #ifndef _TARGETVER_h 2 | #define _TARGETVER_h 3 | 4 | // Set the minimum supported platform (WINXP/WIN6/WIN7). 5 | #define _WIN32_WINNT _WIN32_WINNT_WINXP 6 | 7 | // Use _WIN32_WINNT to set up NTDDI_VERSION, WINVER, and _WIN32_IE. 8 | #include 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /src/tools/pcxtool/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for pcxtool 2 | # 3 | # Written for Linux development version, September 27, 2001 by Dave Shadoff 4 | # 5 | 6 | # 7 | # Defines 8 | # 9 | BASEDIR=..d ..d .. 10 | include ../../Make_src.inc 11 | 12 | HDRS = 13 | OBJS = pcxtool.o 14 | EXE = pcxtool$(EXESUFFIX) 15 | 16 | all: $(EXE) 17 | 18 | 19 | $(EXE): $(OBJS) $(LIBS) $(HDRS) 20 | $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@ 21 | $(CP) $(EXE) $(BINDIR) 22 | 23 | # 24 | # Targets 25 | # 26 | include $(MAKETARG) 27 | 28 | -------------------------------------------------------------------------------- /src/tools/sym2inc/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for sym2inc 2 | # 3 | # Written for Linux development version, September 27, 2001 by Dave Shadoff 4 | # 5 | 6 | # 7 | # Defines 8 | # 9 | BASEDIR=..d ..d .. 10 | include ../../Make_src.inc 11 | 12 | HDRS = 13 | OBJS = sym2inc.o 14 | EXE = sym2inc$(EXESUFFIX) 15 | 16 | all: $(EXE) 17 | 18 | 19 | $(EXE): $(OBJS) $(LIBS) $(HDRS) 20 | $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@ 21 | $(CP) $(EXE) $(BINDIR) 22 | 23 | # 24 | # Targets 25 | # 26 | include $(MAKETARG) 27 | -------------------------------------------------------------------------------- /src/tools/sym2inc/targetver.h: -------------------------------------------------------------------------------- 1 | #ifndef _TARGETVER_h 2 | #define _TARGETVER_h 3 | 4 | // Set the minimum supported platform (WINXP/WIN6/WIN7). 5 | #define _WIN32_WINNT _WIN32_WINNT_WINXP 6 | 7 | // Use _WIN32_WINNT to set up NTDDI_VERSION, WINVER, and _WIN32_IE. 8 | #include 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /src/tools/wav2vox/targetver.h: -------------------------------------------------------------------------------- 1 | #ifndef _TARGETVER_h 2 | #define _TARGETVER_h 3 | 4 | // Set the minimum supported platform (WINXP/WIN6/WIN7). 5 | #define _WIN32_WINNT _WIN32_WINNT_WINXP 6 | 7 | // Use _WIN32_WINNT to set up NTDDI_VERSION, WINVER, and _WIN32_IE. 8 | #include 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /test/dg/20000623-1.c: -------------------------------------------------------------------------------- 1 | /* { dg-do run } */ 2 | /* { dg-options "-O3 -fno-strict-aliasing" } */ 3 | 4 | extern void exit (int); 5 | extern void abort (void); 6 | 7 | struct foos { int l; }; 8 | int foo; 9 | static struct foos *getfoo(void); 10 | int main (void) 11 | { 12 | struct foos *f;f = getfoo(); 13 | f->l = 1; 14 | foo = 2; 15 | if (f->l == 1) 16 | abort(); 17 | exit(0); 18 | } 19 | static struct foos *getfoo(void) 20 | { return /*(struct foos *)*/&foo; } 21 | -------------------------------------------------------------------------------- /test/dg/20020525-1.c: -------------------------------------------------------------------------------- 1 | /* PR optimization/6703 2 | Origin: Glen Nakamura */ 3 | /* { dg-do run } */ 4 | /* { dg-options "-O2" } */ 5 | 6 | extern void abort (void); 7 | extern void exit (int); 8 | 9 | void foo (int *x, int y) 10 | { 11 | /*__builtin_*/memset (x, 0, y); 12 | } 13 | 14 | int main () 15 | { 16 | int x[2]; x[0]=-1;x[1]=-1;// = { -1, -1 }; 17 | 18 | if (x[1] != -1) 19 | abort (); 20 | foo (x, sizeof (int) + 1); 21 | if (x[1] == -1) 22 | abort (); 23 | exit (0); 24 | } 25 | -------------------------------------------------------------------------------- /test/dg/20030805-1.c: -------------------------------------------------------------------------------- 1 | /* Test that gcc understands that the call to g might clobber i. */ 2 | 3 | /* { dg-do run } */ 4 | /* { dg-options "-O2" } */ 5 | 6 | /*__inline*/ int f () 7 | { 8 | static int i; 9 | int i2;i2 = i; 10 | i = i2 + 1; 11 | return i; 12 | } 13 | 14 | int g () { return f (); } 15 | 16 | int main () 17 | { 18 | if (f() != 1 19 | || g() != 2 20 | || f() != 3) 21 | return 1; 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /test/dg/c99-func-1.c: -------------------------------------------------------------------------------- 1 | /* Test for C99 __func__. */ 2 | /* Origin: Joseph Myers */ 3 | /* { dg-do run } */ 4 | /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */ 5 | 6 | extern void abort (void); 7 | extern int strcmp (const char *, const char *); 8 | extern void exit (int); 9 | 10 | int 11 | main (void) 12 | { 13 | if (strcmp (__func__, "main") || sizeof (__func__) != 5) 14 | abort (); 15 | else 16 | exit (0); 17 | } 18 | -------------------------------------------------------------------------------- /test/dg/c99-func-3.c: -------------------------------------------------------------------------------- 1 | /* Test for C99 __func__: not merging with string literals. */ 2 | /* Origin: Joseph Myers */ 3 | /* { dg-do run } */ 4 | /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */ 5 | 6 | extern void abort (void); 7 | extern void exit (int); 8 | 9 | int 10 | main (void) 11 | { 12 | if ("main" == __func__) 13 | abort (); 14 | else 15 | exit (0); 16 | } 17 | -------------------------------------------------------------------------------- /test/dg/char-compare.c: -------------------------------------------------------------------------------- 1 | /* PR rtl-optimization/23241 */ 2 | /* Origin: Josh Conner */ 3 | 4 | /* { dg-do run } */ 5 | /* { dg-options "-O2" } */ 6 | 7 | extern void abort(void); 8 | 9 | struct fbs { 10 | unsigned char uc; 11 | }; struct fbs fbs1;// = {255}; 12 | 13 | void fn(struct fbs *fbs_ptr) 14 | { 15 | if ((fbs_ptr->uc != 255) && (fbs_ptr->uc != 0)) 16 | abort(); 17 | } 18 | 19 | int main(void) 20 | { 21 | fbs1.uc = 255; 22 | fn(&fbs1); 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /test/dg/doloop-2.c: -------------------------------------------------------------------------------- 1 | /* { dg-do run } */ 2 | /* { dg-options "-O2" } */ 3 | extern void abort (void); 4 | unsigned global_iters; 5 | 6 | void bi_reverse(int len) 7 | { 8 | do { 9 | global_iters++; 10 | } while (--len > 0); 11 | } 12 | 13 | int main() 14 | { 15 | bi_reverse(5); 16 | if (global_iters != 5) 17 | abort (); 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /test/dg/fold-abs-2.c: -------------------------------------------------------------------------------- 1 | /* { dg-do run } */ 2 | /* { dg-options "-O1 -fwrapv" } */ 3 | #include 4 | void exit (int); 5 | void abort (); 6 | //#define ABS(x) (x > 0 ? x : -x) 7 | #define ABS abs 8 | int f (int a) { 9 | if (ABS(a) >= 0) return 1; 10 | else return 0; 11 | } 12 | 13 | int main (int argc, char *argv[]) { 14 | if (f(INT_MIN)) 15 | abort (); 16 | else 17 | exit (0); 18 | } 19 | -------------------------------------------------------------------------------- /test/dg/ftrapv-1.c: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Free Software Foundation. 2 | 3 | PR other/15526 4 | Verify correct overflow checking with -ftrapv. 5 | 6 | Written by Falk Hueffner, 20th May 2004. */ 7 | 8 | /* { dg-do run } */ 9 | /* { dg-options "-ftrapv" } */ 10 | 11 | /*__attribute__((noinline))*/ int 12 | mulv(int a, int b) 13 | { 14 | return a * b; 15 | } 16 | 17 | int 18 | main() 19 | { 20 | mulv( 0, 0); 21 | mulv( 0, -1); 22 | mulv(-1, 0); 23 | mulv(-1, -1); 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /test/dg/loop-2.c: -------------------------------------------------------------------------------- 1 | /* PR optimization/10171 */ 2 | /* Bug: unroll_loop misoptimized the function so that we got 3 | 0 iterations of the loop rather than the correct 1. */ 4 | /* { dg-do run } */ 5 | 6 | extern void abort (void); 7 | extern void exit (int); 8 | 9 | /*__inline__*/ int tag() { return 0; } 10 | 11 | void f (); 12 | 13 | int main() { 14 | int i; 15 | for (i = 0; i < (tag() ? 2 : 1); i++) 16 | f(); 17 | abort (); 18 | } 19 | 20 | void f () 21 | { 22 | exit (0); 23 | } 24 | -------------------------------------------------------------------------------- /test/dg/nrv1.c: -------------------------------------------------------------------------------- 1 | /* Test that the NRV optimization doesn't cause a1 to change too soon. This 2 | is equivalent to c++/19317. */ 3 | /* { dg-do run } */ 4 | 5 | void abort (void); 6 | 7 | struct A 8 | { 9 | int i[100]; 10 | }; 11 | 12 | struct A a1; 13 | 14 | struct A f () 15 | { 16 | struct A a2; 17 | a2.i[0] = 42; 18 | /* a1.i[0] should still be 0 until we return. */ 19 | if (a1.i[0] != 0) 20 | abort (); 21 | return a2; 22 | } 23 | 24 | int main() 25 | { 26 | a1 = f(); 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /test/dg/postincr-1.c: -------------------------------------------------------------------------------- 1 | /* Simple test for proper postincrement semantics. */ 2 | /* { dg-do run } */ 3 | 4 | extern void abort (void); 5 | 6 | int i; 7 | int c; 8 | int *f () 9 | { 10 | ++c; 11 | return &i; 12 | } 13 | 14 | int main () 15 | { 16 | int r; 17 | r = (*f())++; 18 | if (!(r == 0 && i == 1 && c == 1)) 19 | abort (); 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /test/dg/pr18241-4.c: -------------------------------------------------------------------------------- 1 | /* { dg-do run } */ 2 | /* { dg-options "-O1" } */ 3 | 4 | void abort (void); 5 | 6 | int f(int i1243) 7 | { 8 | volatile int *i2; 9 | int i[2], *i1; i1 = i; 10 | i[0] = 1; 11 | /*volatile int **/i2 = i1; 12 | i2[1] = 1; 13 | i1243 = 0; 14 | return i2[1]+i2[0]; 15 | } 16 | 17 | 18 | int main(void) 19 | { 20 | if( f(100) != 2) 21 | abort (); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /test/dg/pr18241-5.c: -------------------------------------------------------------------------------- 1 | /* { dg-do run } */ 2 | /* { dg-options "-O1" } */ 3 | 4 | void abort (void); 5 | 6 | int main () 7 | { 8 | int a; 9 | volatile int *b;b = &a; 10 | a = 1; 11 | if (*b != 1) 12 | abort (); 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /test/dg/pr18921-1.c: -------------------------------------------------------------------------------- 1 | /* PR middle-end/18921 */ 2 | /* { dg-do run } */ 3 | /* { dg-options "-O2" } */ 4 | 5 | extern void abort (void); 6 | 7 | int foo (int k) 8 | { 9 | unsigned char j = 0; 10 | (k ? 0 : j++) == -1; 11 | return j; 12 | } 13 | 14 | int main () 15 | { 16 | if (!foo (0)) 17 | abort (); 18 | return 0; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /test/dg/pr26729-1.c: -------------------------------------------------------------------------------- 1 | /* { dg-do run } */ 2 | /* { dg-options "-O2" } */ 3 | 4 | void abort(void); 5 | 6 | //__attribute__((noinline)) 7 | int f (unsigned short word) { 8 | return (word & 0x1) && ((/*(unsigned short)*/ (word & 0x8000)) == 0x8000); 9 | } 10 | 11 | int main(void) { 12 | if (!f(0x8001)) 13 | abort(); 14 | return 0; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /test/dg/short-compare-1.c: -------------------------------------------------------------------------------- 1 | /* PR rtl-optimization/19296 */ 2 | /* Origin: Falk Hueffner */ 3 | 4 | /* { dg-do run } */ 5 | /* { dg-options "-O" } */ 6 | /* { dg-options "-O -mtune=i686" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ 7 | 8 | extern void abort(void); 9 | 10 | void f(unsigned short ad) 11 | { 12 | if (ad >= 0x4000 && ad < 0xc000) 13 | abort(); 14 | } 15 | 16 | int main(void) 17 | { 18 | f(0xff00); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /test/manual/overlay.cue: -------------------------------------------------------------------------------- 1 | FILE "overlay.iso" BINARY 2 | TRACK 1 MODE1/2048 3 | INDEX 1 00:00:00 4 | -------------------------------------------------------------------------------- /test/manual/overlay1.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifdef INIT_GLOBAL1 4 | int a = 1; 5 | #else 6 | int a; 7 | #endif 8 | 9 | extern char _huc_rodata; 10 | extern char _huc_rodata_end; 11 | extern char _huc_data; 12 | int main() 13 | { 14 | load_default_font(); 15 | put_string("Hi", 0, 0); 16 | put_hex(&_huc_rodata, 4, 0, 1); 17 | put_hex(&_huc_rodata_end, 4, 5, 1); 18 | put_hex(&_huc_data, 4, 10, 1); 19 | put_number(a, 5, 15, 1); 20 | 21 | cd_execoverlay(2); 22 | for(;;); 23 | } 24 | -------------------------------------------------------------------------------- /test/manual/overlay2.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifdef INIT_GLOBAL2 4 | int a = 2; 5 | #else 6 | int a; 7 | #endif 8 | 9 | extern char _huc_rodata; 10 | extern char _huc_rodata_end; 11 | extern char _huc_data; 12 | int main() 13 | { 14 | load_default_font(); 15 | put_string("Lo", 0, 2); 16 | put_hex(&_huc_rodata, 4, 0, 3); 17 | put_hex(&_huc_rodata_end, 4, 5, 3); 18 | put_hex(&_huc_data, 4, 10, 3); 19 | put_number(a, 5, 15, 3); 20 | for(;;); 21 | } 22 | -------------------------------------------------------------------------------- /test/tests/20000205-1.c: -------------------------------------------------------------------------------- 1 | static int f (int a) 2 | { 3 | if (a == 0) 4 | return 0; 5 | do 6 | if (a & 128) 7 | return 1; 8 | while (f (0)); 9 | return 0; 10 | } 11 | 12 | int main(void) 13 | { 14 | if (f (~128)) 15 | abort (); 16 | exit (0); 17 | } 18 | -------------------------------------------------------------------------------- /test/tests/20000217-1.c: -------------------------------------------------------------------------------- 1 | unsigned short int showbug(unsigned short int *a, unsigned short int *b) 2 | { 3 | *a += *b -8; 4 | return (*a >= 8); 5 | } 6 | 7 | int main() 8 | { 9 | unsigned short int x; 10 | unsigned short int y; 11 | x = 0; 12 | y = 10; 13 | 14 | if (showbug(&x, &y) != 0) 15 | abort (); 16 | 17 | exit (0); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /test/tests/20000225-1.c: -------------------------------------------------------------------------------- 1 | int main () 2 | { 3 | int nResult; 4 | int b; 5 | int i; 6 | b = 0; 7 | i = -1; 8 | 9 | do 10 | { 11 | if (b!=0) { 12 | abort (); 13 | nResult=1; 14 | } else { 15 | nResult=0; 16 | } 17 | i++; 18 | b=(i+2)*4; 19 | } while (i < 0); 20 | exit (0); 21 | } 22 | 23 | 24 | -------------------------------------------------------------------------------- /test/tests/20000313-1.c: -------------------------------------------------------------------------------- 1 | unsigned int buggy (unsigned int *param) 2 | { 3 | unsigned int accu, zero, borrow; 4 | zero = 0; 5 | accu = - *param; 6 | borrow = - (accu > zero); 7 | *param += accu; 8 | return borrow; 9 | } 10 | 11 | int main (void) 12 | { 13 | unsigned int param; 14 | unsigned int borrow; 15 | param = 1; 16 | borrow = buggy (¶m); 17 | 18 | if (param != 0) 19 | abort (); 20 | if (borrow + 1 != 0) 21 | abort (); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /test/tests/20000314-1.c: -------------------------------------------------------------------------------- 1 | int main () 2 | { 3 | int winds; 4 | winds = 0; 5 | 6 | while (winds != 0) 7 | { 8 | if (*(char *) winds) 9 | break; 10 | } 11 | 12 | if (winds == 0 || winds != 0 || *(char *) winds) 13 | exit (0); 14 | 15 | abort (); 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /test/tests/20000412-1.c: -------------------------------------------------------------------------------- 1 | const short int i = -1; 2 | const char * /*const*/ wordlist[207]; 3 | 4 | const char * /*const*/ * 5 | foo(void) 6 | { 7 | register /*const*/ char * /*const*/ *wordptr; wordptr = &wordlist[207/*u*/ + i]; 8 | return wordptr; 9 | } 10 | 11 | int 12 | main() 13 | { 14 | if (foo() != &wordlist[206]) 15 | abort (); 16 | exit(0); 17 | } 18 | -------------------------------------------------------------------------------- /test/tests/20000412-2.c: -------------------------------------------------------------------------------- 1 | #pragma recursive 2 | int f(int a,int *y) 3 | { 4 | int x; 5 | x = a; 6 | 7 | if (a==0) 8 | return *y; 9 | 10 | return f(a-1,&x); 11 | } 12 | 13 | int main(int argc,char *argv[]) 14 | { 15 | if (f (10, 0) != 1) 16 | abort (); 17 | exit (0); 18 | } 19 | -------------------------------------------------------------------------------- /test/tests/20000605-2.c: -------------------------------------------------------------------------------- 1 | struct F { int i; }; 2 | 3 | void f1(struct F *x, struct F *y) 4 | { 5 | int timeout; 6 | timeout = 0; 7 | for (; x->i < y->i ; x->i++) 8 | if (++timeout > 5) 9 | abort (); 10 | } 11 | 12 | main() 13 | { 14 | struct F x, y; 15 | x.i = 0; 16 | y.i = 1; 17 | f1 (&x, &y); 18 | exit (0); 19 | } 20 | -------------------------------------------------------------------------------- /test/tests/20000706-3.c: -------------------------------------------------------------------------------- 1 | extern void abort(void); 2 | extern void exit(int); 3 | 4 | int c; 5 | 6 | void baz(int *p) 7 | { 8 | c = *p; 9 | } 10 | 11 | void bar(int b) 12 | { 13 | if (c != 1 || b != 2) 14 | abort(); 15 | } 16 | 17 | void foo(int a, int b) 18 | { 19 | baz(&a); 20 | bar(b); 21 | } 22 | 23 | int main() 24 | { 25 | foo(1, 2); 26 | exit(0); 27 | } 28 | -------------------------------------------------------------------------------- /test/tests/20000706-4.c: -------------------------------------------------------------------------------- 1 | extern void abort(void); 2 | extern void exit(int); 3 | 4 | int *c; 5 | 6 | void bar(int b) 7 | { 8 | if (*c != 1 || b != 2) 9 | abort(); 10 | } 11 | 12 | void foo(int a, int b) 13 | { 14 | c = &a; 15 | bar(b); 16 | } 17 | 18 | int main() 19 | { 20 | foo(1, 2); 21 | exit(0); 22 | } 23 | -------------------------------------------------------------------------------- /test/tests/20000715-2.c: -------------------------------------------------------------------------------- 1 | extern void abort(void); 2 | extern void exit(int); 3 | 4 | unsigned int foo(unsigned int a) 5 | { 6 | return ((unsigned char)(a + 1)) * 4; 7 | } 8 | 9 | int main(void) 10 | { 11 | if (foo((unsigned char)~0)) 12 | abort (); 13 | exit(0); 14 | } 15 | -------------------------------------------------------------------------------- /test/tests/20000717-3.c: -------------------------------------------------------------------------------- 1 | const int c = -1; 2 | 3 | foo (p) 4 | int *p; 5 | { 6 | int x; 7 | int a; 8 | 9 | a = p[0]; 10 | x = a + 5; 11 | a = c; 12 | p[0] = x - 15; 13 | return a; 14 | } 15 | 16 | int main() 17 | { 18 | int b, a; 19 | b = 1; 20 | a = foo(&b); 21 | 22 | if (a != -1 || b != (1 + 5 - 15)) 23 | abort (); 24 | 25 | exit (0); 26 | } 27 | 28 | -------------------------------------------------------------------------------- /test/tests/20000717-4.c: -------------------------------------------------------------------------------- 1 | /* Extracted from gas. Incorrectly generated non-pic code at -O0 for 2 | IA-64, which produces linker errors on some operating systems. */ 3 | 4 | struct 5 | { 6 | int offset; 7 | struct slot 8 | { 9 | int field[6]; 10 | } 11 | slot[4]; 12 | } s; 13 | 14 | int 15 | x () 16 | { 17 | int toggle = 0; 18 | int r; r = s.slot[0].field[!toggle]; 19 | return r; 20 | } 21 | 22 | int 23 | main () 24 | { 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /test/tests/20000722-1.c: -------------------------------------------------------------------------------- 1 | struct s { char *p; int t; }; 2 | 3 | extern void bar (void); 4 | extern void foo (struct s *); 5 | 6 | int main(void) 7 | { 8 | bar (); 9 | bar (); 10 | exit (0); 11 | } 12 | 13 | void 14 | bar (void) 15 | { 16 | struct s ss; 17 | ss.p = "hi"; 18 | ss.t = 1; 19 | foo (&ss); 20 | } 21 | 22 | void foo (struct s *p) 23 | { 24 | if (p->t != 1) 25 | abort(); 26 | p->t = 2; 27 | } 28 | -------------------------------------------------------------------------------- /test/tests/20000731-2.c: -------------------------------------------------------------------------------- 1 | int 2 | main() 3 | { 4 | int i, j; 5 | i = 1; 6 | j = 0; 7 | 8 | while (i != 1024 || j <= 0) { 9 | i *= 2; 10 | ++ j; 11 | } 12 | 13 | if (j != 10) 14 | abort (); 15 | 16 | exit (0); 17 | } 18 | -------------------------------------------------------------------------------- /test/tests/20000819-1.c: -------------------------------------------------------------------------------- 1 | const int a[2] = { 2, 0 }; 2 | 3 | void foo(int *sp, int cnt) 4 | { 5 | int *p, *top; 6 | 7 | top = sp; sp -= cnt; 8 | 9 | for(p = sp; p <= top; p++) 10 | if (*p < 2) exit(0); 11 | } 12 | 13 | int main() 14 | { 15 | foo(a + 1, 1); 16 | abort(); 17 | } 18 | -------------------------------------------------------------------------------- /test/tests/20001009-1.c: -------------------------------------------------------------------------------- 1 | int a,b; 2 | main() 3 | { 4 | int c=-2; 5 | int d=0xfe; 6 | int e,f;e=a&1; 7 | /*int*/ f=b&2; 8 | if ((char)(c|(e&f)) == (char)d) 9 | return 0; 10 | else 11 | abort(); 12 | } 13 | -------------------------------------------------------------------------------- /test/tests/20001009-2.c: -------------------------------------------------------------------------------- 1 | int b;//=1; 2 | int foo() 3 | { 4 | int a; 5 | int c; 6 | a=0xff; 7 | for (;b;b--) 8 | { 9 | c=1; 10 | //asm(""::"r"(c)); 11 | c=(signed char)a; 12 | } 13 | if (c!=-1) 14 | abort(); 15 | return c; 16 | } 17 | int main() 18 | { 19 | b=1; 20 | foo(); 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /test/tests/20001011-1.c: -------------------------------------------------------------------------------- 1 | extern void abort(void); 2 | extern int strcmp(const char *, const char *); 3 | 4 | int foo(const char *a) 5 | { 6 | return strcmp(a, "main"); 7 | } 8 | 9 | int main(void) 10 | { 11 | if(foo(__FUNCTION__)) 12 | abort(); 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /test/tests/20001013-1.c: -------------------------------------------------------------------------------- 1 | struct x { 2 | int a, b; 3 | }; 4 | struct x z; 5 | 6 | int foo(struct x *p, int y) 7 | { 8 | if ((y & 0xff) != y || -p->b >= p->a) 9 | return 1; 10 | return 0; 11 | } 12 | 13 | main() 14 | { 15 | z.a = -4028; 16 | z.b = 4096; 17 | if (foo (&z, 10)) 18 | abort (); 19 | exit (0); 20 | } 21 | -------------------------------------------------------------------------------- /test/tests/20001027-1.c: -------------------------------------------------------------------------------- 1 | int x; 2 | int *p; 3 | 4 | int main() 5 | { 6 | int i; 7 | p = &x; 8 | i=0; 9 | x=1; 10 | p[i]=2; 11 | if (x != 2) 12 | abort (); 13 | exit (0); 14 | } 15 | -------------------------------------------------------------------------------- /test/tests/20001130-1.c: -------------------------------------------------------------------------------- 1 | static /* inline */ int bar(void) { return 1; } 2 | static int mem[3]; 3 | 4 | static int foo(int x) 5 | { 6 | if (x != 0) 7 | return x; 8 | 9 | mem[x++] = foo(bar()); 10 | 11 | if (x != 1) 12 | abort(); 13 | 14 | return 0; 15 | } 16 | 17 | int main() 18 | { 19 | foo(0); 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /test/tests/20001228-1.c: -------------------------------------------------------------------------------- 1 | union ut { 2 | char a[2]; 3 | unsigned int b; 4 | }; 5 | int foo1(void) 6 | { 7 | union ut u; 8 | u.b = 0x01; 9 | return u.a[0]; 10 | } 11 | 12 | union ut2 { 13 | char a[/* sizeof (unsigned) */ 2]; 14 | unsigned b; 15 | }; 16 | 17 | int foo2(void) 18 | { 19 | /* volatile */ union ut2 u; 20 | u.b = 0x01; 21 | return u.a[0]; 22 | } 23 | 24 | int main(void) 25 | { 26 | if (foo1() != foo2()) 27 | abort (); 28 | exit (0); 29 | } 30 | -------------------------------------------------------------------------------- /test/tests/20010119-1.c: -------------------------------------------------------------------------------- 1 | #ifdef __OPTIMIZE__ 2 | extern void undef (void); 3 | 4 | void bar (unsigned x) { } 5 | void baz (unsigned x) { } 6 | 7 | extern inline void foo (int a, int b) 8 | { 9 | int c = 0; 10 | while (c++ < b) 11 | (__builtin_constant_p (a) ? ((a) > 20000 ? undef () : bar (a)) : baz (a)); 12 | } 13 | #else 14 | void foo (int a, int b) 15 | { 16 | } 17 | #endif 18 | 19 | int main (void) 20 | { 21 | foo(10, 100); 22 | exit (0); 23 | } 24 | -------------------------------------------------------------------------------- /test/tests/20010206-1.c: -------------------------------------------------------------------------------- 1 | int foo (void) 2 | { 3 | int i; 4 | //#line 1 "20010206-1.c" 5 | if (0) i = 1; else i 6 | //#line 1 "20010206-1.c" 7 | = 26; 8 | return i; 9 | } 10 | 11 | int main () 12 | { 13 | if (foo () != 26) 14 | abort (); 15 | exit (0); 16 | } 17 | -------------------------------------------------------------------------------- /test/tests/20010221-1.c: -------------------------------------------------------------------------------- 1 | 2 | const int n = 2; 3 | 4 | main () 5 | { 6 | int i, x; 7 | x = 45; 8 | 9 | for (i = 0; i < n; i++) 10 | { 11 | if (i != 0) 12 | x = ( i > 0 ) ? i : 0; 13 | } 14 | 15 | if (x != 1) 16 | abort (); 17 | exit (0); 18 | } 19 | -------------------------------------------------------------------------------- /test/tests/20010222-1.c: -------------------------------------------------------------------------------- 1 | const int a[2] = { 18, 6 }; 2 | 3 | int main () 4 | { 5 | int b; 6 | b = (-3 * a[0] -3 * a[1]) / 12; 7 | if (b != -6) 8 | abort (); 9 | exit (0); 10 | } 11 | -------------------------------------------------------------------------------- /test/tests/20010403-1.c: -------------------------------------------------------------------------------- 1 | void b (int *); 2 | void c (int, int); 3 | void d (int); 4 | 5 | int e; 6 | 7 | void a (int x, int y) 8 | { 9 | int f, z; 10 | f = x ? e : 0; 11 | z = y; 12 | 13 | b (&y); 14 | c (z, y); 15 | d (f); 16 | } 17 | 18 | void b (int *y) 19 | { 20 | (*y)++; 21 | } 22 | 23 | void c (int x, int y) 24 | { 25 | if (x == y) 26 | abort (); 27 | } 28 | 29 | void d (int x) 30 | { 31 | } 32 | 33 | int main (void) 34 | { 35 | a (0, 0); 36 | exit (0); 37 | } 38 | -------------------------------------------------------------------------------- /test/tests/20010422-1.c: -------------------------------------------------------------------------------- 1 | unsigned int foo(unsigned int x) 2 | { 3 | if (x < 5) 4 | x = 4; 5 | else 6 | x = 8; 7 | return x; 8 | } 9 | 10 | int main(void) 11 | { 12 | if (foo (8) != 8) 13 | abort (); 14 | exit (0); 15 | } 16 | -------------------------------------------------------------------------------- /test/tests/20010518-1.c: -------------------------------------------------------------------------------- 1 | /* Leaf functions with many arguments. */ 2 | 3 | int 4 | add (int a, 5 | int b, 6 | int c, 7 | int d, 8 | int e, 9 | int f, 10 | int g, 11 | int h, 12 | int i, 13 | int j, 14 | int k, 15 | int l, 16 | int m) 17 | { 18 | return a+b+c+d+e+f+g+h+i+j+k+l+m; 19 | } 20 | 21 | int 22 | main(void) 23 | { 24 | if (add (1,2,3,4,5,6,7,8,9,10,11,12,13) != 91) 25 | abort (); 26 | 27 | exit (0); 28 | } 29 | -------------------------------------------------------------------------------- /test/tests/20010520-1.c: -------------------------------------------------------------------------------- 1 | static const unsigned int expr_hash_table_size = 1; 2 | 3 | int 4 | main () 5 | { 6 | int del; 7 | unsigned int i; 8 | i = 0; 9 | del = 1; 10 | 11 | if (i < expr_hash_table_size && del) 12 | exit (0); 13 | abort (); 14 | } 15 | -------------------------------------------------------------------------------- /test/tests/20010605-1.c: -------------------------------------------------------------------------------- 1 | /* inline */ int fff (int x) 2 | { 3 | return x*10; 4 | } 5 | int main () 6 | { 7 | int v; 8 | v = 42; 9 | 10 | 11 | return (fff (v) != 420); 12 | } 13 | -------------------------------------------------------------------------------- /test/tests/20010711-1.c: -------------------------------------------------------------------------------- 1 | void foo (int *a) {} 2 | 3 | int main () 4 | { 5 | int a; 6 | if (&a == 0) 7 | abort (); 8 | else 9 | { 10 | foo (&a); 11 | exit (0); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/tests/20010723-1.c: -------------------------------------------------------------------------------- 1 | int 2 | test () 3 | { 4 | int biv,giv; 5 | for (biv = 0, giv = 0; giv != 8; biv++) 6 | giv = biv*8; 7 | return giv; 8 | } 9 | 10 | 11 | main() 12 | { 13 | if (test () != 8) 14 | abort (); 15 | exit (0); 16 | } 17 | -------------------------------------------------------------------------------- /test/tests/20010925-1.c: -------------------------------------------------------------------------------- 1 | extern void exit(int); 2 | extern void abort (void); 3 | 4 | extern void * memcpy (void *, const void *, __SIZE_TYPE__); 5 | int foo (void *, void *, unsigned int c); 6 | 7 | int src[10]; 8 | int dst[10]; 9 | 10 | int main() 11 | { 12 | if (foo (dst, src, 10) != 0) 13 | abort(); 14 | exit(0); 15 | } 16 | 17 | int foo (void *a, void *b, unsigned int c) 18 | { 19 | if (c == 0) 20 | return 1; 21 | 22 | memcpy (a, b, c); 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /test/tests/20011008-2.c: -------------------------------------------------------------------------------- 1 | /* { dg-do run } */ 2 | /* { dg-options "-O0" } */ 3 | 4 | extern void abort (void); 5 | extern void exit (int); 6 | 7 | struct { union {int x; int y;} z; int q; } b; 8 | union { struct {int x;} z; int q; } e; 9 | 10 | main() 11 | { 12 | b.z.y = 10; 13 | b.z.x = 15; 14 | if (b.z.y != 15) 15 | abort(); 16 | 17 | e.z.x = 10; 18 | e.q = 15; 19 | if (e.z.x != 15) 20 | abort(); 21 | 22 | exit(0); 23 | } 24 | -------------------------------------------------------------------------------- /test/tests/20011019-1.c: -------------------------------------------------------------------------------- 1 | extern void exit (int); 2 | extern void abort (void); 3 | 4 | struct xt { int a; int b[5]; }; struct xt x; 5 | int *y; 6 | 7 | int foo (void) 8 | { 9 | return y - x.b; 10 | } 11 | 12 | int main (void) 13 | { 14 | y = x.b; 15 | if (foo ()) 16 | abort (); 17 | exit (0); 18 | } 19 | -------------------------------------------------------------------------------- /test/tests/20011109-2.c: -------------------------------------------------------------------------------- 1 | int main(void) 2 | { 3 | char *c1, *c2; 4 | int i; 5 | c1 = "foo"; 6 | c2 = "foo"; 7 | for (i = 0; i < 3; i++) 8 | if (c1[i] != c2[i]) 9 | abort (); 10 | exit (0); 11 | } 12 | -------------------------------------------------------------------------------- /test/tests/20011114-1.c: -------------------------------------------------------------------------------- 1 | char foo(char bar[]) 2 | { 3 | return bar[1]; 4 | } 5 | extern char foo(char *); 6 | int main(void) 7 | { 8 | if (foo("xy") != 'y') 9 | abort (); 10 | exit (0); 11 | } 12 | -------------------------------------------------------------------------------- /test/tests/20011115-1.c: -------------------------------------------------------------------------------- 1 | extern void exit (int); 2 | 3 | static /* inline */ int 4 | foo (void) 5 | { 6 | #ifdef __OPTIMIZE__ 7 | extern int undefined_reference; 8 | return undefined_reference; 9 | #else 10 | return 0; 11 | #endif 12 | } 13 | 14 | static /* inline */ int 15 | bar (void) 16 | { 17 | if (foo == foo) 18 | return 1; 19 | else 20 | return foo (); 21 | } 22 | 23 | int main (void) 24 | { 25 | exit (0); 26 | } 27 | -------------------------------------------------------------------------------- /test/tests/20011121-1.c: -------------------------------------------------------------------------------- 1 | struct s 2 | { 3 | int i[18]; 4 | char f; 5 | char b[2]; 6 | }; 7 | 8 | struct s s1; 9 | 10 | int 11 | main() 12 | { 13 | struct s s2; 14 | s2.b[0] = 100; 15 | //__builtin_memcpy(&s2, &s1, ((unsigned int) &((struct s *)0)->b)); 16 | if (s2.b[0] != 100) 17 | abort(); 18 | exit(0); 19 | } 20 | -------------------------------------------------------------------------------- /test/tests/20020328-1.c: -------------------------------------------------------------------------------- 1 | const int b = 0; 2 | 3 | func () { } 4 | 5 | void 6 | testit(int x) 7 | { 8 | if (x != 20) 9 | abort (); 10 | } 11 | 12 | int 13 | main() 14 | 15 | { 16 | int a; a = 0; 17 | 18 | if (b) 19 | func(); 20 | 21 | /* simplify_and_const_int would incorrectly omit the mask in 22 | the line below. */ 23 | testit ((a + 23) & 0xfffffffc); 24 | exit (0); 25 | } 26 | -------------------------------------------------------------------------------- /test/tests/20020805-1.c: -------------------------------------------------------------------------------- 1 | /* This testcase was miscompiled on IA-32, because fold-const 2 | assumed associate_trees is always done on PLUS_EXPR. */ 3 | 4 | extern void abort (void); 5 | extern void exit (int); 6 | 7 | void check (unsigned int m) 8 | { 9 | if (m != /*(unsigned int)*/ -1) 10 | abort (); 11 | } 12 | 13 | const unsigned int n = 1; 14 | 15 | int main (void) 16 | { 17 | unsigned int m; 18 | m = (1 | (2 - n)) | (-n); 19 | check (m); 20 | exit (0); 21 | } 22 | -------------------------------------------------------------------------------- /test/tests/20020819-1.c: -------------------------------------------------------------------------------- 1 | foo () 2 | { 3 | return 0; 4 | } 5 | 6 | main() 7 | { 8 | int i, j, k, ccp_bad; ccp_bad = 0; 9 | 10 | for (i = 0; i < 10; i++) 11 | { 12 | for (j = 0; j < 10; j++) 13 | if (foo ()) 14 | ccp_bad = 1; 15 | 16 | k = ccp_bad != 0; 17 | if (k) 18 | abort (); 19 | } 20 | 21 | exit (0); 22 | } 23 | -------------------------------------------------------------------------------- /test/tests/20020904-1.c: -------------------------------------------------------------------------------- 1 | /* PR c/7102 */ 2 | 3 | /* Verify that GCC zero-extends integer constants 4 | in unsigned binary operations. */ 5 | 6 | //typedef unsigned char u8; 7 | #define u8 unsigned char 8 | 9 | u8 fun(u8 y) 10 | { 11 | u8 x;x=((u8)255)/y; 12 | return x; 13 | } 14 | 15 | int main(void) 16 | { 17 | if (fun((u8)2) != 127) 18 | abort (); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /test/tests/20020911-1.c: -------------------------------------------------------------------------------- 1 | extern void abort (void); 2 | const unsigned short c = 0x8000; 3 | int main() 4 | { 5 | if ((c-0x8000) < 0 || (c-0x8000) > 0x7fff) 6 | abort(); 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /test/tests/20020916-1.c: -------------------------------------------------------------------------------- 1 | /* Distilled from try_pre_increment in flow.c. If-conversion inserted 2 | new instructions at the wrong place on ppc. */ 3 | 4 | int foo(int a) 5 | { 6 | int x; 7 | x = 0; 8 | if (a > 0) x = 1; 9 | if (a < 0) x = 1; 10 | return x; 11 | } 12 | 13 | int main() 14 | { 15 | if (foo(1) != 1) 16 | abort(); 17 | return 0; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /test/tests/20021010-1.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int 4 | sub () 5 | { 6 | int dummy, a; 7 | dummy = 0; a = 16; 8 | 9 | if (a / INT_MAX / 16 == 0) 10 | return 0; 11 | else 12 | return a / INT_MAX / 16; 13 | } 14 | 15 | int 16 | main () 17 | { 18 | if (sub () != 0) 19 | abort (); 20 | 21 | exit (0); 22 | } 23 | -------------------------------------------------------------------------------- /test/tests/20021118-3.c: -------------------------------------------------------------------------------- 1 | extern void abort (void); 2 | extern void exit (int); 3 | 4 | int 5 | foo (int x) 6 | { 7 | if (x == -2 || -x - 100 >= 0) 8 | abort (); 9 | return 0; 10 | } 11 | 12 | int 13 | main () 14 | { 15 | foo (-3); 16 | foo (-99); 17 | exit (0); 18 | } 19 | -------------------------------------------------------------------------------- /test/tests/20021119-1.c: -------------------------------------------------------------------------------- 1 | /* PR 8639. */ 2 | 3 | extern void abort(void); 4 | 5 | int foo (int i) 6 | { 7 | int r; 8 | r = (80 - 4 * i) / 20; 9 | return r; 10 | } 11 | 12 | int main () 13 | { 14 | if (foo (1) != 3) 15 | abort (); 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /test/tests/20021120-2.c: -------------------------------------------------------------------------------- 1 | int g1, g2; 2 | 3 | void foo (int x) 4 | { 5 | int y; 6 | 7 | if (x) 8 | y = 793; 9 | else 10 | y = 793; 11 | g1 = 7930 / y; 12 | g2 = 7930 / x; 13 | } 14 | 15 | int main () 16 | { 17 | foo (793); 18 | if (g1 != 10 || g2 != 10) 19 | abort (); 20 | exit (0); 21 | } 22 | -------------------------------------------------------------------------------- /test/tests/20021219-1.c: -------------------------------------------------------------------------------- 1 | /* PR optimization/8988 */ 2 | /* Contributed by Kevin Easton */ 3 | 4 | void foo(char *p1, /* char ** */ void *p2) 5 | {} 6 | 7 | int main(void) 8 | { 9 | char *str, *ptr; str = "foo { xx }"; 10 | ptr = str + 5; 11 | 12 | foo(ptr, &ptr); 13 | 14 | while (*ptr && (*ptr == 13 || *ptr == 32)) 15 | ptr++; 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /test/tests/20030105-1.c: -------------------------------------------------------------------------------- 1 | const int a[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; 2 | int /* __attribute__ ((noinline)) */ 3 | foo () 4 | { 5 | int i, sum; 6 | 7 | sum = 0; 8 | for (i = 0; i < sizeof (a) / sizeof (/* *a */ int); i++) 9 | sum += a[i]; 10 | 11 | return sum; 12 | } 13 | 14 | int 15 | main () 16 | { 17 | if (foo () != 28) 18 | abort (); 19 | exit (0); 20 | } 21 | -------------------------------------------------------------------------------- /test/tests/20030117-1.c: -------------------------------------------------------------------------------- 1 | int foo (int, int, int); 2 | int bar (int, int, int); 3 | 4 | int main (void) 5 | { 6 | if (foo (5, 10, 21) != 12) 7 | abort (); 8 | 9 | if (bar (9, 12, 15) != 150) 10 | abort (); 11 | 12 | exit (0); 13 | } 14 | 15 | int foo (int x, int y, int z) 16 | { 17 | return (x + y + z) / 3; 18 | } 19 | 20 | int bar (int x, int y, int z) 21 | { 22 | return foo (x * x, y * y, z * z); 23 | } 24 | -------------------------------------------------------------------------------- /test/tests/20030120-2.c: -------------------------------------------------------------------------------- 1 | /* PR 8848 */ 2 | 3 | extern void abort (); 4 | 5 | int foo(int status) 6 | { 7 | int s; s = 0; 8 | if (status == 1) s=1; 9 | if (status == 3) s=3; 10 | if (status == 4) s=4; 11 | return s; 12 | } 13 | 14 | int main() 15 | { 16 | if (foo (3) != 3) 17 | abort (); 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /test/tests/20030128-1.c: -------------------------------------------------------------------------------- 1 | unsigned char x;// = 50; 2 | /* volatile */ const short y = -5; 3 | 4 | int main () 5 | { 6 | x = 50; 7 | x /= y; 8 | if (x != /*(unsigned char) -10 */ 0xf6) 9 | abort (); 10 | exit (0); 11 | } 12 | -------------------------------------------------------------------------------- /test/tests/20030203-1.c: -------------------------------------------------------------------------------- 1 | void f(int); 2 | int do_layer3(int single) 3 | { 4 | int stereo1; 5 | 6 | if(single >= 0) /* stream is stereo, but force to mono */ 7 | stereo1 = 1; 8 | else 9 | stereo1 = 2; 10 | f(single); 11 | 12 | return stereo1; 13 | } 14 | 15 | extern void abort (); 16 | int main() 17 | { 18 | if (do_layer3(-1) != 2) 19 | abort (); 20 | return 0; 21 | } 22 | 23 | void f(int i) {} 24 | -------------------------------------------------------------------------------- /test/tests/20030323-1.c: -------------------------------------------------------------------------------- 1 | /* { dg-do run } */ 2 | 3 | /* PR c/8224 */ 4 | /* Contributed by Mikulas Patocka */ 5 | 6 | extern void abort (void); 7 | 8 | unsigned f (int x) 9 | { 10 | return (unsigned) (x / 2) / 2; 11 | } 12 | 13 | unsigned f1 (int x) 14 | { 15 | unsigned xx; xx = x / 2; 16 | return xx / 2; 17 | } 18 | 19 | int main () 20 | { 21 | if (f1 (-5) != f (-5)) 22 | abort (); 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /test/tests/20030606-1.c: -------------------------------------------------------------------------------- 1 | 2 | int * foo (int *x, int b) 3 | { 4 | 5 | *(x++) = 55; 6 | if (b) 7 | *(x++) = b; 8 | 9 | return x; 10 | } 11 | 12 | main() 13 | { 14 | int a[5]; 15 | 16 | memset (a, 1, sizeof (a)); 17 | 18 | if (foo(a, 0) - a != 1 || a[0] != 55 || a[1] != a[4]) 19 | abort(); 20 | 21 | memset (a, 1, sizeof (a)); 22 | 23 | if (foo(a, 2) - a != 2 || a[0] != 55 || a[1] != 2) 24 | abort(); 25 | 26 | exit (0); 27 | } 28 | -------------------------------------------------------------------------------- /test/tests/20030718-1.c: -------------------------------------------------------------------------------- 1 | /* PR c/10320 2 | The function temp was not being emitted in a prerelease of 3.4 20030406. 3 | Contributed by pinskia@physics.uc.edu */ 4 | 5 | static /*inline*/ void temp(); 6 | int main() 7 | { 8 | temp(); 9 | return 0; 10 | } 11 | static void temp(){} 12 | 13 | 14 | -------------------------------------------------------------------------------- /test/tests/20030821-1.c: -------------------------------------------------------------------------------- 1 | extern void abort (void); 2 | 3 | int 4 | foo (int x) 5 | { 6 | if (/*(int)*/ (x & 0x80ff) != /*(int)*/ (0x800e)) 7 | abort (); 8 | 9 | return 0; 10 | } 11 | 12 | int 13 | main () 14 | { 15 | return foo (0x800e); 16 | } 17 | -------------------------------------------------------------------------------- /test/tests/20030828-1.c: -------------------------------------------------------------------------------- 1 | int *p; 2 | 3 | int bar (void) 4 | { 5 | return *p + 1; 6 | } 7 | 8 | main () 9 | { 10 | /* Variable 'i' is never used but it's aliased to a global pointer. The 11 | alias analyzer was not considering that 'i' may be used in the call to 12 | bar(). */ 13 | /*const*/ int i; i = 5; 14 | p = &i; 15 | if (bar() != 6) 16 | abort (); 17 | exit (0); 18 | } 19 | -------------------------------------------------------------------------------- /test/tests/20030909-1.c: -------------------------------------------------------------------------------- 1 | void abort (); 2 | void exit (int); 3 | 4 | void test(int x, int y) 5 | { 6 | if (x == y) 7 | abort (); 8 | } 9 | 10 | void foo(int x, int y) 11 | { 12 | if (x == y) 13 | goto a; 14 | else 15 | { 16 | a:; 17 | if (x == y) 18 | goto b; 19 | else 20 | { 21 | b:; 22 | if (x != y) 23 | test (x, y); 24 | } 25 | } 26 | } 27 | 28 | int main(void) 29 | { 30 | foo (0, 0); 31 | 32 | exit (0); 33 | } 34 | 35 | 36 | -------------------------------------------------------------------------------- /test/tests/20030913-1.c: -------------------------------------------------------------------------------- 1 | /* Assignments via pointers pointing to global variables were being killed 2 | by SSA-DCE. Test contributed by Paul Brook */ 3 | 4 | int glob; 5 | 6 | void 7 | fn2(int ** q) 8 | { 9 | *q = &glob; 10 | } 11 | 12 | void test() 13 | { 14 | int *p; 15 | 16 | fn2(&p); 17 | 18 | *p=42; 19 | } 20 | 21 | int main() 22 | { 23 | test(); 24 | if (glob != 42) abort(); 25 | exit (0); 26 | } 27 | -------------------------------------------------------------------------------- /test/tests/20030920-1.c: -------------------------------------------------------------------------------- 1 | extern void abort (void); 2 | 3 | const char *str = "\x7f\xff"; 4 | int main() 5 | { 6 | int hicount = 0; 7 | unsigned char *c; 8 | for (c = (unsigned char *)str; *c ; c++) { 9 | if (!(((unsigned int)(*c)) < 0x80)) hicount++; 10 | } 11 | if (hicount != 1) 12 | abort (); 13 | return 0; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /test/tests/20040223-1.c: -------------------------------------------------------------------------------- 1 | #include 2 | //#include 3 | 4 | void 5 | a(void *x,int y) 6 | { 7 | if (y != 1234) 8 | abort (); 9 | } 10 | 11 | char allaalla[100]; 12 | 13 | int 14 | main() 15 | { 16 | a(strcpy(/* alloca(100) */ allaalla,"abc"),1234); 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /test/tests/20040309-1.c: -------------------------------------------------------------------------------- 1 | extern void abort (); 2 | 3 | int foo(unsigned short x) 4 | { 5 | unsigned short y; 6 | y = x > 32767 ? x - 32768 : 0; 7 | return y; 8 | } 9 | 10 | int main() 11 | { 12 | if (foo (0) != 0) 13 | abort (); 14 | if (foo (32767) != 0) 15 | abort (); 16 | if (foo (32768) != 0) 17 | abort (); 18 | if (foo (32769) != 1) 19 | abort (); 20 | if (foo (65535) != 32767) 21 | abort (); 22 | return 0; 23 | } 24 | 25 | -------------------------------------------------------------------------------- /test/tests/20040319-1.c: -------------------------------------------------------------------------------- 1 | int 2 | blah (int zzz) 3 | { 4 | int foo; 5 | if (zzz >= 0) 6 | return 1; 7 | foo = (zzz >= 0 ? (zzz) : -(zzz)); 8 | return foo; 9 | } 10 | 11 | main() 12 | { 13 | if (blah (-1) != 1) 14 | abort (); 15 | else 16 | exit (0); 17 | } 18 | -------------------------------------------------------------------------------- /test/tests/20040625-1.c: -------------------------------------------------------------------------------- 1 | /* From PR target/16176 */ 2 | struct s { struct s *next; } /*__attribute__ ((packed))*/; 3 | 4 | struct s * /*__attribute__ ((noinline))*/ 5 | maybe_next (struct s *s, int t) 6 | { 7 | if (t) 8 | s = s->next; 9 | return s; 10 | } 11 | 12 | int main () 13 | { 14 | struct s s1, s2; 15 | 16 | s1.next = &s2; 17 | if (maybe_next (&s1, 1) != &s2) 18 | abort (); 19 | exit (0); 20 | } 21 | -------------------------------------------------------------------------------- /test/tests/20040704-1.c: -------------------------------------------------------------------------------- 1 | /* PR 16348: Make sure that condition-first false loops DTRT. */ 2 | 3 | extern void abort (); 4 | 5 | int main() 6 | { 7 | for (; 0 ;) 8 | { 9 | abort (); 10 | label: 11 | return 0; 12 | } 13 | goto label; 14 | } 15 | -------------------------------------------------------------------------------- /test/tests/20040706-1.c: -------------------------------------------------------------------------------- 1 | int main () 2 | { 3 | int i; 4 | for (i = 0; i < 10; i++) 5 | continue; 6 | if (i < 10) 7 | abort (); 8 | exit (0); 9 | } 10 | -------------------------------------------------------------------------------- /test/tests/20040820-1.c: -------------------------------------------------------------------------------- 1 | /* PR rtl-optimization/17099 */ 2 | 3 | extern void exit (int); 4 | extern void abort (void); 5 | 6 | void 7 | check (int a) 8 | { 9 | if (a != 1) 10 | abort (); 11 | } 12 | 13 | void 14 | test (int a, int b) 15 | { 16 | check ((a ? 1 : 0) | (b ? 2 : 0)); 17 | } 18 | 19 | int 20 | main (void) 21 | { 22 | test (1, 0); 23 | exit (0); 24 | } 25 | -------------------------------------------------------------------------------- /test/tests/20040823-1.c: -------------------------------------------------------------------------------- 1 | /* Ensure that we create VUSE operands also for noreturn functions. */ 2 | 3 | //#include 4 | #include 5 | 6 | int *pwarn; 7 | 8 | void bla (void);// __attribute__ ((noreturn)); 9 | 10 | void bla (void) 11 | { 12 | if (!*pwarn) 13 | abort (); 14 | 15 | exit (0); 16 | } 17 | 18 | int main (void) 19 | { 20 | int warn; 21 | 22 | memset (&warn, 0, sizeof (warn)); 23 | 24 | pwarn = &warn; 25 | 26 | warn = 1; 27 | 28 | bla (); 29 | } 30 | -------------------------------------------------------------------------------- /test/tests/20041210-1.c: -------------------------------------------------------------------------------- 1 | /* The FR-V port used to fail this test because the andcc patterns 2 | wrongly claimed to set the C and V flags. */ 3 | #include 4 | 5 | const int x[4] = { INT_MIN / 2, INT_MAX, 2, 4 }; 6 | 7 | int 8 | main () 9 | { 10 | if (x[0] < x[1]) 11 | if ((x[2] & x[3]) < 0) 12 | abort (); 13 | exit (0); 14 | } 15 | -------------------------------------------------------------------------------- /test/tests/20041212-1.c: -------------------------------------------------------------------------------- 1 | /* A function pointer compared with a void pointer should not be canonicalized. 2 | See PR middle-end/17564. */ 3 | //void *f (void) __attribute__ ((__noinline__)); 4 | void * 5 | f (void) 6 | { 7 | return f; 8 | } 9 | int 10 | main (void) 11 | { 12 | if (f () != f) 13 | abort (); 14 | exit (0); 15 | } 16 | -------------------------------------------------------------------------------- /test/tests/20050106-1.c: -------------------------------------------------------------------------------- 1 | /* PR tree-optimization/19283 */ 2 | 3 | void abort (void); 4 | 5 | /*static*/ /*inline*/ unsigned short 6 | foo (unsigned int *p) 7 | { 8 | return *p; 9 | }//; 10 | 11 | unsigned int u; 12 | 13 | int 14 | main () 15 | { 16 | if ((foo (&u) & 0x8000) != 0) 17 | abort (); 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /test/tests/20050107-1.c: -------------------------------------------------------------------------------- 1 | typedef enum { C = 1, D = 2 } B; 2 | extern void abort (void); 3 | 4 | struct S 5 | { 6 | B a;//__attribute__ ((mode (byte))) a; 7 | B b;//__attribute__ ((mode (byte))) b; 8 | }; 9 | 10 | void 11 | foo (struct S *x) 12 | { 13 | if (x->a != C || x->b != D) 14 | abort (); 15 | } 16 | 17 | int 18 | main (void) 19 | { 20 | struct S s; 21 | s.a = C; 22 | s.b = D; 23 | foo (&s); 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /test/tests/20050131-1.c: -------------------------------------------------------------------------------- 1 | /* Verify that we do not lose side effects on a MOD expression. */ 2 | 3 | #include 4 | //#include 5 | 6 | int 7 | foo (int a) 8 | { 9 | int x; x = 0 % a++; 10 | return a; 11 | } 12 | 13 | main() 14 | { 15 | if (foo (9) != 10) 16 | abort (); 17 | exit (0); 18 | } 19 | -------------------------------------------------------------------------------- /test/tests/20050410-1.c: -------------------------------------------------------------------------------- 1 | const int s = 200; 2 | int //__attribute__((noinline)) 3 | foo (void) 4 | { 5 | return /*(signed char)*/ (s - 100) - 5; 6 | } 7 | int 8 | main (void) 9 | { 10 | if (foo () != 95) 11 | abort (); 12 | exit (0); 13 | } 14 | -------------------------------------------------------------------------------- /test/tests/20051021-1.c: -------------------------------------------------------------------------------- 1 | /* Verify that TRUTH_AND_EXPR is not wrongly changed to TRUTH_ANDIF_EXPR. */ 2 | 3 | extern void abort (void); 4 | 5 | int count;// = 0; 6 | 7 | int foo1(void) 8 | { 9 | count++; 10 | return 0; 11 | } 12 | 13 | int foo2(void) 14 | { 15 | count++; 16 | return 0; 17 | } 18 | 19 | int main(void) 20 | { 21 | count = 0; 22 | if ((foo1() == 1) & (foo2() == 1)) 23 | abort (); 24 | 25 | if (count != 2) 26 | abort (); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /test/tests/20051104-1.c: -------------------------------------------------------------------------------- 1 | /* PR rtl-optimization/23567 */ 2 | 3 | struct st 4 | { 5 | int len; 6 | char *name; 7 | }; struct st s; 8 | 9 | int 10 | main (void) 11 | { 12 | s.len = 0; 13 | s.name = ""; 14 | if (s.name [s.len] != 0) 15 | s.name [s.len] = 0; 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /test/tests/20051215-1.c: -------------------------------------------------------------------------------- 1 | /* PR rtl-optimization/24899 */ 2 | 3 | extern void abort (void); 4 | 5 | /*__attribute__ ((noinline))*/ int 6 | foo (int x, int y, int *z) 7 | { 8 | int a, b, c, d; 9 | 10 | a = b = 0; 11 | for (d = 0; d < y; d++) 12 | { 13 | if (z) 14 | b = d * *z; 15 | for (c = 0; c < x; c++) 16 | a += b; 17 | } 18 | 19 | return a; 20 | } 21 | 22 | int 23 | main (void) 24 | { 25 | if (foo (3, 2, 0) != 0) 26 | abort (); 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /test/tests/20060102-1.c: -------------------------------------------------------------------------------- 1 | extern void abort (); 2 | 3 | int f(int x) 4 | { 5 | return (x >> (sizeof (x) * /*__CHAR_BIT__*/ 8 - 1)) ? -1 : 1; 6 | } 7 | 8 | /* volatile */ const int one = 1; 9 | int main (void) 10 | { 11 | /* Test that the function above returns different values for 12 | different signs. */ 13 | if (f(one) == f(-one)) 14 | abort (); 15 | return 0; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /test/tests/20070212-1.c: -------------------------------------------------------------------------------- 1 | struct f 2 | { 3 | int i; 4 | }; 5 | 6 | int g(int i, int c, struct f *ff, int *p) 7 | { 8 | int *t; 9 | if (c) 10 | t = &i; 11 | else 12 | t = &ff->i; 13 | *p = 0; 14 | return *t; 15 | } 16 | 17 | extern void abort(void); 18 | 19 | int main() 20 | { 21 | struct f f; 22 | f.i = 1; 23 | if (g(5, 0, &f, &f.i) != 0) 24 | abort (); 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /test/tests/20070212-2.c: -------------------------------------------------------------------------------- 1 | int f(int k, int i1, int j1) 2 | { 3 | int *f1; 4 | if(k) 5 | f1 = &i1; 6 | else 7 | f1 = &j1; 8 | i1 = 0; 9 | return *f1; 10 | } 11 | 12 | extern void abort (void); 13 | 14 | int main() 15 | { 16 | if (f(1, 1, 2) != 0) 17 | abort (); 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /test/tests/20070212-3.c: -------------------------------------------------------------------------------- 1 | struct foo { int i; int j; }; 2 | 3 | int bar (struct foo *k, int k2, int f, int f2) 4 | { 5 | int *p, *q; 6 | int res; 7 | if (f) 8 | p = &k->i; 9 | else 10 | p = &k->j; 11 | res = *p; 12 | k->i = 1; 13 | if (f2) 14 | q = p; 15 | else 16 | q = &k2; 17 | return res + *q; 18 | } 19 | 20 | extern void abort (void); 21 | 22 | int main() 23 | { 24 | struct foo k; 25 | k.i = 0; 26 | k.j = 1; 27 | if (bar (&k, 1, 1, 1) != 1) 28 | abort (); 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /test/tests/20070424-1.c: -------------------------------------------------------------------------------- 1 | extern void abort (void); 2 | extern void exit (int); 3 | 4 | void do_exit (void) { exit (0); } 5 | void do_abort (void) { abort (); } 6 | 7 | void foo (int x, int a) 8 | { 9 | if (x < a) 10 | goto doit; 11 | do_exit (); 12 | if (x != a) 13 | goto doit; 14 | 15 | /* else */ 16 | do_abort (); 17 | return; 18 | 19 | doit: 20 | do_abort (); 21 | } 22 | 23 | int main() 24 | { 25 | foo (1, 0); 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /test/tests/20071011-1.c: -------------------------------------------------------------------------------- 1 | extern void abort(void); 2 | void foo(int *p) 3 | { 4 | int x; 5 | int y; 6 | x = *p; 7 | *p = 0; 8 | y = *p; 9 | if (x != y) 10 | return; 11 | abort (); 12 | } 13 | 14 | int main() 15 | { 16 | int a = 1; 17 | foo(&a); 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /test/tests/20200414.c: -------------------------------------------------------------------------------- 1 | extern void abort(void); 2 | 3 | #pragma fastcall test_1_aa(word __ax) macro; 4 | 5 | char aa; 6 | 7 | #asm 8 | 9 | _test_1_aa.1 .macro 10 | 11 | lda #2 12 | sta [__ax] 13 | .endm 14 | 15 | #endasm 16 | 17 | int main() 18 | { 19 | aa = 1; 20 | test_1_aa(&aa); 21 | 22 | if (aa == 2) 23 | exit(0); 24 | 25 | abort(); 26 | 27 | exit(0); 28 | } 29 | 30 | -------------------------------------------------------------------------------- /test/tests/20200415.c: -------------------------------------------------------------------------------- 1 | extern void abort(void); 2 | 3 | #incasmlabel(test1, "./tests/20200415_asm1.asm"); 4 | #incasmlabel(test2, "./tests/20200415_asm2.asm", 3); 5 | #incasmlabel(test3, "./tests/20200415_asm3.asm", 2000); 6 | 7 | int main() 8 | { 9 | char aa = 1; 10 | if (aa == 1) 11 | exit(0); 12 | 13 | abort(); 14 | 15 | exit(0); 16 | } 17 | 18 | -------------------------------------------------------------------------------- /test/tests/20200415_asm1.asm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | .code 5 | inc a 6 | 7 | -------------------------------------------------------------------------------- /test/tests/20200415_asm2.asm: -------------------------------------------------------------------------------- 1 | .code 2 | 3 | lda #$00 4 | 5 | 6 | -------------------------------------------------------------------------------- /test/tests/20200415_asm3.asm: -------------------------------------------------------------------------------- 1 | 2 | 3 | .code 4 | 5 | sta <$00 6 | -------------------------------------------------------------------------------- /test/tests/20210724.c: -------------------------------------------------------------------------------- 1 | extern void abort(void); 2 | 3 | int test2; 4 | 5 | void test(int var){ 6 | int x; 7 | test2 = var; 8 | } 9 | 10 | int main() 11 | { 12 | test2 = 1; 13 | test(0b0101); 14 | if (test2 == 5 && 0b0101 == 5) 15 | exit(0); 16 | 17 | abort(); 18 | 19 | exit(0); 20 | } 21 | 22 | -------------------------------------------------------------------------------- /test/tests/920202-1.c: -------------------------------------------------------------------------------- 1 | static int rule_text_needs_stack_pop;// = 0; 2 | static const int input_stack_pos = 1; 3 | 4 | f (void) 5 | { 6 | rule_text_needs_stack_pop = 1; 7 | 8 | if (input_stack_pos <= 0) 9 | return 1; 10 | else 11 | return 0; 12 | } 13 | 14 | main () 15 | { 16 | rule_text_needs_stack_pop = 0; 17 | f (); 18 | exit (0); 19 | } 20 | -------------------------------------------------------------------------------- /test/tests/920409-1.c: -------------------------------------------------------------------------------- 1 | x(){signed char c=-1;return c<0;}main(){if(x()!=1)abort();exit(0);} 2 | -------------------------------------------------------------------------------- /test/tests/920428-1.c: -------------------------------------------------------------------------------- 1 | x(const char*s){char a[1];/*const*/ char*ss; ss=s;a[*s++]|=1;return /*(int)*/ss+1==/*(int)*/s;} 2 | main(){if(x("")!=1)abort();exit(0);} 3 | -------------------------------------------------------------------------------- /test/tests/920429-1.c: -------------------------------------------------------------------------------- 1 | #define t unsigned char 2 | /*typedef unsigned char t;*/int i,j; 3 | t*f(t*p){t c;c=*p++;i=((c&2)?1:0);j=(c&7)+1;return p;} 4 | main(){t*p0,*p1;p0="ab";p1=f(p0);if(p0+1!=p1)abort();exit(0);} 5 | -------------------------------------------------------------------------------- /test/tests/920501-1.c: -------------------------------------------------------------------------------- 1 | int s[2]; 2 | x(){if(!s[0]){s[1+s[1]]=s[1];return 1;}} 3 | main(){s[0]=s[1]=0;if(x()!=1)abort();exit(0);} 4 | -------------------------------------------------------------------------------- /test/tests/920506-1.c: -------------------------------------------------------------------------------- 1 | const int l[]={0,1}; 2 | main(){int*p;p=l;switch(*p++){case 0:exit(0);case 1:break;case 2:break;case 3:case 4:break;}abort();} 3 | -------------------------------------------------------------------------------- /test/tests/920603-1.c: -------------------------------------------------------------------------------- 1 | f(int got){if(got!=0xffff)abort();} 2 | main(){signed char c=-1;unsigned u;u=/*(unsigned short)*/c;f(u);exit(0);} 3 | -------------------------------------------------------------------------------- /test/tests/920612-1.c: -------------------------------------------------------------------------------- 1 | f(j)int j;{return++j>0;} 2 | main(){if(f((~0/*U*/)>>1))abort();exit(0);} 3 | -------------------------------------------------------------------------------- /test/tests/920612-2.c: -------------------------------------------------------------------------------- 1 | int i;// = 0; 2 | int a (int x) 3 | { 4 | while (x) 5 | i++, x--; 6 | return x; 7 | } 8 | main () 9 | { 10 | i = 0; 11 | #ifndef NO_TRAMPOLINES 12 | if (a (2) != 0) 13 | abort (); 14 | #endif 15 | exit (0); 16 | } 17 | -------------------------------------------------------------------------------- /test/tests/920721-3.c: -------------------------------------------------------------------------------- 1 | static /*inline*/ fu (unsigned short data) 2 | { 3 | return data; 4 | } 5 | ru(int i) 6 | { 7 | if(fu(i++)!=5)abort(); 8 | if(fu(++i)!=7)abort(); 9 | } 10 | static /*inline*/ fs (signed short data) 11 | { 12 | return data; 13 | } 14 | rs(int i) 15 | { 16 | if(fs(i++)!=5)abort(); 17 | if(fs(++i)!=7)abort(); 18 | } 19 | 20 | 21 | main() 22 | { 23 | ru(5); 24 | rs(5); 25 | exit(0); 26 | } 27 | -------------------------------------------------------------------------------- /test/tests/920730-1.c: -------------------------------------------------------------------------------- 1 | /* 920730-1.c */ 2 | #include 3 | f1() 4 | { 5 | int b=INT_MIN; 6 | return b>=INT_MIN; 7 | } 8 | 9 | f2() 10 | { 11 | int b=INT_MIN+1; 12 | return b>= /*(unsigned)*/(INT_MAX+2); 13 | } 14 | 15 | f3() 16 | { 17 | int b=INT_MAX; 18 | return b>=INT_MAX; 19 | } 20 | 21 | f4() 22 | { 23 | int b=-1; 24 | return b>=UINT_MAX; 25 | } 26 | 27 | main () 28 | { 29 | if((f1()&f2()&f3()&f4())!=1) 30 | abort(); 31 | exit(0); 32 | } 33 | -------------------------------------------------------------------------------- /test/tests/920731-1.c: -------------------------------------------------------------------------------- 1 | f(int x){int i;for(i=0;i<8&&(x&1)==0;x>>=1,i++);return i;} 2 | main(){if(f(4)!=2)abort();exit(0);} 3 | -------------------------------------------------------------------------------- /test/tests/920812-1.c: -------------------------------------------------------------------------------- 1 | //typedef int t; 2 | #define t int 3 | f(t y){switch(y){case 1:return 1;}return 0;} 4 | main(){if(f(/*(t)*/1)!=1)abort();exit(0);} 5 | -------------------------------------------------------------------------------- /test/tests/920909-1.c: -------------------------------------------------------------------------------- 1 | f(int a){switch(a){case 0x402:return a+1;case 0x403:return a+2;case 0x404:return a+3;case 0x405:return a+4; 2 | case 0x406:return 1;case 0x407:return 4;}return 0;} 3 | main(){if(f(1))abort();exit(0);} 4 | -------------------------------------------------------------------------------- /test/tests/921006-1.c: -------------------------------------------------------------------------------- 1 | /* REPRODUCED:RUN:SIGNAL MACHINE:i386 OPTIONS:-O */ 2 | main() 3 | { 4 | if(strcmp("X","")<0)abort(); 5 | exit(0); 6 | } 7 | -------------------------------------------------------------------------------- /test/tests/921123-1.c: -------------------------------------------------------------------------------- 1 | f(short *p) 2 | { 3 | short x; x = *p; 4 | return (--x < 0); 5 | } 6 | 7 | main() 8 | { 9 | short x = -10; 10 | if (!f(&x)) 11 | abort(); 12 | exit(0); 13 | } 14 | -------------------------------------------------------------------------------- /test/tests/921207-1.c: -------------------------------------------------------------------------------- 1 | f() 2 | { 3 | unsigned b = 0; 4 | 5 | if (b > ~0/*U*/) 6 | b = ~0/*U*/; 7 | 8 | return b; 9 | } 10 | main() 11 | { 12 | if (f()!=0) 13 | abort(); 14 | exit (0); 15 | } 16 | -------------------------------------------------------------------------------- /test/tests/921218-1.c: -------------------------------------------------------------------------------- 1 | f() 2 | { 3 | return (unsigned char)("\377"[0]); 4 | } 5 | 6 | main() 7 | { 8 | if (f() != (unsigned char)(0377)) 9 | abort(); 10 | exit (0); 11 | } 12 | -------------------------------------------------------------------------------- /test/tests/930123-1.c: -------------------------------------------------------------------------------- 1 | f(int *x) 2 | { 3 | *x = 0; 4 | } 5 | 6 | main() 7 | { 8 | int s, c, x; 9 | char a[2]; a[0] = 'c'; a[1] = 0; 10 | 11 | f(&s); 12 | a[c = 0] = s == 0 ? (x=1, 'a') : (x=2, 'b'); 13 | if (a[c] != 'a') 14 | abort(); 15 | exit (0); 16 | } 17 | -------------------------------------------------------------------------------- /test/tests/930408-1.c: -------------------------------------------------------------------------------- 1 | typedef enum foo E; 2 | enum foo { e0, e1 }; 3 | 4 | struct { 5 | E eval; 6 | } s; 7 | 8 | p() 9 | { 10 | abort(); 11 | } 12 | 13 | f() 14 | { 15 | switch (s.eval) 16 | { 17 | case e0: 18 | p(); 19 | } 20 | } 21 | 22 | main() 23 | { 24 | s.eval = e1; 25 | f(); 26 | exit(0); 27 | } 28 | -------------------------------------------------------------------------------- /test/tests/930429-1.c: -------------------------------------------------------------------------------- 1 | char * 2 | f (char *p) 3 | { 4 | short x; x = *p++ << 16; 5 | return p; 6 | } 7 | 8 | main () 9 | { 10 | char *p; p = ""; 11 | if (f (p) != p + 1) 12 | abort (); 13 | exit (0); 14 | } 15 | -------------------------------------------------------------------------------- /test/tests/930429-2.c: -------------------------------------------------------------------------------- 1 | int 2 | f (int b) 3 | { 4 | return (b >> 1) > 0; 5 | } 6 | 7 | main () 8 | { 9 | if (!f (9)) 10 | abort (); 11 | if (f (-9)) 12 | abort (); 13 | exit (0); 14 | } 15 | -------------------------------------------------------------------------------- /test/tests/930513-2.c: -------------------------------------------------------------------------------- 1 | sub3 (i) 2 | /*const*/ int *i; 3 | { 4 | } 5 | 6 | eq (int a, int b) 7 | { 8 | static int i;// = 0; 9 | if (a != i) 10 | abort (); 11 | i++; 12 | } 13 | 14 | main () 15 | { 16 | int i; 17 | 18 | for (i = 0; i < 4; i++) 19 | { 20 | /*const*/ int j, k; j = i; 21 | //int k; 22 | sub3 (&j); 23 | k = j; 24 | eq (k, k); 25 | } 26 | exit (0); 27 | } 28 | -------------------------------------------------------------------------------- /test/tests/930518-1.c: -------------------------------------------------------------------------------- 1 | int bar;// = 0; 2 | 3 | f (p) 4 | int *p; 5 | { 6 | int foo = 2; 7 | 8 | while (foo > bar) 9 | { 10 | foo -= bar; 11 | *p++ = foo; 12 | bar = 1; 13 | } 14 | } 15 | 16 | main () 17 | { 18 | int tab[2]; 19 | bar = 0; 20 | tab[0] = tab[1] = 0; 21 | f (tab); 22 | if (tab[0] != 2 || tab[1] != 1) 23 | abort (); 24 | exit (0); 25 | } 26 | -------------------------------------------------------------------------------- /test/tests/930526-1.c: -------------------------------------------------------------------------------- 1 | /*inline*/ 2 | f (int x) 3 | { 4 | int *p[13]; 5 | int m[13*3]; 6 | int i; 7 | 8 | for (i = 0; i < 13; i++) 9 | p[i] = m + x*i; 10 | 11 | p[1][0] = 0; 12 | } 13 | 14 | main () 15 | { 16 | f (3); 17 | exit (0); 18 | } 19 | -------------------------------------------------------------------------------- /test/tests/930527-1.c: -------------------------------------------------------------------------------- 1 | f (unsigned char x) 2 | { 3 | return (0x50 | (x >> 4)) ^ 0xff; 4 | } 5 | 6 | main () 7 | { 8 | if (f (0) != 0xaf) 9 | abort (); 10 | exit (0); 11 | } 12 | -------------------------------------------------------------------------------- /test/tests/930622-1.c: -------------------------------------------------------------------------------- 1 | int a/* = 1*/, b; 2 | 3 | g () { return 0; } 4 | h (int x) {} 5 | 6 | f () 7 | { 8 | if (g () == -1) 9 | return 0; 10 | a = g (); 11 | if (b >= 1) 12 | h (a); 13 | return 0; 14 | } 15 | 16 | main () 17 | { 18 | a = 1; 19 | f (); 20 | if (a != 0) 21 | abort (); 22 | exit (0); 23 | } 24 | -------------------------------------------------------------------------------- /test/tests/930719-1.c: -------------------------------------------------------------------------------- 1 | int 2 | f (foo, bar, com) 3 | int foo, bar, com; 4 | { 5 | unsigned align; 6 | if (foo) 7 | return 0; 8 | while (1) 9 | { 10 | switch (bar) 11 | { 12 | case 1: 13 | if (com != 0) 14 | return align; 15 | // Excuse me? *(char *) 0 = 0; 16 | abort(); 17 | } 18 | } 19 | } 20 | 21 | main () 22 | { 23 | f (0, 1, 1); 24 | exit (0); 25 | } 26 | -------------------------------------------------------------------------------- /test/tests/930725-1.c: -------------------------------------------------------------------------------- 1 | int v; 2 | 3 | char * 4 | g () 5 | { 6 | return ""; 7 | } 8 | 9 | char * 10 | f () 11 | { 12 | return (v == 0 ? g () : "abc"); 13 | } 14 | 15 | main () 16 | { 17 | v = 1; 18 | if (!strcmp (f (), "abc")) 19 | exit (0); 20 | abort(); 21 | } 22 | -------------------------------------------------------------------------------- /test/tests/930916-1.c: -------------------------------------------------------------------------------- 1 | f (n) 2 | unsigned n; 3 | { 4 | if ((int) n >= 0) 5 | abort (); 6 | } 7 | 8 | main () 9 | { 10 | unsigned x = ~0; 11 | f (x); 12 | exit (0); 13 | } 14 | -------------------------------------------------------------------------------- /test/tests/931009-1.c: -------------------------------------------------------------------------------- 1 | main () 2 | { 3 | f (); 4 | exit (0); 5 | } 6 | 7 | static 8 | g (out, size, lo, hi) 9 | int *out, size, lo, hi; 10 | { 11 | int j; 12 | 13 | for (j = 0; j < size; j++) 14 | out[j] = j * (hi - lo); 15 | } 16 | 17 | 18 | f () 19 | { 20 | int a[2]; 21 | 22 | g (a, 2, 0, 1); 23 | 24 | if (a[0] != 0 || a[1] != 1) 25 | abort (); 26 | } 27 | -------------------------------------------------------------------------------- /test/tests/931012-1.c: -------------------------------------------------------------------------------- 1 | f (int b, int c) 2 | { 3 | if (b != 0 && b != 1 && c != 0) 4 | b = 0; 5 | return b; 6 | } 7 | 8 | main () 9 | { 10 | if (!f (1, 2)) 11 | abort(); 12 | exit(0); 13 | } 14 | -------------------------------------------------------------------------------- /test/tests/931102-1.c: -------------------------------------------------------------------------------- 1 | struct x { 2 | char h,l; 3 | }; 4 | union T 5 | { 6 | /*struct 7 | { 8 | char h, l; 9 | } b; */ 10 | struct x b; 11 | }; 12 | 13 | f (x) 14 | int x; 15 | { 16 | int num = 0; 17 | union T reg; 18 | 19 | reg.b.l = x; 20 | while ((reg.b.l & 1) == 0) 21 | { 22 | num++; 23 | reg.b.l >>= 1; 24 | } 25 | return num; 26 | } 27 | 28 | main () 29 | { 30 | if (f (2) != 1) 31 | abort (); 32 | exit (0); 33 | } 34 | 35 | -------------------------------------------------------------------------------- /test/tests/931110-2.c: -------------------------------------------------------------------------------- 1 | const int a[] = {3, 4}; 2 | main () 3 | { 4 | //static int a[] = {3, 4}; 5 | register int *b; 6 | int c; 7 | 8 | b = a; 9 | c = *b++ % 8; 10 | if (c != 3) 11 | abort (); 12 | exit (0); 13 | } 14 | -------------------------------------------------------------------------------- /test/tests/931228-1.c: -------------------------------------------------------------------------------- 1 | f (int x) 2 | { 3 | x &= 010000; 4 | x &= 007777; 5 | x ^= 017777; 6 | x &= 017770; 7 | return x; 8 | } 9 | 10 | main () 11 | { 12 | if (f (-1) != 017770) 13 | abort (); 14 | exit (0); 15 | } 16 | -------------------------------------------------------------------------------- /test/tests/940115-1.c: -------------------------------------------------------------------------------- 1 | f (cp, end) 2 | char *cp; 3 | char *end; 4 | { 5 | return (cp < end); 6 | } 7 | 8 | main () 9 | { 10 | if (! f (/*(char *)*/ 0, /*(char *)*/ 1)) 11 | abort(); 12 | exit (0); 13 | } 14 | -------------------------------------------------------------------------------- /test/tests/940122-1.c: -------------------------------------------------------------------------------- 1 | const char *a = 0; 2 | const char *b = 0; 3 | 4 | g (x) 5 | int x; 6 | { 7 | if ((!!a) != (!!b)) 8 | abort (); 9 | } 10 | 11 | f (x) 12 | int x; 13 | { 14 | g (x * x); 15 | } 16 | 17 | main () 18 | { 19 | f (100); 20 | exit (0); 21 | } 22 | -------------------------------------------------------------------------------- /test/tests/941101-1.c: -------------------------------------------------------------------------------- 1 | f () 2 | { 3 | int var = 7; 4 | 5 | if ((var/7) == 1) 6 | return var/7; 7 | return 0; 8 | } 9 | 10 | main () 11 | { 12 | if (f () != 1) 13 | abort (); 14 | exit (0); 15 | } 16 | -------------------------------------------------------------------------------- /test/tests/941110-1.c: -------------------------------------------------------------------------------- 1 | f (const int x) 2 | { 3 | int y = 0; 4 | y = x ? y : -y; 5 | { 6 | /*const*/ int *p; p = &x; 7 | } 8 | return y; 9 | } 10 | 11 | main () 12 | { 13 | if (f (0)) 14 | abort (); 15 | exit (0); 16 | } 17 | -------------------------------------------------------------------------------- /test/tests/950322-1.c: -------------------------------------------------------------------------------- 1 | f (unsigned char *a) 2 | { 3 | int i, j; 4 | int x, y; 5 | 6 | j = a[1]; 7 | i = a[0] - j; 8 | if (i < 0) 9 | { 10 | x = 1; 11 | y = -i; 12 | } 13 | else 14 | { 15 | x = 0; 16 | y = i; 17 | } 18 | return x + y; 19 | } 20 | 21 | 22 | main () 23 | { 24 | unsigned char a[2]; 25 | a[0] = 8; 26 | a[1] = 9; 27 | if (f (a) != 2) 28 | abort (); 29 | exit (0); 30 | } 31 | -------------------------------------------------------------------------------- /test/tests/950426-1.c: -------------------------------------------------------------------------------- 1 | 2 | struct tag { 3 | int m1; 4 | char *m2[5]; 5 | } s1, *p1; 6 | 7 | int i; 8 | 9 | main() 10 | { 11 | s1.m1 = -1; 12 | p1 = &s1; 13 | 14 | if ( func1( &p1->m1 ) == -1 ) 15 | foo ("ok"); 16 | else 17 | abort (); 18 | 19 | i = 3; 20 | s1.m2[3]= "123"; 21 | 22 | if ( strlen( (p1->m2[i])++ ) == 3 ) 23 | foo ("ok"); 24 | else 25 | abort (); 26 | 27 | exit (0); 28 | } 29 | 30 | func1(int *p) { return(*p); } 31 | 32 | foo (char *s) {} 33 | -------------------------------------------------------------------------------- /test/tests/950605-1.c: -------------------------------------------------------------------------------- 1 | f (c) 2 | unsigned char c; 3 | { 4 | if (c != 0xFF) 5 | abort (); 6 | } 7 | 8 | main () 9 | { 10 | f (-1); 11 | exit (0); 12 | } 13 | -------------------------------------------------------------------------------- /test/tests/950621-1.c: -------------------------------------------------------------------------------- 1 | struct s 2 | { 3 | int a; 4 | int b; 5 | struct s *dummy; 6 | }; 7 | 8 | f (struct s *sp) 9 | { 10 | return sp && sp->a == -1 && sp->b == -1; 11 | } 12 | 13 | main () 14 | { 15 | struct s x; 16 | x.a = x.b = -1; 17 | if (f (&x) == 0) 18 | abort (); 19 | exit (0); 20 | } 21 | -------------------------------------------------------------------------------- /test/tests/950706-1.c: -------------------------------------------------------------------------------- 1 | int 2 | f (int n) 3 | { 4 | return (n > 0) - (n < 0); 5 | } 6 | 7 | main () 8 | { 9 | if (f (-1) != -1) 10 | abort (); 11 | if (f (1) != 1) 12 | abort (); 13 | if (f (0) != 0) 14 | abort (); 15 | exit (0); 16 | } 17 | -------------------------------------------------------------------------------- /test/tests/950714-1.c: -------------------------------------------------------------------------------- 1 | const int array[10] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; 2 | 3 | main () 4 | { 5 | int i, j; 6 | int *p; 7 | 8 | for (i = 0; i < 10; i++) 9 | for (p = &array[0]; p != &array[9]; p++) 10 | if (*p == i) 11 | goto label; 12 | 13 | label: 14 | if (i != 1) 15 | abort (); 16 | exit (0); 17 | } 18 | -------------------------------------------------------------------------------- /test/tests/950929-1.c: -------------------------------------------------------------------------------- 1 | int f (char *p) { } 2 | 3 | main () 4 | { 5 | char c; 6 | char c2; 7 | int i = 0; 8 | char *pc, *pc2, *pi; 9 | /*char **/pc = &c; 10 | /*char **/pc2 = &c2; 11 | /*int **/pi = &i; 12 | 13 | *pc2 = 1; 14 | *pi = 1; 15 | *pc2 &= *pi; 16 | f (pc2); 17 | *pc2 = 1; 18 | *pc2 &= *pi; 19 | if (*pc2 != 1) 20 | abort (); 21 | exit (0); 22 | } 23 | -------------------------------------------------------------------------------- /test/tests/951003-1.c: -------------------------------------------------------------------------------- 1 | int f (int i) { return 12; } 2 | int g () { return 0; } 3 | 4 | main () 5 | { 6 | int i, s; 7 | 8 | for (i = 0; i < 32; i++) 9 | { 10 | s = f (i); 11 | 12 | if (i == g ()) 13 | s = 42; 14 | if (i == 0 || s == 12) 15 | ; 16 | else 17 | abort (); 18 | } 19 | 20 | exit (0); 21 | } 22 | -------------------------------------------------------------------------------- /test/tests/951115-1.c: -------------------------------------------------------------------------------- 1 | int var;// = 0; 2 | 3 | g () 4 | { 5 | var = 1; 6 | } 7 | 8 | f () 9 | { 10 | int f2 = 0; 11 | 12 | if (f2 == 0) 13 | ; 14 | 15 | g (); 16 | } 17 | 18 | main () 19 | { 20 | var = 0; 21 | f (); 22 | if (var != 1) 23 | abort (); 24 | exit (0); 25 | } 26 | -------------------------------------------------------------------------------- /test/tests/951204-1.c: -------------------------------------------------------------------------------- 1 | f (char *x) 2 | { 3 | *x = 'x'; 4 | } 5 | 6 | main () 7 | { 8 | int i; 9 | char x = '\0'; 10 | 11 | for (i = 0; i < 100; ++i) 12 | { 13 | f (&x); 14 | if (*/*(const char *)*/ &x != 'x') 15 | abort (); 16 | } 17 | exit (0); 18 | } 19 | -------------------------------------------------------------------------------- /test/tests/960218-1.c: -------------------------------------------------------------------------------- 1 | int glob; 2 | 3 | g (int x) 4 | { 5 | glob = x; 6 | return 0; 7 | } 8 | 9 | f (int x) 10 | { 11 | int a; a = ~x; 12 | while (a) 13 | a = g (a); 14 | } 15 | 16 | main () 17 | { 18 | f (3); 19 | if (glob != -4) 20 | abort (); 21 | exit (0); 22 | } 23 | -------------------------------------------------------------------------------- /test/tests/960219-1.c: -------------------------------------------------------------------------------- 1 | f (int i) 2 | { 3 | if (((1 << i) & 1) == 0) 4 | abort (); 5 | } 6 | 7 | main () 8 | { 9 | f (0); 10 | exit (0); 11 | } 12 | -------------------------------------------------------------------------------- /test/tests/960317-1.c: -------------------------------------------------------------------------------- 1 | int 2 | f (unsigned bitcount, int mant) 3 | { 4 | int mask; mask = -1 << bitcount; 5 | { 6 | if (! (mant & -mask)) 7 | goto ab; 8 | if (mant & ~mask) 9 | goto auf; 10 | } 11 | ab: 12 | return 0; 13 | auf: 14 | return 1; 15 | } 16 | 17 | main () 18 | { 19 | if (f (0, -1)) 20 | abort (); 21 | exit (0); 22 | } 23 | -------------------------------------------------------------------------------- /test/tests/960419-1.c: -------------------------------------------------------------------------------- 1 | static int i; 2 | 3 | void 4 | check(x) 5 | int x; 6 | { 7 | if (!x) 8 | abort(); 9 | } 10 | 11 | main() 12 | { 13 | int *p; p = &i; 14 | 15 | check(p != /*(void *)*/0); 16 | exit (0); 17 | } 18 | -------------------------------------------------------------------------------- /test/tests/960830-1.c: -------------------------------------------------------------------------------- 1 | #ifdef __i386__ 2 | f (rp) 3 | unsigned int *rp; 4 | { 5 | __asm__ ("mull %3" : "=a" (rp[0]), "=d" (rp[1]) : "%0" (7), "rm" (7)); 6 | } 7 | 8 | main () 9 | { 10 | unsigned int s[2]; 11 | 12 | f (s); 13 | if (s[1] != 0 || s[0] != 49) 14 | abort (); 15 | exit (0); 16 | } 17 | #else 18 | main () 19 | { 20 | exit (0); 21 | } 22 | #endif 23 | -------------------------------------------------------------------------------- /test/tests/960909-1.c: -------------------------------------------------------------------------------- 1 | int 2 | ffs (x) 3 | int x; 4 | { 5 | int bit, mask; 6 | 7 | if (x == 0) 8 | return 0; 9 | 10 | for (bit = 1, mask = 1; !(x & mask); bit++, mask <<= 1) 11 | ; 12 | 13 | return bit; 14 | } 15 | 16 | f (x) 17 | int x; 18 | { 19 | int y; 20 | y = ffs (x) - 1; 21 | if (y < 0) 22 | abort (); 23 | } 24 | 25 | main () 26 | { 27 | f (1); 28 | exit (0); 29 | } 30 | -------------------------------------------------------------------------------- /test/tests/961004-1.c: -------------------------------------------------------------------------------- 1 | int k;// = 0; 2 | 3 | main() 4 | { 5 | int i; 6 | int j; 7 | k = 0; 8 | for (i = 0; i < 2; i++) 9 | { 10 | if (k) 11 | { 12 | if (j != 2) 13 | abort (); 14 | } 15 | else 16 | { 17 | j = 2; 18 | k++; 19 | } 20 | } 21 | exit (0); 22 | } 23 | -------------------------------------------------------------------------------- /test/tests/961017-1.c: -------------------------------------------------------------------------------- 1 | main () 2 | { 3 | unsigned char z = 0; 4 | 5 | do ; 6 | while (--z > 0); 7 | exit (0); 8 | } 9 | -------------------------------------------------------------------------------- /test/tests/961026-1.c: -------------------------------------------------------------------------------- 1 | int 2 | test (arg) 3 | int arg; 4 | { 5 | if (arg > 0 || arg == 0) 6 | return 0; 7 | return -1; 8 | } 9 | 10 | main () 11 | { 12 | if (test (0) != 0) 13 | abort (); 14 | if (test (-1) != -1) 15 | abort (); 16 | exit (0); 17 | } 18 | -------------------------------------------------------------------------------- /test/tests/961112-1.c: -------------------------------------------------------------------------------- 1 | f (int x) 2 | { 3 | if (x != 0 || x == 0) 4 | return 0; 5 | return 1; 6 | } 7 | 8 | main () 9 | { 10 | if (f (3)) 11 | abort (); 12 | exit (0); 13 | } 14 | -------------------------------------------------------------------------------- /test/tests/961122-2.c: -------------------------------------------------------------------------------- 1 | int 2 | f (int a) 3 | { 4 | return ((a >= 0 && a <= 10) && ! (a >= 0)); 5 | } 6 | 7 | main () 8 | { 9 | if (f (0)) 10 | abort (); 11 | exit (0); 12 | } 13 | -------------------------------------------------------------------------------- /test/tests/970923-1.c: -------------------------------------------------------------------------------- 1 | int 2 | ts(a) 3 | int a; 4 | { 5 | if (a < 1000 && a > 2000) 6 | return 1; 7 | else 8 | return 0; 9 | } 10 | 11 | int 12 | tu(a) 13 | unsigned int a; 14 | { 15 | if (a < 1000 && a > 2000) 16 | return 1; 17 | else 18 | return 0; 19 | } 20 | 21 | 22 | main() 23 | { 24 | if (ts (0) || tu (0)) 25 | abort (); 26 | exit (0); 27 | } 28 | -------------------------------------------------------------------------------- /test/tests/980424-1.c: -------------------------------------------------------------------------------- 1 | int i, a[99]; 2 | 3 | void f (int one) 4 | { 5 | if (one != 1) 6 | abort (); 7 | } 8 | 9 | void 10 | g () 11 | { 12 | f (a[i & 0x3f]); 13 | } 14 | 15 | int 16 | main () 17 | { 18 | a[0] = 1; 19 | i = 0x40; 20 | g (); 21 | exit (0); 22 | } 23 | -------------------------------------------------------------------------------- /test/tests/980505-1.c: -------------------------------------------------------------------------------- 1 | static int f(int);// __attribute__((const)); 2 | int main() 3 | { 4 | int f1, f2, x; 5 | x = 1; f1 = f(x); 6 | x = 2; f2 = f(x); 7 | if (f1 != 1 || f2 != 2) 8 | abort (); 9 | exit (0); 10 | } 11 | static int f(int x) { return x; } 12 | -------------------------------------------------------------------------------- /test/tests/980505-2.c: -------------------------------------------------------------------------------- 1 | //typedef unsigned short Uint16; 2 | //typedef unsigned int Uint; 3 | #define Uint16 unsigned short 4 | #define Uint unsigned int 5 | 6 | Uint f () 7 | { 8 | Uint16 token; 9 | Uint count; 10 | static Uint16 values[1]; values[0] = 0x9300; 11 | 12 | token = values[0]; 13 | count = token >> 8; 14 | 15 | return count; 16 | } 17 | 18 | int 19 | main () 20 | { 21 | if (f () != 0x93) 22 | abort (); 23 | exit (0); 24 | } 25 | -------------------------------------------------------------------------------- /test/tests/980506-1.c: -------------------------------------------------------------------------------- 1 | struct decision 2 | { 3 | char enforce_mode; 4 | struct decision *next; 5 | }; 6 | 7 | 8 | static void 9 | clear_modes (p) 10 | register struct decision *p; 11 | { 12 | goto blah; 13 | 14 | foo: 15 | p->enforce_mode = 0; 16 | blah: 17 | if (p) 18 | goto foo; 19 | } 20 | 21 | main() 22 | { 23 | struct decision *p = 0; 24 | clear_modes (p); 25 | exit (0); 26 | } 27 | -------------------------------------------------------------------------------- /test/tests/980506-2.c: -------------------------------------------------------------------------------- 1 | static void *self(void *p){ return p; } 2 | 3 | struct x { int i;}; 4 | 5 | int 6 | f() 7 | { 8 | struct /*{ int i; }*/ x s, *sp; 9 | int *ip; ip = &s.i; 10 | 11 | s.i = 1; 12 | sp = self(&s); 13 | 14 | *ip = 0; 15 | return sp->i+1; 16 | } 17 | 18 | main() 19 | { 20 | if (f () != 1) 21 | abort (); 22 | else 23 | exit (0); 24 | } 25 | -------------------------------------------------------------------------------- /test/tests/980506-3.c: -------------------------------------------------------------------------------- 1 | unsigned char lookup_table [257]; 2 | 3 | static int 4 | build_lookup (pattern) 5 | unsigned char *pattern; 6 | { 7 | int m; 8 | 9 | m = strlen (pattern) - 1; 10 | 11 | memset (lookup_table, ++m, 257); 12 | return m; 13 | } 14 | 15 | int main(argc, argv) 16 | int argc; 17 | char **argv; 18 | { 19 | if (build_lookup ("bind") != 4) 20 | abort (); 21 | else 22 | exit (0); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /test/tests/980526-3.c: -------------------------------------------------------------------------------- 1 | int compare(x, y) 2 | unsigned int x; 3 | unsigned int y; 4 | { 5 | if (x==y) 6 | return 0; 7 | else 8 | return 1; 9 | } 10 | 11 | main() 12 | { 13 | unsigned int i, j, k, l; 14 | i = 5; j = 2; k=0; l=2; 15 | if (compare(5%(~(unsigned) 2), i%~j) 16 | /*|| compare(0, k%~l)*/) 17 | abort(); 18 | else 19 | exit(0); 20 | } 21 | -------------------------------------------------------------------------------- /test/tests/980602-1.c: -------------------------------------------------------------------------------- 1 | main() 2 | { 3 | int i; 4 | for (i = 1; i < 100; i++) 5 | ; 6 | if (i == 100) 7 | exit (0); 8 | abort (); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /test/tests/980617-1.c: -------------------------------------------------------------------------------- 1 | void foo (unsigned int * p) 2 | { 3 | if (/*(signed char)*/(*p & 0xFF) == 17 || /*(signed char)*/(*p & 0xFF) == 18) 4 | return; 5 | else 6 | abort (); 7 | } 8 | 9 | int main () 10 | { 11 | int i = 0x30011; 12 | foo(&i); 13 | exit (0); 14 | } 15 | -------------------------------------------------------------------------------- /test/tests/980618-1.c: -------------------------------------------------------------------------------- 1 | void func(int, int); 2 | 3 | int main() 4 | { 5 | int x = 7; 6 | func(!x, !7); 7 | exit (0); 8 | } 9 | 10 | void func(int x, int y) 11 | { 12 | if (x == y) 13 | return; 14 | else 15 | abort (); 16 | } 17 | -------------------------------------------------------------------------------- /test/tests/980701-1.c: -------------------------------------------------------------------------------- 1 | ns_name_skip (unsigned char **x, unsigned char *y) 2 | { 3 | *x = 0; 4 | return 0; 5 | } 6 | 7 | unsigned char a[2]; 8 | 9 | int dn_skipname(unsigned char *ptr, unsigned char *eom) { 10 | unsigned char *saveptr; saveptr = ptr; 11 | 12 | if (ns_name_skip(&ptr, eom) == -1) 13 | return (-1); 14 | return (ptr - saveptr); 15 | } 16 | 17 | main() 18 | { 19 | if (dn_skipname (&a[0], &a[1]) == 0) 20 | abort (); 21 | exit (0); 22 | } 23 | -------------------------------------------------------------------------------- /test/tests/980929-1.c: -------------------------------------------------------------------------------- 1 | void f(int i) 2 | { 3 | if (i != 1000) 4 | abort (); 5 | } 6 | 7 | 8 | int main() 9 | { 10 | int n=1000; 11 | int i; 12 | 13 | f(n); 14 | for(i=0; i<1; ++i) { 15 | f(n); 16 | n=666; 17 | &n; 18 | } 19 | 20 | exit (0); 21 | } 22 | -------------------------------------------------------------------------------- /test/tests/981130-1.c: -------------------------------------------------------------------------------- 1 | struct s { int a; int b;}; 2 | struct s s1; 3 | struct s s2 = { 1, 2, }; 4 | 5 | void 6 | check (a, b) 7 | int a; 8 | int b; 9 | { 10 | if (a == b) 11 | exit (0); 12 | else 13 | abort (); 14 | } 15 | 16 | int 17 | main () 18 | { 19 | int * p; 20 | int x; 21 | 22 | s1.a = 9; 23 | p = & s1.a; 24 | s1 = s2; 25 | x = * p; 26 | 27 | check (x, 1); 28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /test/tests/981206-1.c: -------------------------------------------------------------------------------- 1 | /* Verify unaligned address aliasing on Alpha EV[45]. */ 2 | 3 | static unsigned short x, y; 4 | 5 | void foo() 6 | { 7 | x = 0x345; 8 | y = 0x567; 9 | } 10 | 11 | int main() 12 | { 13 | foo (); 14 | if (x != 0x345 || y != 0x567) 15 | abort (); 16 | exit (0); 17 | } 18 | -------------------------------------------------------------------------------- /test/tests/990106-1.c: -------------------------------------------------------------------------------- 1 | foo(bufp) 2 | char *bufp; 3 | { 4 | int x = 80; 5 | return (*bufp++ = x ? 'a' : 'b'); 6 | } 7 | 8 | main() 9 | { 10 | char x; 11 | 12 | if (foo (&x) != 'a') 13 | abort (); 14 | 15 | exit (0); 16 | } 17 | -------------------------------------------------------------------------------- /test/tests/990106-2.c: -------------------------------------------------------------------------------- 1 | unsigned calc_mp(unsigned mod) 2 | { 3 | unsigned a,b,c; 4 | c=-1; 5 | a=c/mod; 6 | b=0-a*mod; 7 | if (b > mod) { a += 1; b-=mod; } 8 | return b; 9 | } 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | unsigned x = 1234; 14 | unsigned y; y = calc_mp(x); 15 | 16 | if ((sizeof (y) == 4 && y != 680) 17 | || (sizeof (y) == 2 && y != 134)) 18 | exit (y); 19 | exit (0); 20 | } 21 | 22 | 23 | -------------------------------------------------------------------------------- /test/tests/990222-1.c: -------------------------------------------------------------------------------- 1 | char line[4];// = { '1', '9', '9', '\0' }; 2 | 3 | int main() 4 | { 5 | char *ptr;// = line + 3; 6 | line[0] = '1'; line[1] = '9'; line[2] = '9'; line[3] = '\0'; 7 | ptr = line + 3; 8 | 9 | while ((*--ptr += 1) > '9') *ptr = '0'; 10 | if (line[0] != '2' || line[1] != '0' || line[2] != '0') 11 | abort(); 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /test/tests/990527-1.c: -------------------------------------------------------------------------------- 1 | int sum; 2 | 3 | void 4 | g (int i) 5 | { 6 | sum += i; 7 | } 8 | 9 | void 10 | f(int j) 11 | { 12 | int i; 13 | 14 | for (i = 0; i < 9; i++) 15 | { 16 | j++; 17 | g (j); 18 | j = 9; 19 | } 20 | } 21 | 22 | int 23 | main () 24 | { 25 | f (0); 26 | if (sum != 81) 27 | abort (); 28 | exit (0); 29 | } 30 | 31 | -------------------------------------------------------------------------------- /test/tests/990604-1.c: -------------------------------------------------------------------------------- 1 | int b; 2 | void f () 3 | { 4 | int i = 0; 5 | if (b == 0) 6 | do { 7 | b = i; 8 | i++; 9 | } while (i < 10); 10 | } 11 | 12 | int main () 13 | { 14 | f (); 15 | if (b != 9) 16 | abort (); 17 | return 0; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /test/tests/990804-1.c: -------------------------------------------------------------------------------- 1 | int gfbyte ( void ) 2 | { 3 | return 0; 4 | } 5 | 6 | int main( void ) 7 | { 8 | int i,j,k ; 9 | 10 | i = gfbyte(); 11 | 12 | i = i + 1 ; 13 | 14 | if ( i == 0 ) 15 | k = -0 ; 16 | else 17 | k = i + 0 ; 18 | 19 | if (i != 1) 20 | abort (); 21 | 22 | k = 1 ; 23 | if ( k <= i) 24 | do 25 | j = gfbyte () ; 26 | while ( k++ < i ) ; 27 | 28 | exit (0); 29 | } 30 | 31 | -------------------------------------------------------------------------------- /test/tests/990827-1.c: -------------------------------------------------------------------------------- 1 | unsigned test(unsigned one , unsigned bit) 2 | { 3 | unsigned val, zero; 4 | /*unsigned*/ val= bit & 1; 5 | /*unsigned*/ zero= one >> 1; 6 | 7 | val++; 8 | return zero + ( val>> 1 ); 9 | } 10 | 11 | int main() 12 | { 13 | if (test (1,0) != 0) 14 | abort (); 15 | if (test (1,1) != 1) 16 | abort (); 17 | if (test (1,65535) != 1) 18 | abort (); 19 | exit (0); 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /test/tests/991023-1.c: -------------------------------------------------------------------------------- 1 | 2 | 3 | int blah; 4 | foo() 5 | { 6 | int i; 7 | 8 | for (i=0 ; i< 7 ; i++) 9 | { 10 | if (i == 7 - 1) 11 | blah = 0xfcc; 12 | else 13 | blah = 0xfee; 14 | } 15 | return blah; 16 | } 17 | 18 | 19 | main() 20 | { 21 | if (foo () != 0xfcc) 22 | abort (); 23 | exit (0); 24 | } 25 | -------------------------------------------------------------------------------- /test/tests/991202-1.c: -------------------------------------------------------------------------------- 1 | int x, y; 2 | 3 | int 4 | main() 5 | { 6 | x = 2; 7 | y = x; 8 | do 9 | { 10 | x = y; 11 | y = 2 * y; 12 | } 13 | while ( ! ((y - x) >= 20)); 14 | exit (0); 15 | } 16 | 17 | -------------------------------------------------------------------------------- /test/tests/991202-3.c: -------------------------------------------------------------------------------- 1 | 2 | unsigned int f (unsigned int a) 3 | { 4 | return a * 65536 / 8; 5 | } 6 | 7 | unsigned int g (unsigned int a) 8 | { 9 | return a * 65536; 10 | } 11 | 12 | unsigned int h (unsigned int a) 13 | { 14 | return a / 8; 15 | } 16 | 17 | int main () 18 | { 19 | if (f (65536) != h (g (65536))) 20 | abort (); 21 | exit (0); 22 | } 23 | -------------------------------------------------------------------------------- /test/tests/991216-4.c: -------------------------------------------------------------------------------- 1 | /* Test against a problem with loop reversal. */ 2 | static void bug(int size, int tries) 3 | { 4 | int i; 5 | int num = 0; 6 | while (num < size) 7 | { 8 | for (i = 1; i < tries; i++) num++; 9 | } 10 | } 11 | 12 | int main() 13 | { 14 | bug(5, 10); 15 | exit (0); 16 | } 17 | -------------------------------------------------------------------------------- /test/tests/991227-1.c: -------------------------------------------------------------------------------- 1 | char* doit(int flag) 2 | { 3 | return 1 + (flag ? "\0wrong\n" : "\0right\n"); 4 | } 5 | int main() 6 | { 7 | char *result; result = doit(0); 8 | if (*result == 'r' && result[1] == 'i') 9 | exit(0); 10 | abort(); 11 | } 12 | -------------------------------------------------------------------------------- /test/tests/align-1.c: -------------------------------------------------------------------------------- 1 | //typedef int new_int __attribute__ ((aligned(16))); 2 | struct S { int x; }; 3 | 4 | int main() 5 | { 6 | if (sizeof(struct S) != sizeof(int)) 7 | abort (); 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /test/tests/arith-1.c: -------------------------------------------------------------------------------- 1 | unsigned 2 | sat_add (unsigned i) 3 | { 4 | unsigned ret; ret = i + 1; 5 | if (ret < i) 6 | ret = i; 7 | return ret; 8 | } 9 | 10 | main () 11 | { 12 | if (sat_add (~0/*U*/) != ~0/*U*/) 13 | abort (); 14 | exit (0); 15 | } 16 | -------------------------------------------------------------------------------- /test/tests/conv-3.c: -------------------------------------------------------------------------------- 1 | /* PR middle-end/19100 */ 2 | /* { dg-do run } */ 3 | /* { dg-options "-O2" } */ 4 | 5 | void abort (void); 6 | 7 | int test (int v) 8 | { 9 | return ((signed char) (v ? 0x100 : 0)) ? 17 : 18; 10 | } 11 | 12 | int main() 13 | { 14 | if (test (2) != 18) 15 | abort (); 16 | return 0; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /test/tests/divcmp-5.c: -------------------------------------------------------------------------------- 1 | /* PR middle-end/26561 */ 2 | 3 | extern void abort(void); 4 | 5 | int always_one_1 (int a) 6 | { 7 | if (a/100 >= -9999) 8 | return 1; 9 | else 10 | return 0; 11 | } 12 | 13 | int always_one_2 (int a) 14 | { 15 | if (a/100 < -9999) 16 | return 0; 17 | else 18 | return 1; 19 | } 20 | 21 | int main(void) 22 | { 23 | if (always_one_1 (0) != 1) 24 | abort (); 25 | 26 | if (always_one_2 (0) != 1) 27 | abort (); 28 | 29 | return 0; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /test/tests/divconst-1.c: -------------------------------------------------------------------------------- 1 | /*typedef*/ struct t1 2 | { 3 | unsigned a, b, c, d; 4 | };// t1; 5 | 6 | f (struct t1 *ps) 7 | { 8 | ps->a = 10000; 9 | ps->b = ps->a / 3; 10 | ps->c = 10000; 11 | ps->d = ps->c / 3; 12 | } 13 | 14 | main () 15 | { 16 | struct t1 s; 17 | f (&s); 18 | if (s.a != 10000 || s.b != 3333 || s.c != 10000 || s.d != 3333) 19 | abort (); 20 | exit (0); 21 | } 22 | -------------------------------------------------------------------------------- /test/tests/ffs-1.c: -------------------------------------------------------------------------------- 1 | /*__volatile*/const int a = 0; 2 | 3 | extern void abort (void); 4 | extern void exit (int); 5 | 6 | int 7 | main (void) 8 | { 9 | if (__builtin_ffs (a) != 0) 10 | abort (); 11 | exit (0); 12 | } 13 | -------------------------------------------------------------------------------- /test/tests/huc-addb.c: -------------------------------------------------------------------------------- 1 | const char a[5] = {4, 3, 2, 1, 0}; 2 | signed char i; 3 | 4 | main() 5 | { 6 | char *x; 7 | x = a + 2; 8 | i = 0; 9 | if (x[i] != 2) 10 | exit(1); 11 | i = 1; 12 | if (x[i] != 1) 13 | exit(2); 14 | i = -1; 15 | if (x[i] != 3) 16 | exit(3); 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /test/tests/huc-addbi.c: -------------------------------------------------------------------------------- 1 | char a[5]; 2 | main() 3 | { 4 | char b = 2; 5 | a[2]++; 6 | return a[b] != 1; 7 | } 8 | -------------------------------------------------------------------------------- /test/tests/huc-addub.c: -------------------------------------------------------------------------------- 1 | const char a[5] = {4, 3, 2, 1, 0}; 2 | unsigned char i; 3 | 4 | main() 5 | { 6 | char *x; 7 | x = a + 2; 8 | i = 0; 9 | if (x[i] != 2) 10 | exit(1); 11 | i = 1; 12 | if (x[i] != 1) 13 | exit(2); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /test/tests/huc-addxs.c: -------------------------------------------------------------------------------- 1 | const char a[5] = {1, 2, 3, 4, 5}; 2 | 3 | main() 4 | { 5 | unsigned char u = 2; 6 | signed char s = -1; 7 | int i = 1; 8 | char *b; 9 | b = a + 2; 10 | if (b[u] != 5) 11 | exit(1); 12 | if (b[s] != 2) 13 | exit(2); 14 | if (b[i] != 4) 15 | exit(3); 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /test/tests/huc-asm.c: -------------------------------------------------------------------------------- 1 | char a, b, c; 2 | 3 | int main() 4 | { 5 | a = 5; b = 3; 6 | #asm 7 | lda _a 8 | clc 9 | adc _b 10 | sta _c 11 | #endasm 12 | if (c != 8) 13 | abort(); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /test/tests/huc-asr.c: -------------------------------------------------------------------------------- 1 | main() 2 | { 3 | int a = -256; 4 | if (a >> 8 != -1) 5 | abort(); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /test/tests/huc-blocklocal.c: -------------------------------------------------------------------------------- 1 | int foo(int a) 2 | { 3 | for (;;) { 4 | int b; 5 | b = a; 6 | return b; 7 | } 8 | } 9 | 10 | int main() 11 | { 12 | int x; 13 | x = 42; 14 | foo(23); 15 | if (x != 42) 16 | abort(); 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /test/tests/huc-byteconst.c: -------------------------------------------------------------------------------- 1 | int foo() 2 | { 3 | return 5000; 4 | } 5 | 6 | int main() 7 | { 8 | /* "+ 3" was incorrectly promoted to byte size */ 9 | if (1 + foo() + 3 != 5004) 10 | abort(); 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /test/tests/huc-constexpr.c: -------------------------------------------------------------------------------- 1 | main() 2 | { 3 | int a = 1 + 42; 4 | int b = 2*23; 5 | int c = 2 * 23 + 1; 6 | int d = 1 + 2 * 23; 7 | int e = -5; 8 | int f = -5+3; 9 | int g = 3+-5; 10 | int h = ~0; 11 | 12 | if (a != 43) exit(1); 13 | if (b != 46) exit(2); 14 | if (c != 47) exit(3); 15 | if (d != 47) exit(4); 16 | if (e != -5) exit(5); 17 | if (f != -2) exit(6); 18 | if (g != -2) exit(7); 19 | if (h != -1) exit(8); 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /test/tests/huc-enum1.c: -------------------------------------------------------------------------------- 1 | enum foo { 2 | NULL, 3 | EINS, 4 | ZWEI 5 | }; 6 | 7 | int main() 8 | { 9 | return EINS-1; 10 | } 11 | -------------------------------------------------------------------------------- /test/tests/huc-enum2.c: -------------------------------------------------------------------------------- 1 | typedef enum foo x; 2 | enum bar { 3 | VIER = 4, 4 | FUENF, 5 | SECHS 6 | }; 7 | enum foo { 8 | EINS = 1, 9 | ZWEI, 10 | DREI 11 | }; 12 | int main() 13 | { 14 | x a = ZWEI; 15 | return a - 2; 16 | } 17 | -------------------------------------------------------------------------------- /test/tests/huc-farptr.c: -------------------------------------------------------------------------------- 1 | #pragma fastcall foo(farptr __fbank:__fptr) 2 | 3 | #asm 4 | .data 5 | .bank 9 6 | _data: .ds 1 7 | .code 8 | 9 | _foo.1: 10 | lda __fbank 11 | cmp #9 12 | beq .next 13 | .abort: 14 | call _abort 15 | .next: 16 | lda __fptr 17 | cmp #low(_data) 18 | bne .abort 19 | lda __fptr+1 20 | cmp #high(_data) 21 | bne .abort 22 | rts 23 | #endasm 24 | extern int data[]; 25 | 26 | int main() 27 | { 28 | foo(data); 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /test/tests/huc-fastcallnested.c: -------------------------------------------------------------------------------- 1 | char *f() { 2 | return "f"; 3 | } 4 | char *g() { 5 | return "g"; 6 | } 7 | 8 | main() 9 | { 10 | if (!strcmp(f(), g())) 11 | abort(); 12 | if (strcmp(f(), f())) 13 | abort(); 14 | if (strcmp(f(), "f")) 15 | abort(); 16 | if (!strcmp(g(), "f")) 17 | abort(); 18 | if (strcmp("f", f())) 19 | abort(); 20 | if (!strcmp("g", f())) 21 | abort(); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /test/tests/huc-faststack.c: -------------------------------------------------------------------------------- 1 | #asm 2 | _foo.2: 3 | cla 4 | cpx #27 5 | bne .x 6 | clx 7 | .x: 8 | rts 9 | #endasm 10 | 11 | #pragma fastcall foo(word __ax, byte) 12 | 13 | main() 14 | { 15 | unsigned char i,j; 16 | int f; 17 | f = 9; 18 | i = 42; 19 | j = 23; 20 | return foo(0, 4+j); 21 | } 22 | -------------------------------------------------------------------------------- /test/tests/huc-ffs.c: -------------------------------------------------------------------------------- 1 | main() 2 | { 3 | int i; 4 | if (__builtin_ffs(0x8000) != 16) 5 | exit(1); 6 | if (__builtin_ffs(0xa5a5) != 1) 7 | exit(2); 8 | if (__builtin_ffs(0x5a5a) != 2) 9 | exit(3); 10 | if (__builtin_ffs(0x0ca0) != 6) 11 | exit(4); 12 | if (__builtin_ffs(0x0c80) != 8) 13 | exit(5); 14 | if (__builtin_ffs(0x0d00) != 9) 15 | exit(6); 16 | for (i = 0; i < 16; i++) { 17 | if (__builtin_ffs(1 << i) != i+1) 18 | abort(); 19 | } 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /test/tests/huc-fptr.c: -------------------------------------------------------------------------------- 1 | void foo(void) 2 | { 3 | } 4 | 5 | int bar; 6 | int main() 7 | { 8 | bar = 0; 9 | if (!foo) 10 | abort(); 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /test/tests/huc-fptr2.c: -------------------------------------------------------------------------------- 1 | extern void foo(void); 2 | void bar(void); 3 | 4 | int main() 5 | { 6 | if (foo) 7 | return 0; 8 | if (bar) 9 | return 0; 10 | abort(); 11 | } 12 | 13 | void foo(void) 14 | { 15 | } 16 | 17 | #asm 18 | .proc _bar 19 | .endp 20 | #endasm 21 | -------------------------------------------------------------------------------- /test/tests/huc-glbptrptr.c: -------------------------------------------------------------------------------- 1 | char **p; 2 | const char *a = "Huhu"; 3 | const char *b = "Hallo"; 4 | char *ptr[2]; 5 | 6 | int main() 7 | { 8 | ptr[0] = a; 9 | ptr[1] = b; 10 | if (strcmp(ptr[1], "Hallo")) 11 | abort(); 12 | if (strcmp(ptr[0], "Huhu")) 13 | abort(); 14 | p = &ptr[0]; 15 | if (strcmp(*p, "Huhu")) 16 | abort(); 17 | p++; 18 | if (strcmp(*p, "Hallo")) 19 | abort(); 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /test/tests/huc-goto1.c: -------------------------------------------------------------------------------- 1 | int main() 2 | { 3 | goto foo; 4 | abort(); 5 | foo: 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /test/tests/huc-gt.c: -------------------------------------------------------------------------------- 1 | main() 2 | { 3 | unsigned char a = 0; 4 | if (a > 0) 5 | abort(); 6 | exit(0); 7 | } 8 | -------------------------------------------------------------------------------- /test/tests/huc-idx1.c: -------------------------------------------------------------------------------- 1 | unsigned char **foo; 2 | const unsigned char *bar[2] = { "ABC", "DEF" }; 3 | 4 | int main() 5 | { 6 | foo = bar; 7 | if (foo[1][1] != 'E') 8 | abort(); 9 | return 0; 10 | } 11 | 12 | -------------------------------------------------------------------------------- /test/tests/huc-idx2.c: -------------------------------------------------------------------------------- 1 | const char *foo[2] = { "ABC", "DEF" }; 2 | 3 | int main() 4 | { 5 | if (foo[1][1] != 'E') 6 | abort(); 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /test/tests/huc-init1.c: -------------------------------------------------------------------------------- 1 | int a = 10; 2 | int b = 11; 3 | int c = 12; 4 | 5 | int main() 6 | { 7 | if (b != 11) 8 | abort(); 9 | if (a != 10) 10 | abort(); 11 | if (c != 12) 12 | abort(); 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /test/tests/huc-init2.c: -------------------------------------------------------------------------------- 1 | int a = 3; 2 | int b[3] = {4, 5, 6}; 3 | int c = 7; 4 | 5 | int main() 6 | { 7 | if (b[0] != 4 || b[1] != 5 || b[2] != 6) 8 | abort(); 9 | return a != 3 || c != 7; 10 | } 11 | -------------------------------------------------------------------------------- /test/tests/huc-init3.c: -------------------------------------------------------------------------------- 1 | const int b = 4; 2 | const int *a = &b; 3 | const int d = b+1; 4 | const int e = 1+b; 5 | 6 | int main() 7 | { 8 | if (d != 5) 9 | exit(1); 10 | if (*a != 4) 11 | exit(2); 12 | if (e != 5) 13 | exit(3); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /test/tests/huc-init4.c: -------------------------------------------------------------------------------- 1 | int x = 10; 2 | struct foo { 3 | int a; 4 | int b; 5 | } bar = {4, 5}; 6 | int y = 12; 7 | 8 | int main() 9 | { 10 | if (bar.b != 5) 11 | exit(1); 12 | if (bar.a != 4) 13 | exit(2); 14 | if (y-x != 2) 15 | exit(3); 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /test/tests/huc-init5.c: -------------------------------------------------------------------------------- 1 | struct foo { 2 | unsigned char a; 3 | unsigned char b; 4 | }; 5 | struct foo a = {1, 2}; 6 | int b = 1000; 7 | 8 | int main() 9 | { 10 | if (a.b != 2) 11 | exit(1); 12 | if (a.a != 1) 13 | exit(2); 14 | if (b != 1000) 15 | exit(3); 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /test/tests/huc-init6.c: -------------------------------------------------------------------------------- 1 | struct foo { 2 | int a; 3 | int b; 4 | }; 5 | struct foo bar[2] = {{1, 2}, {3,4}}; 6 | 7 | int main() 8 | { 9 | if (bar[1].a != 3) 10 | exit(1); 11 | if (bar[0].b != 2) 12 | exit(2); 13 | if (bar[1].b != 4) 14 | exit(3); 15 | if (bar[0].a != 1) 16 | exit(4); 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /test/tests/huc-init7.c: -------------------------------------------------------------------------------- 1 | struct foo { 2 | int a; 3 | int b; 4 | }; 5 | 6 | int main() 7 | { 8 | static struct foo a = {1, 2}; 9 | if (a.b != 2 || a.a != 1) 10 | abort(); 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /test/tests/huc-init9.c: -------------------------------------------------------------------------------- 1 | int a[3] = {1,1,1}; 2 | int b[3] = {2}; 3 | int c[3] = {3,3,3}; 4 | 5 | int main() 6 | { 7 | if (a[0] != 1 || a[1] != 1 || a[2] != 1) 8 | exit(1); 9 | if (c[0] != 3 || c[1] != 3 || c[2] != 3) 10 | exit(2); 11 | if (b[0] != 2 || b[1] || b[2]) 12 | exit(3); 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /test/tests/huc-ldby.c: -------------------------------------------------------------------------------- 1 | const char a[5] = {4, 3, 2, 1, 0}; 2 | unsigned char i; 3 | 4 | main() 5 | { 6 | i = 2; 7 | return a[i] - 2; 8 | } 9 | -------------------------------------------------------------------------------- /test/tests/huc-load_map-huc.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/test/tests/huc-load_map-huc.bmp -------------------------------------------------------------------------------- /test/tests/huc-load_map-hucc.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/test/tests/huc-load_map-hucc.bmp -------------------------------------------------------------------------------- /test/tests/huc-lstatic1.c: -------------------------------------------------------------------------------- 1 | int main() 2 | { 3 | static int a = 5; 4 | return a + 1 != 6; 5 | } 6 | -------------------------------------------------------------------------------- /test/tests/huc-lstatic2.c: -------------------------------------------------------------------------------- 1 | int main() 2 | { 3 | static int a; 4 | return a != 0; 5 | } 6 | -------------------------------------------------------------------------------- /test/tests/huc-macro.c: -------------------------------------------------------------------------------- 1 | #define NADA return 2 | #undef NADA 3 | #define BAZ return 4 | 5 | #define BLA(x, y) if (y) 6 | #define FOO(x, y) int x = y 7 | #define BAR(x) (x+x+x) 8 | 9 | int main() 10 | { 11 | FOO(a, 1); 12 | if (1 != a) 13 | exit(1); 14 | a += BAR(4); 15 | if (a != 13) 16 | exit(2); 17 | BLA(5, 0) 18 | exit(3); 19 | BAZ 0; 20 | } 21 | -------------------------------------------------------------------------------- /test/tests/huc-mod.c: -------------------------------------------------------------------------------- 1 | main() 2 | { 3 | if (1 % 3 != 1) 4 | exit(1); 5 | if (3 % 1 != 0) 6 | exit(2); 7 | if (5 % 3 != 2) 8 | exit(3); 9 | if (3 % 3 != 0) 10 | exit(4); 11 | if (-5 % 5 != 0) 12 | exit(5); 13 | if (-5 % 2 != -1) 14 | exit(6); 15 | if (5 % -2 != 1) 16 | exit(7); 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /test/tests/huc-namespace.c: -------------------------------------------------------------------------------- 1 | int a,b; 2 | 3 | struct foo { 4 | int a; 5 | int b; 6 | }; 7 | 8 | int main() 9 | { 10 | struct foo x; 11 | x.a = 5; 12 | x.b = 4; 13 | a = 3; 14 | b = 2; 15 | if (x.a != 5) 16 | abort(); 17 | if (a != 3) 18 | abort(); 19 | if (b != 2) 20 | abort(); 21 | if (x.b != 4) 22 | abort(); 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /test/tests/huc-neq.c: -------------------------------------------------------------------------------- 1 | main() 2 | { 3 | if ((32767 == -32768) != 0) 4 | abort(); 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /test/tests/huc-nestedstruct.c: -------------------------------------------------------------------------------- 1 | struct a { 2 | int a, b; 3 | }; 4 | struct b { 5 | int c; 6 | struct a d; 7 | }; 8 | 9 | main() 10 | { 11 | struct b x; 12 | x.c = 1; 13 | x.d.a = 2; 14 | x.d.b = 3; 15 | if (x.c != 1) 16 | abort(); 17 | x.c = 4; 18 | if (x.d.a != 2) 19 | abort(); 20 | if (x.d.b != 3) 21 | abort(); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /test/tests/huc-nestedstruct2.c: -------------------------------------------------------------------------------- 1 | struct foo { 2 | int a; 3 | }; 4 | struct bar { 5 | struct foo b; 6 | }; 7 | struct baz { 8 | struct bar c; 9 | }; 10 | int main() 11 | { 12 | struct baz x; 13 | x.c.b.a = 0; 14 | return x.c.b.a; 15 | } 16 | -------------------------------------------------------------------------------- /test/tests/huc-octal.c: -------------------------------------------------------------------------------- 1 | f() 2 | { 3 | return ("\177"[0]); 4 | } 5 | 6 | main() 7 | { 8 | if (f() != (0177)) 9 | abort(); 10 | exit (0); 11 | } 12 | -------------------------------------------------------------------------------- /test/tests/huc-preprocont.c: -------------------------------------------------------------------------------- 1 | #define A return \ 2 | 0; 3 | int main() 4 | { 5 | A 6 | } 7 | -------------------------------------------------------------------------------- /test/tests/huc-prepronest.c: -------------------------------------------------------------------------------- 1 | #define A(a, b) (a) + (b) 2 | #define B(a, b) (a) * (b) 3 | 4 | int main() 5 | { 6 | if (A(1, B(2, 3)) != 7) 7 | abort(); 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /test/tests/huc-ptrptr1.c: -------------------------------------------------------------------------------- 1 | const int a[5] = {1, 2, 3, 4, 5}; 2 | int *ap[3]; 3 | 4 | main() 5 | { 6 | int *b, *c; 7 | int **d; 8 | b = a; 9 | c = &a[3]; 10 | d = &b; 11 | if (*d != a) 12 | abort(); 13 | if (**d != 1) 14 | abort(); 15 | (*d)++; 16 | if (**d != 2) 17 | abort(); 18 | ap[0] = a; 19 | ap[1] = b; 20 | ap[2] = 0; 21 | d = &ap[0]; 22 | if (*d != a) 23 | abort(); 24 | d++; 25 | if (*d++ != b) 26 | abort(); 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /test/tests/huc-put_stuff-huc.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/test/tests/huc-put_stuff-huc.bmp -------------------------------------------------------------------------------- /test/tests/huc-put_stuff-hucc.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/test/tests/huc-put_stuff-hucc.bmp -------------------------------------------------------------------------------- /test/tests/huc-retptr.c: -------------------------------------------------------------------------------- 1 | struct s { 2 | int a; 3 | int b; 4 | }; 5 | 6 | struct s arr[2]; 7 | 8 | struct s *foo(void) 9 | { 10 | return &arr[0]; 11 | } 12 | 13 | int main() 14 | { 15 | struct s* sp; 16 | sp = foo() + 1; 17 | if (sp != &arr[1]) 18 | abort(); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /test/tests/huc-sizeofparen.c: -------------------------------------------------------------------------------- 1 | main() 2 | { 3 | if (sizeof(int) != sizeof int) 4 | abort(); 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /test/tests/huc-sizeofstruct.c: -------------------------------------------------------------------------------- 1 | struct X { 2 | int a; 3 | int b[3]; 4 | char c; 5 | }; 6 | 7 | main() 8 | { 9 | if (sizeof(struct X) != sizeof(int) * 4 + sizeof(char)) 10 | abort(); 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /test/tests/huc-stbi.c: -------------------------------------------------------------------------------- 1 | int main() 2 | { 3 | unsigned char a,b; 4 | a = 1; 5 | b = 1; 6 | a = b = 0; 7 | if (a || b) 8 | abort(); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /test/tests/huc-stws.c: -------------------------------------------------------------------------------- 1 | const char a[10] = {60, 61, 62, 63, 64, 65, 66, 67, 68, 69}; 2 | 3 | main() 4 | { 5 | int u,v,w; 6 | char x,y,z; 7 | u = 1; 8 | v = 5; 9 | w = a[u+v]; 10 | if (a[u+1] != 62) 11 | exit(1); 12 | if (a[v] != 65) 13 | exit(2); 14 | if (w != 66) 15 | exit(3); 16 | x = 2; 17 | y = 3; 18 | z = a[x+y]; 19 | if (a[x+1] != 63) 20 | exit(4); 21 | if (a[y] != 63) 22 | exit(5); 23 | if (z != 65) 24 | exit(6); 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /test/tests/huc-typedef.c: -------------------------------------------------------------------------------- 1 | typedef int foo_t; 2 | 3 | int main() 4 | { 5 | foo_t x = 0; 6 | if (sizeof(x) != 2) 7 | abort(); 8 | return x; 9 | } 10 | -------------------------------------------------------------------------------- /test/tests/huc-varptrarr.c: -------------------------------------------------------------------------------- 1 | int a, b, c, d; 2 | 3 | int *p[4]; 4 | 5 | main() 6 | { 7 | p[0] = &a; p[1] = &b; p[2] = &c; p[3] = &d; 8 | a = 1; b = 2; c = 3; d = 4; 9 | if (*p[0] != 1 || *p[1] != 2 || *p[2] != 3 || *p[3] != 4) 10 | abort(); 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /test/tests/huc-vram.c: -------------------------------------------------------------------------------- 1 | const char foo[] = {1, 2, 3, 4, 5, 6}; 2 | int main() 3 | { 4 | load_vram(0, foo, 3); 5 | #ifdef __HUCC__ 6 | put_vram(2, 6); 7 | if (get_vram(0) != 0x0201 || get_vram(1) != 0x0403) 8 | abort(); 9 | if (get_vram(2) != 6) 10 | abort(); 11 | #else 12 | vram[3] = 6; 13 | if (vram[0] != 0x0201 || vram[1] != 0x0403) 14 | abort(); 15 | if (vram[3] != 6) 16 | abort(); 17 | #endif 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /test/tests/huc-zerostruct.c: -------------------------------------------------------------------------------- 1 | struct null { 2 | }; 3 | 4 | main() 5 | { 6 | if(sizeof(struct null) != 0) 7 | abort(); 8 | return 0; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /test/tests/inst-check.c: -------------------------------------------------------------------------------- 1 | //#include 2 | 3 | f(int m) 4 | { 5 | int i,s=0; 6 | for(i=0;i= 0; i--) 12 | { 13 | if (k[i] != i) 14 | abort (); 15 | } 16 | 17 | exit (0); 18 | } 19 | -------------------------------------------------------------------------------- /test/tests/loop-11.c: -------------------------------------------------------------------------------- 1 | static int a[199]; 2 | 3 | static void 4 | foo () 5 | { 6 | int i; 7 | for (i = 198; i >= 0; i--) 8 | a[i] = i; 9 | } 10 | 11 | int 12 | main () 13 | { 14 | int i; 15 | foo (); 16 | for (i = 0; i < 199; i++) 17 | if (a[i] != i) 18 | abort (); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /test/tests/loop-14.c: -------------------------------------------------------------------------------- 1 | int a3[3]; 2 | 3 | void f(int *a) 4 | { 5 | int i; 6 | 7 | for (i=3; --i;) 8 | a[i] = 42 / i; 9 | } 10 | 11 | int 12 | main () 13 | { 14 | f(a3); 15 | 16 | if (a3[1] != 42 || a3[2] != 21) 17 | abort (); 18 | 19 | exit (0); 20 | } 21 | -------------------------------------------------------------------------------- /test/tests/loop-2.c: -------------------------------------------------------------------------------- 1 | int a[2]; 2 | 3 | f (int b) 4 | { 5 | unsigned int i; 6 | for (i = 0; i < b; i++) 7 | a[i] = i - 2; 8 | } 9 | 10 | main () 11 | { 12 | a[0] = a[1] = 0; 13 | f (2); 14 | if (a[0] != -2 || a[1] != -1) 15 | abort (); 16 | exit (0); 17 | } 18 | -------------------------------------------------------------------------------- /test/tests/loop-2b.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int a[2]; 4 | 5 | f (int i) 6 | { 7 | for (; i < INT_MAX; i++) 8 | { 9 | a[i] = -2; 10 | if (&a[i] == &a[1]) 11 | break; 12 | } 13 | } 14 | 15 | main () 16 | { 17 | a[0] = a[1] = 0; 18 | f (0); 19 | if (a[0] != -2 || a[1] != -2) 20 | abort (); 21 | exit (0); 22 | } 23 | -------------------------------------------------------------------------------- /test/tests/loop-2c.c: -------------------------------------------------------------------------------- 1 | int a[2]; 2 | 3 | /*__inline__*/ f (int b, int o) 4 | { 5 | unsigned int i; 6 | int *p; 7 | for (p = &a[b], i = b; --i < ~0; ) 8 | *--p = i * 3 + o; 9 | } 10 | 11 | g(int b) 12 | { 13 | f (b, (int)a); 14 | } 15 | 16 | main () 17 | { 18 | a[0] = a[1] = 0; 19 | g (2); 20 | if (a[0] != (int)a || a[1] != (int)a + 3) 21 | abort (); 22 | exit (0); 23 | } 24 | -------------------------------------------------------------------------------- /test/tests/loop-2d.c: -------------------------------------------------------------------------------- 1 | int a[2]; 2 | 3 | f (int b) 4 | { 5 | unsigned int i; 6 | int *p; 7 | for (p = &a[b], i = b; --i < ~0; ) 8 | *--p = i * 3 + (int)a; 9 | } 10 | 11 | main () 12 | { 13 | a[0] = a[1] = 0; 14 | f (2); 15 | if (a[0] != (int)a || a[1] != (int)a + 3) 16 | abort(); 17 | exit (0); 18 | } 19 | -------------------------------------------------------------------------------- /test/tests/loop-3.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int n;// = 0; 4 | 5 | g (int i) 6 | { 7 | n++; 8 | } 9 | 10 | f (int m) 11 | { 12 | int i; 13 | i = m; 14 | do 15 | { 16 | g (i * INT_MAX / 2); 17 | } 18 | while (--i > 0); 19 | } 20 | 21 | main () 22 | { 23 | f (4); 24 | if (n != 4) 25 | abort (); 26 | exit (0); 27 | } 28 | -------------------------------------------------------------------------------- /test/tests/loop-3b.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int n;// = 0; 4 | 5 | g (int i) 6 | { 7 | n++; 8 | } 9 | 10 | f (int m) 11 | { 12 | int i; 13 | i = m; 14 | do 15 | { 16 | g (i * 4); 17 | i -= INT_MAX / 8; 18 | } 19 | while (i > 0); 20 | } 21 | 22 | main () 23 | { 24 | f (INT_MAX/8*4); 25 | if (n != 4) 26 | abort (); 27 | exit (0); 28 | } 29 | -------------------------------------------------------------------------------- /test/tests/loop-6.c: -------------------------------------------------------------------------------- 1 | main() 2 | { 3 | char c; 4 | char d; 5 | int nbits; 6 | c = -1; 7 | for (nbits = 1 ; nbits < 100; nbits++) { 8 | d = (1 << nbits) - 1; 9 | if (d == c) 10 | break; 11 | } 12 | if (nbits == 100) 13 | abort(); 14 | exit(0); 15 | } 16 | -------------------------------------------------------------------------------- /test/tests/loop-7.c: -------------------------------------------------------------------------------- 1 | void foo (unsigned int n) 2 | { 3 | int i, j = -1; 4 | 5 | for (i = 0; i < 10 && j < 0; i++) 6 | { 7 | if ((1/*UL*/ << i) == n) 8 | j = i; 9 | } 10 | 11 | if (j < 0) 12 | abort (); 13 | } 14 | 15 | main() 16 | { 17 | foo (64); 18 | exit (0); 19 | } 20 | -------------------------------------------------------------------------------- /test/tests/loop-9.c: -------------------------------------------------------------------------------- 1 | /* Source: Neil Booth, from PR # 115. */ 2 | 3 | int false() 4 | { 5 | return 0; 6 | } 7 | 8 | extern void abort (void); 9 | 10 | int main (int argc,char *argv[]) 11 | { 12 | int count = 0; 13 | 14 | while (false() || count < -123) 15 | ++count; 16 | 17 | if (count) 18 | abort (); 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /test/tests/mayalias-1.c: -------------------------------------------------------------------------------- 1 | /* Tests that the may_alias attribute works as expected. 2 | Author: Osku Salerma Apr 2002. */ 3 | 4 | extern void abort(void); 5 | extern void exit(int); 6 | 7 | //typedef char __attribute__((__may_alias__)) short_a; 8 | #define short_a char 9 | 10 | int 11 | main (void) 12 | { 13 | int a = 0x1234; 14 | short_a *b; b = /*(short_a*)*/ &a; 15 | 16 | b[1] = 0; 17 | 18 | if (a == 0x1234) 19 | abort(); 20 | 21 | exit(0); 22 | } 23 | -------------------------------------------------------------------------------- /test/tests/mayalias-2.c: -------------------------------------------------------------------------------- 1 | struct S { short x; }; 2 | //typedef struct S __attribute__((__may_alias__)) test; 3 | #define test struct S 4 | 5 | int f() { 6 | int a=10; 7 | test *p; p =/*(test *)*/&a; 8 | p->x = 1; 9 | return a; 10 | } 11 | 12 | int main() { 13 | if (f() == 10) 14 | /*__builtin_*/abort(); 15 | return 0; 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /test/tests/mayalias-3.c: -------------------------------------------------------------------------------- 1 | struct S { short x; }; 2 | //typedef struct S __attribute__((__may_alias__)) test; 3 | #define test struct S 4 | 5 | test *p; 6 | 7 | int g(int *a) 8 | { 9 | p = /*(test*)*/a; 10 | } 11 | 12 | int f() 13 | { 14 | int a; 15 | test s; 16 | g(&a); 17 | a = 10; 18 | //test s={1}; 19 | s.x = 1; 20 | *p=s; 21 | return a; 22 | } 23 | 24 | int main() { 25 | if (f() == 10) 26 | /*__builtin_*/abort(); 27 | return 0; 28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /test/tests/medce-1.c: -------------------------------------------------------------------------------- 1 | 2 | extern void abort (void); 3 | extern void link_error (void); 4 | 5 | static int ok;// = 0; 6 | 7 | void bar (void) 8 | { 9 | ok = 1; 10 | } 11 | 12 | void foo(int x) 13 | { 14 | switch (x) 15 | { 16 | case 0: 17 | if (0) 18 | { 19 | //link_error(); 20 | case 1: 21 | bar(); 22 | } 23 | } 24 | } 25 | 26 | int main() 27 | { 28 | foo (1); 29 | if (!ok) 30 | abort (); 31 | return 0; 32 | } 33 | 34 | -------------------------------------------------------------------------------- /test/tests/mod-1.c: -------------------------------------------------------------------------------- 1 | f (int x, int y) 2 | { 3 | if (x % y != 0) 4 | abort(); 5 | } 6 | 7 | main () 8 | { 9 | f (-5, 5); 10 | exit (0); 11 | } 12 | -------------------------------------------------------------------------------- /test/tests/packed-1.c: -------------------------------------------------------------------------------- 1 | const short x1 = 17; 2 | 3 | struct tt 4 | { 5 | short i;// __attribute__ ((packed)); 6 | }; struct tt t; 7 | 8 | f () 9 | { 10 | t.i = x1; 11 | if (t.i != 17) 12 | abort (); 13 | } 14 | 15 | main () 16 | { 17 | f (); 18 | exit (0); 19 | } 20 | -------------------------------------------------------------------------------- /test/tests/pr17078-1.c: -------------------------------------------------------------------------------- 1 | extern void abort(void); 2 | 3 | void test(int *ptr) 4 | { 5 | int i = 1; 6 | goto useless; 7 | if (0) 8 | { 9 | useless: 10 | i = 0; 11 | } 12 | else 13 | i = 1; 14 | *ptr = i; 15 | } 16 | 17 | int main() 18 | { 19 | int i = 1; 20 | test(&i); 21 | if (i) 22 | abort (); 23 | return 0; 24 | } 25 | 26 | -------------------------------------------------------------------------------- /test/tests/pr17133.c: -------------------------------------------------------------------------------- 1 | extern void abort (void); 2 | 3 | int foo;// = 0; 4 | void *bar;// = 0; 5 | unsigned int baz;// = 100; 6 | 7 | void *pure_alloc () 8 | { 9 | void *res; 10 | 11 | while (1) 12 | { 13 | res = /*(void *)*/ (((/*(unsigned int)*/ (foo + bar))) & ~1); 14 | foo += 2; 15 | if (foo < baz) 16 | return res; 17 | foo = 0; 18 | } 19 | } 20 | 21 | int main () 22 | { 23 | baz = 100; 24 | pure_alloc (); 25 | if (!foo) 26 | abort (); 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /test/tests/pr21173.c: -------------------------------------------------------------------------------- 1 | void abort (void); 2 | 3 | char q; 4 | void *a[2]; 5 | 6 | void foo (char *p) 7 | { 8 | int i; 9 | for (i = 0; i < 2; i++) 10 | a[i] += p - &q; 11 | } 12 | 13 | int main (void) 14 | { 15 | int i; 16 | foo (&q); 17 | for (i = 0; i < 2; i ++) 18 | if (a[i]) 19 | abort (); 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /test/tests/pr21964-1.c: -------------------------------------------------------------------------------- 1 | void 2 | foo (int n, int m) 3 | { 4 | if (m == 0) 5 | exit (0); 6 | else if (n != 0) 7 | abort (); 8 | else 9 | foo (n++, m - 1); 10 | } 11 | 12 | int 13 | main (void) 14 | { 15 | foo (0, 4); 16 | } 17 | -------------------------------------------------------------------------------- /test/tests/pr22348.c: -------------------------------------------------------------------------------- 1 | void abort (void); 2 | void f(int i) 3 | { 4 | if (i>4 + 3 * 16) 5 | abort(); 6 | } 7 | 8 | int main() 9 | { 10 | unsigned int buflen, i; 11 | buflen = 4 + 3 * 16; 12 | for (i = 4; i < buflen; i+= 3) 13 | f(i); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /test/tests/pr22429.c: -------------------------------------------------------------------------------- 1 | extern void abort (void); 2 | 3 | #define N (1 << (sizeof(int) * /*__CHAR_BIT__*/8 - 2)) 4 | 5 | int f(int n) 6 | { 7 | if (-N <= n && n <= N-1) 8 | return 1; 9 | return 0; 10 | } 11 | 12 | int main () 13 | { 14 | if (f (N)) 15 | abort (); 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /test/tests/pr22493-1.c: -------------------------------------------------------------------------------- 1 | #include 2 | extern void abort (); 3 | extern void exit (int); 4 | void f(int i) 5 | { 6 | if (i>0) 7 | abort(); 8 | i = -i; 9 | if (i<0) 10 | return; 11 | abort (); 12 | } 13 | 14 | int main(int argc, char *argv[]) 15 | { 16 | f(INT_MIN); 17 | exit (0); 18 | } 19 | -------------------------------------------------------------------------------- /test/tests/pr22630.c: -------------------------------------------------------------------------------- 1 | void abort (void); 2 | 3 | int j; 4 | 5 | void bla (int *r) 6 | { 7 | int *p, *q; 8 | 9 | p = q = r; 10 | if (!p) 11 | p = &j; 12 | 13 | if (p != q) 14 | j = 1; 15 | } 16 | 17 | int main (void) 18 | { 19 | bla (0); 20 | if (!j) 21 | abort (); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /test/tests/pr23047.c: -------------------------------------------------------------------------------- 1 | #include 2 | extern void abort (); 3 | extern void exit (int); 4 | void f(int i) 5 | { 6 | i = i > 0 ? i : -i; 7 | if (i<0) 8 | return; 9 | abort (); 10 | } 11 | 12 | int main(int argc, char *argv[]) 13 | { 14 | f(INT_MIN); 15 | exit (0); 16 | } 17 | -------------------------------------------------------------------------------- /test/tests/pr23518.c: -------------------------------------------------------------------------------- 1 | /* PR tree-optimization/23518. 2 | make_range used to transform a + 1 < 0 into a < -1 even when a is 3 | signed and -fwrapv is given. Make sure that no longer happens. */ 4 | 5 | /* { dg-do run } */ 6 | /* { dg-options "-O2 -fwrapv" } */ 7 | 8 | #include 9 | 10 | extern void abort (void); 11 | extern void exit (int); 12 | 13 | int 14 | main (void) 15 | { 16 | int a = INT_MAX; 17 | if ((a < 0) || (a + 1 < 0)) 18 | exit (0); 19 | 20 | abort (); 21 | } 22 | -------------------------------------------------------------------------------- /test/tests/pr23604.c: -------------------------------------------------------------------------------- 1 | extern void abort (void); 2 | 3 | int g(int i, int j) 4 | { 5 | if (i>-1) 6 | if (i<2) 7 | { 8 | if (i != j) 9 | { 10 | if (j != 0) 11 | return 0; 12 | } 13 | } 14 | return 1; 15 | } 16 | 17 | int main(void) 18 | { 19 | if (!g(1, 0)) 20 | abort (); 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /test/tests/pr24142.c: -------------------------------------------------------------------------------- 1 | void abort (void); 2 | 3 | int f (int a, int b) 4 | { 5 | if (a == 1) 6 | a = 0; 7 | if (b == 0) 8 | a = 1; 9 | if (a != 0) 10 | return 0; 11 | return 1; 12 | } 13 | 14 | int main (void) 15 | { 16 | if (f (1, 1) != 1) 17 | abort (); 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /test/tests/pr24851.c: -------------------------------------------------------------------------------- 1 | /* We used to handle pointer addition wrongly 2 | at the time of recombining to an ARRAY_REF 3 | in the case of 4 | p + -4B 5 | where -4B is represented as unsigned. */ 6 | 7 | void abort(void); 8 | int main() 9 | { 10 | int a[10], *p, *q; 11 | q = &a[1]; 12 | p = &q[-1]; 13 | if (p >= &a[9]) 14 | abort (); 15 | return 0; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /test/tests/pr27364.c: -------------------------------------------------------------------------------- 1 | int f(unsigned number_of_digits_to_use) 2 | { 3 | if (number_of_digits_to_use >1294) 4 | return 0; 5 | return (number_of_digits_to_use * 3321 / 1000 + 1) /16; 6 | } 7 | 8 | int main(void) 9 | { 10 | if (f(11) != 2) 11 | /*__builtin_*/abort (); 12 | exit (0); 13 | } 14 | -------------------------------------------------------------------------------- /test/tests/pr27671-1.c: -------------------------------------------------------------------------------- 1 | /* PR rtl-optimization/27671. 2 | The combiner used to simplify "a ^ b == a" to "a" via 3 | simplify_relational_operation_1 in simplify-rtx.c. */ 4 | 5 | //extern void abort (void) __attribute__ ((noreturn)); 6 | //extern void exit (int) __attribute__ ((noreturn)); 7 | 8 | static int //__attribute__((noinline)) 9 | foo (int a, int b) 10 | { 11 | int c; c = a ^ b; 12 | if (c == a) 13 | abort (); 14 | } 15 | 16 | int 17 | main (void) 18 | { 19 | foo (0, 1); 20 | exit (0); 21 | } 22 | -------------------------------------------------------------------------------- /test/tests/pr28651.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern void abort (void); 4 | int //__attribute__((noinline)) 5 | foo (unsigned int u) 6 | { 7 | return (int)(u + 4) < (int)u; 8 | } 9 | 10 | int 11 | main (int argc, char *argv[]) 12 | { 13 | unsigned int u = INT_MAX; 14 | 15 | if (foo (u) == 0) 16 | abort(); 17 | return 0; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /test/tests/pr29797-1.c: -------------------------------------------------------------------------------- 1 | extern void abort(void); 2 | 3 | unsigned int bar(void) { return 32768; } 4 | 5 | int main() 6 | { 7 | unsigned int nStyle; nStyle = bar (); 8 | if (nStyle & 32768) 9 | nStyle |= 65536; 10 | if (nStyle != (32768 | 65536)) 11 | abort (); 12 | return 0; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /test/tests/pr31605.c: -------------------------------------------------------------------------------- 1 | void put_field (unsigned int start, unsigned int len) 2 | { 3 | int cur_bitshift; cur_bitshift = ((start + len) % 8) - 8; 4 | if (cur_bitshift > -8) 5 | exit (0); 6 | } 7 | 8 | int 9 | main () 10 | { 11 | put_field (0, 1); 12 | abort (); 13 | } 14 | -------------------------------------------------------------------------------- /test/tests/pr7284-1.c: -------------------------------------------------------------------------------- 1 | /* Signed left-shift is implementation-defined in C89 (and see 2 | DR#081), not undefined. Bug 7284 from Al Grant (AlGrant at 3 | myrealbox.com). */ 4 | 5 | /* { dg-options "-std=c89" } */ 6 | 7 | extern void abort (void); 8 | extern void exit (int); 9 | 10 | int 11 | f (int n) 12 | { 13 | return (n << 8) / (1 << 7); 14 | } 15 | 16 | volatile int x;// = 128; 17 | 18 | int 19 | main (void) 20 | { 21 | x = 128; 22 | if (f(x) != -256) 23 | abort (); 24 | exit (0); 25 | } 26 | -------------------------------------------------------------------------------- /test/tests/pragma-pack-3.c: -------------------------------------------------------------------------------- 1 | /* PR c++/25294 */ 2 | /* { dg-options "-std=gnu99" } */ 3 | /* { dg-do run } */ 4 | 5 | extern void abort (void); 6 | 7 | struct S 8 | { 9 | char a[3]; 10 | /*#pragma pack(1) /* A block comment 11 | that ends on the next line. */ 12 | struct T 13 | { 14 | char b; 15 | int c; 16 | } d; 17 | //#pragma pack /*/ */ () // C++ comment 18 | int e; 19 | } s; 20 | 21 | int 22 | main () 23 | { 24 | if (sizeof (int) == 2 && sizeof (s) != 8) 25 | abort (); 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /test/tests/ptr-arith-1.c: -------------------------------------------------------------------------------- 1 | char * 2 | f (char *s, unsigned int i) 3 | { 4 | return &s[i + 3 - 1]; 5 | } 6 | 7 | main () 8 | { 9 | char *str, *x2; str = "abcdefghijkl"; 10 | /*char **/x2 = f (str, 12); 11 | if (str + 14 != x2) 12 | abort (); 13 | exit (0); 14 | } 15 | -------------------------------------------------------------------------------- /test/tests/short-compare-2.c: -------------------------------------------------------------------------------- 1 | /* PR rtl-optimization/19296 */ 2 | /* Origin: Falk Hueffner */ 3 | /* Testcase by Andrew Pinski */ 4 | 5 | /* { dg-do run } */ 6 | /* { dg-options "-O" } */ 7 | /* { dg-options "-O -mtune=i686" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ 8 | 9 | extern void abort(); 10 | 11 | void f(unsigned short ad) 12 | { 13 | if ((short) (ad - 0x4000) >= 0) 14 | abort(); 15 | } 16 | 17 | int main(void) 18 | { 19 | f(0xc000); 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /test/tests/strct-pack-2.c: -------------------------------------------------------------------------------- 1 | /*typedef*/ struct At 2 | { 3 | short a;// __attribute__ ((aligned (2),packed)); 4 | short *ap[2];// __attribute__ ((aligned (2),packed)); 5 | };// A; 6 | 7 | main () 8 | { 9 | short i, j = 1; 10 | struct At a, *ap; ap = &a; 11 | ap->ap[j] = &i; 12 | exit (0); 13 | } 14 | -------------------------------------------------------------------------------- /test/tests/strct-pack-3.c: -------------------------------------------------------------------------------- 1 | /*typedef*/ struct At 2 | { 3 | short i;// __attribute__ ((aligned (2),packed)); 4 | int f[2];// __attribute__ ((aligned (2),packed)); 5 | };// A; 6 | 7 | f (ap) 8 | struct At *ap; 9 | { 10 | short i, j = 1; 11 | 12 | i = ap->f[1]; 13 | i += ap->f[j]; 14 | for (j = 0; j < 2; j++) 15 | i += ap->f[j]; 16 | 17 | return i; 18 | } 19 | 20 | main () 21 | { 22 | struct At a; 23 | a.f[0] = 100; 24 | a.f[1] = 13; 25 | if (f (&a) != 139) 26 | abort (); 27 | exit (0); 28 | } 29 | -------------------------------------------------------------------------------- /test/tests/unroll-1.c: -------------------------------------------------------------------------------- 1 | /*inline*/ int 2 | f (int x) 3 | { 4 | return (x + 1); 5 | } 6 | 7 | int 8 | main (void) 9 | { 10 | int a = 0 ; 11 | 12 | while ( (f(f(f(f(f(f(f(f(f(f(1))))))))))) + a < 12 ) 13 | { 14 | a++; 15 | exit (0); 16 | } 17 | if (a != 1) 18 | abort(); 19 | } 20 | -------------------------------------------------------------------------------- /test/tests/vrp-1.c: -------------------------------------------------------------------------------- 1 | extern void abort (); 2 | extern void exit (int); 3 | 4 | int f (int a) { 5 | if (a != 2) { 6 | a = -a; 7 | if (a == 2) 8 | return 0; 9 | return 1; 10 | } 11 | return 1; 12 | } 13 | 14 | int main (int argc, char *argv[]) { 15 | if (f (-2)) 16 | abort (); 17 | exit (0); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /test/tests/vrp-2.c: -------------------------------------------------------------------------------- 1 | extern void abort (); 2 | extern void exit (int); 3 | 4 | int f (int a) { 5 | if (a != 2) { 6 | a = a > 0 ? a : -a; 7 | if (a == 2) 8 | return 0; 9 | return 1; 10 | } 11 | return 1; 12 | } 13 | 14 | int main (int argc, char *argv[]) { 15 | if (f (-2)) 16 | abort (); 17 | exit (0); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /test/tests/vrp-3.c: -------------------------------------------------------------------------------- 1 | extern void abort (); 2 | extern void exit (int); 3 | 4 | int f (int a) { 5 | if (a < 12) { 6 | if (a > -15) { 7 | a = a > 0 ? a : -a; 8 | if (a == 2) 9 | return 0; 10 | return 1; 11 | } 12 | } 13 | return 1; 14 | } 15 | 16 | int main (int argc, char *argv[]) { 17 | if (f (-2)) 18 | abort (); 19 | exit (0); 20 | } 21 | 22 | -------------------------------------------------------------------------------- /test/tests/vrp-4.c: -------------------------------------------------------------------------------- 1 | extern void exit (int); 2 | extern void abort (); 3 | 4 | void test(int x, int y) 5 | { 6 | int c; 7 | 8 | if (x == 1) abort(); 9 | if (y == 1) abort(); 10 | 11 | c = x / y; 12 | 13 | if (c != 1) abort(); 14 | } 15 | 16 | int main() 17 | { 18 | test(2, 2); 19 | exit (0); 20 | } 21 | -------------------------------------------------------------------------------- /test/tests/vrp-5.c: -------------------------------------------------------------------------------- 1 | extern void exit (int); 2 | extern void abort (); 3 | 4 | void test(unsigned int a, unsigned int b) 5 | { 6 | if (a < 5) 7 | abort(); 8 | if (b < 5) 9 | abort(); 10 | if (a + b != 0/*U*/) 11 | abort(); 12 | } 13 | 14 | int main(int argc, char *argv[]) 15 | { 16 | unsigned int x = 0x8000; 17 | test(x, x); 18 | exit (0); 19 | } 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /test/tests/zerolen-2.c: -------------------------------------------------------------------------------- 1 | extern void abort(void); 2 | 3 | //typedef int word __attribute__((mode(word))); 4 | #define word int 5 | 6 | struct foo 7 | { 8 | word x; 9 | word y[0]; 10 | }; 11 | 12 | int main() 13 | { 14 | if (sizeof(word) != sizeof(struct foo)) 15 | abort(); 16 | // if (__alignof__(word) != __alignof__(struct foo)) 17 | // abort(); 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /tgemu/src/cpu/cpuintrf.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef CPUINTRF_H 3 | #define CPUINTRF_H 4 | 5 | #include "osd_cpu.h" 6 | 7 | #define CLEAR_LINE 0 8 | #define ASSERT_LINE 1 9 | #define REG_PREVIOUSPC -1 10 | #define REG_SP_CONTENTS -2 11 | 12 | #endif /* CPUINTRF_H */ 13 | -------------------------------------------------------------------------------- /tgemu/src/fileio.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _FILEIO_H_ 3 | #define _FILEIO_H_ 4 | 5 | /* Global data */ 6 | extern char game_name[0x100]; 7 | 8 | /* Function prototypes */ 9 | int load_rom(char *filename, int split, int flip); 10 | int file_exist(char *filename); 11 | int load_file(char *filename, char *buf, int size); 12 | int save_file(char *filename, char *buf, int size); 13 | 14 | #endif /* _FILEIO_H_ */ 15 | -------------------------------------------------------------------------------- /tgemu/src/shared.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SHARED_H_ 3 | #define _SHARED_H_ 4 | 5 | #include "types.h" 6 | #include "h6280.h" 7 | #include "pce.h" 8 | #include "vdc.h" 9 | #include "vce.h" 10 | #include "render.h" 11 | #include "system.h" 12 | #include "psg.h" 13 | #include "cpu/cpuintrf.h" 14 | /* #include "unzip.h" */ 15 | #include "fileio.h" 16 | #include "osd.h" 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #endif /* _SHARED_H_ */ 24 | -------------------------------------------------------------------------------- /tgemu/src/types.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _TYPES_H_ 3 | #define _TYPES_H_ 4 | 5 | typedef unsigned char uint8; 6 | typedef unsigned short int uint16; 7 | typedef unsigned int uint32; 8 | 9 | typedef signed char int8; 10 | typedef signed short int int16; 11 | typedef signed int int32; 12 | 13 | #endif /* _TYPES_H_ */ 14 | 15 | -------------------------------------------------------------------------------- /tgemu/src/unix/osd.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/huc/ffd00543ebe6022690cf8a8f93ad41a4f4d66749/tgemu/src/unix/osd.h -------------------------------------------------------------------------------- /tgemu/src/vce.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _VCE_H_ 3 | #define _VCE_H_ 4 | 5 | /* Macros and defines */ 6 | typedef struct 7 | { 8 | uint8 ctrl; 9 | uint8 data[0x400]; 10 | uint16 addr; 11 | }t_vce; 12 | 13 | /* Global data */ 14 | extern t_vce vce; 15 | 16 | /* Function prototypes */ 17 | void vce_w(int address, int data); 18 | int vce_r(int address); 19 | 20 | #endif /* _VCE_H_ */ 21 | --------------------------------------------------------------------------------