├── .gitattributes ├── .github ├── CONTRIBUTING.md ├── FUNDING.yml └── workflows │ ├── branch.yml │ └── make.yml ├── .gitignore ├── .gitmodules ├── changelog.md ├── docs ├── .gitignore ├── Makefile ├── build.sh ├── conf.py ├── doxyfile ├── headers │ ├── compression.rst │ ├── index.rst │ ├── intce.rst │ ├── sys │ │ ├── basicusb.rst │ │ ├── index.rst │ │ ├── lcd.rst │ │ ├── power.rst │ │ ├── rtc.rst │ │ ├── timers.rst │ │ └── util.rst │ ├── ti │ │ ├── error.rst │ │ ├── flags.rst │ │ ├── getcsc.rst │ │ ├── getkey.rst │ │ ├── index.rst │ │ ├── info.rst │ │ ├── python.rst │ │ ├── real.rst │ │ ├── screen.rst │ │ ├── sprintf.rst │ │ ├── tokens.rst │ │ ├── ui.rst │ │ └── vars.rst │ └── tice.rst ├── index.rst ├── libraries │ ├── fatdrvce.rst │ ├── fileioc.rst │ ├── fontlibc.rst │ ├── graphx.rst │ ├── images │ │ ├── graphx_buffer.png │ │ ├── graphx_oops.png │ │ ├── graphx_palette.png │ │ ├── graphx_sprites.png │ │ └── keycodes.png │ ├── index.rst │ ├── keypadc.rst │ ├── libload.rst │ ├── msddrvce.rst │ ├── srldrvce.rst │ └── usbdrvce.rst ├── local-build.sh ├── requirements.txt ├── static │ ├── asm.rst │ ├── coding-guidelines.rst │ ├── contributing.rst │ ├── debugging.rst │ ├── faq.rst │ ├── fileio.rst │ ├── getting-started.rst │ ├── git.rst │ ├── hardware.rst │ ├── ides.rst │ ├── images │ │ ├── code-review.jpg │ │ ├── hello_world.png │ │ ├── ides_clion_1.png │ │ ├── ides_clion_2.png │ │ ├── ides_clion_3.png │ │ ├── ides_clion_4.png │ │ ├── ides_clion_5.png │ │ ├── ides_clion_6.png │ │ └── mem_layout.png │ ├── makefile-options.rst │ └── printf.rst └── templates │ └── versions.html ├── examples ├── hello_world │ ├── .gitignore │ ├── icon.png │ ├── makefile │ ├── readme.md │ ├── screenshot.png │ └── src │ │ └── main.c ├── library_examples │ ├── fatdrvce │ │ ├── fat_dir_tree │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ └── src │ │ │ │ └── main.c │ │ ├── fat_rom_dump │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ └── src │ │ │ │ └── main.c │ │ └── fat_test │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ └── src │ │ │ └── main.c │ ├── fileioc │ │ ├── detect │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ └── src │ │ │ │ └── main.c │ │ ├── factorize_ans │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.png │ │ │ └── src │ │ │ │ └── main.c │ │ ├── os_vars │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.png │ │ │ └── src │ │ │ │ └── main.c │ │ ├── read_write │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ └── src │ │ │ │ └── main.c │ │ ├── rename │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ └── src │ │ │ │ └── main.c │ │ └── tokens │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.png │ │ │ └── src │ │ │ └── main.c │ ├── fontlibc │ │ ├── example │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.png │ │ │ └── src │ │ │ │ ├── fonts │ │ │ │ ├── fonts.c │ │ │ │ ├── fonts.h │ │ │ │ └── testfont.fnt │ │ │ │ └── main.c │ │ └── font_pack │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ └── src │ │ │ ├── fonts │ │ │ ├── drsans-06-bold.convfont │ │ │ ├── drsans-06-normal.convfont │ │ │ ├── drsans-07-bold.convfont │ │ │ ├── drsans-07-normal.convfont │ │ │ ├── drsans-09-bold.convfont │ │ │ └── drsans-09-normal.convfont │ │ │ └── main.c │ ├── graphx │ │ ├── background │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.png │ │ │ └── src │ │ │ │ ├── gfx │ │ │ │ ├── background.png │ │ │ │ └── convimg.yaml │ │ │ │ └── main.c │ │ ├── background_appvar │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.png │ │ │ └── src │ │ │ │ ├── gfx │ │ │ │ ├── convimg.yaml │ │ │ │ └── image.png │ │ │ │ └── main.c │ │ ├── blitting │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.png │ │ │ └── src │ │ │ │ └── main.c │ │ ├── buffered_cube │ │ │ ├── .gitignore │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.png │ │ │ └── src │ │ │ │ └── main.c │ │ ├── floodfill │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.png │ │ │ └── src │ │ │ │ └── main.c │ │ ├── hello_world │ │ │ ├── .gitignore │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.png │ │ │ └── src │ │ │ │ └── main.c │ │ ├── lighten_darken │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.gif │ │ │ └── src │ │ │ │ └── main.c │ │ ├── scaled_text │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.png │ │ │ └── src │ │ │ │ └── main.c │ │ ├── screen_shift │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.png │ │ │ └── src │ │ │ │ └── main.c │ │ ├── shapes │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.png │ │ │ └── src │ │ │ │ └── main.c │ │ ├── sprites │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.png │ │ │ └── src │ │ │ │ ├── gfx │ │ │ │ ├── convimg.yaml │ │ │ │ └── oiram.png │ │ │ │ └── main.c │ │ ├── sprites_appvar │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.png │ │ │ └── src │ │ │ │ ├── gfx │ │ │ │ ├── convimg.yaml │ │ │ │ ├── mint.png │ │ │ │ └── ubuntu.png │ │ │ │ └── main.c │ │ ├── sprites_compress │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.png │ │ │ └── src │ │ │ │ ├── gfx │ │ │ │ ├── apple.png │ │ │ │ └── convimg.yaml │ │ │ │ └── main.c │ │ ├── sprites_moving │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.png │ │ │ └── src │ │ │ │ ├── gfx │ │ │ │ ├── convimg.yaml │ │ │ │ ├── oiram.png │ │ │ │ └── ubuntu.png │ │ │ │ └── main.c │ │ ├── sprites_rlet │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.png │ │ │ └── src │ │ │ │ ├── gfx │ │ │ │ ├── convimg.yaml │ │ │ │ └── ubuntu.png │ │ │ │ └── main.c │ │ ├── sprites_rotate_flip │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.png │ │ │ └── src │ │ │ │ ├── gfx │ │ │ │ ├── convimg.yaml │ │ │ │ └── star.png │ │ │ │ └── main.c │ │ ├── sprites_rotate_scale │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.png │ │ │ └── src │ │ │ │ ├── gfx │ │ │ │ ├── convimg.yaml │ │ │ │ └── star.png │ │ │ │ └── main.c │ │ ├── sprites_scaled │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.png │ │ │ └── src │ │ │ │ ├── gfx │ │ │ │ ├── convimg.yaml │ │ │ │ └── oiram.png │ │ │ │ └── main.c │ │ ├── text_clipped │ │ │ ├── .gitignore │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.png │ │ │ └── src │ │ │ │ └── main.c │ │ ├── text_custom │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.png │ │ │ └── src │ │ │ │ └── main.c │ │ ├── text_flipped │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.png │ │ │ └── src │ │ │ │ └── main.c │ │ ├── tilemap │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.png │ │ │ └── src │ │ │ │ ├── gfx │ │ │ │ ├── convimg.yaml │ │ │ │ └── tileset.png │ │ │ │ ├── main.c │ │ │ │ └── tilemap │ │ │ │ └── tilemap.csv │ │ ├── tilemap_appvar │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.png │ │ │ └── src │ │ │ │ ├── gfx │ │ │ │ ├── convimg.yaml │ │ │ │ └── tileset.png │ │ │ │ ├── main.c │ │ │ │ └── tilemap │ │ │ │ └── tilemap.csv │ │ └── tilemap_compressed │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ └── src │ │ │ ├── gfx │ │ │ ├── convimg.yaml │ │ │ └── tileset.png │ │ │ ├── main.c │ │ │ └── tilemap │ │ │ └── tilemap.csv │ ├── keypadc │ │ ├── multiple_keys │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.gif │ │ │ └── src │ │ │ │ └── main.c │ │ └── single_keys │ │ │ ├── .gitignore │ │ │ ├── autotest.json │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ ├── screenshot.gif │ │ │ └── src │ │ │ └── main.c │ ├── msddrvce │ │ ├── msd_bandwidth │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ └── src │ │ │ │ └── main.c │ │ └── msd_list_partitions │ │ │ ├── makefile │ │ │ ├── readme.md │ │ │ └── src │ │ │ └── main.c │ ├── srldrvce │ │ └── srl_echo │ │ │ ├── icon.png │ │ │ ├── makefile │ │ │ └── src │ │ │ └── main.c │ └── usbdrvce │ │ ├── device_tree │ │ ├── makefile │ │ ├── readme.md │ │ ├── screenshot.png │ │ └── src │ │ │ └── main.c │ │ ├── link_library │ │ ├── makefile │ │ ├── readme.md │ │ └── src │ │ │ ├── linklib.c │ │ │ ├── linklib.h │ │ │ └── main.c │ │ ├── test │ │ ├── makefile │ │ ├── readme.md │ │ └── src │ │ │ └── main.c │ │ └── timer │ │ ├── makefile │ │ ├── readme.md │ │ └── src │ │ └── main.c ├── makefile └── standalone_examples │ ├── args │ ├── .gitignore │ ├── autotest.json │ ├── makefile │ ├── readme.md │ └── src │ │ └── main.c │ ├── c++ │ ├── tireal_pi_montecarlo │ │ ├── .gitignore │ │ ├── makefile │ │ ├── readme.md │ │ ├── screenshot.png │ │ └── src │ │ │ └── main.cpp │ └── tireal_test │ │ ├── .gitignore │ │ ├── autotest.json │ │ ├── makefile │ │ ├── readme.md │ │ ├── screenshot.png │ │ └── src │ │ └── main.cpp │ ├── debug │ └── assert │ │ ├── .gitignore │ │ ├── autotest.json │ │ ├── console.png │ │ ├── makefile │ │ ├── readme.md │ │ ├── screenshot.png │ │ └── src │ │ └── main.c │ ├── eval │ ├── .gitignore │ ├── autotest.json │ ├── makefile │ ├── readme.md │ └── src │ │ └── main.c │ ├── framerate_limiting │ ├── .gitignore │ ├── icon.png │ ├── makefile │ ├── readme.md │ └── src │ │ └── main.c │ ├── lcd_cursor │ ├── .gitignore │ ├── Makefile │ ├── README.md │ ├── Screenshot.png │ └── src │ │ ├── gfx │ │ ├── convimg.yaml │ │ └── cursor.png │ │ └── main.c │ ├── lcd_fade │ ├── .gitignore │ ├── autotest.json │ ├── makefile │ ├── readme.md │ └── src │ │ └── main.c │ ├── lcd_fill │ ├── .gitignore │ ├── autotest.json │ ├── makefile │ ├── readme.md │ ├── screenshot.gif │ └── src │ │ └── main.c │ ├── math_test │ ├── autotest.json │ ├── makefile │ ├── readme.md │ └── src │ │ └── main.c │ ├── os_input │ ├── .gitignore │ ├── autotest.json │ ├── makefile │ ├── readme.md │ ├── screenshot.png │ └── src │ │ └── main.c │ ├── random │ ├── .gitignore │ ├── autotest.json │ ├── makefile │ ├── readme.md │ ├── screenshot.png │ └── src │ │ └── main.c │ ├── real_time_clock │ ├── .gitignore │ ├── autotest.json │ ├── makefile │ ├── readme.md │ ├── screenshot.gif │ └── src │ │ └── main.c │ ├── runprgm │ ├── .gitignore │ ├── autotest.json │ ├── makefile │ ├── prgm │ │ ├── PRGM1.8xp │ │ ├── PRGM2.8xp │ │ └── readme.md │ ├── readme.md │ └── src │ │ └── main.c │ ├── sleep │ ├── .gitignore │ ├── autotest.json │ ├── makefile │ ├── readme.md │ └── src │ │ └── main.c │ ├── stopwatch │ ├── .gitignore │ ├── autotest.json │ ├── makefile │ ├── readme.md │ ├── screenshot.png │ └── src │ │ └── main.c │ └── timer │ ├── .gitignore │ ├── autotest.json │ ├── makefile │ ├── readme.md │ ├── screenshot.png │ └── src │ └── main.c ├── license ├── makefile ├── readme.md ├── resources ├── macOS │ └── dmg │ │ ├── background.png │ │ ├── contents │ │ └── README.txt │ │ └── icon.icns └── windows │ ├── cedev.bat │ └── make.exe ├── src ├── ce │ ├── atomic_load_32.src │ ├── atomic_load_decreasing_32.src │ ├── atomic_load_increasing_32.src │ ├── boot_sprintf.src │ ├── debug.src │ ├── delay.src │ ├── eval.src │ ├── getstringinput.src │ ├── gettokeninput.src │ ├── include │ │ ├── c++ │ │ │ └── tireal.hpp │ │ ├── compression.h │ │ ├── debug.h │ │ ├── intce.h │ │ ├── sys │ │ │ ├── basicusb.h │ │ │ ├── lcd.h │ │ │ ├── power.h │ │ │ ├── rtc.h │ │ │ ├── timers.h │ │ │ └── util.h │ │ ├── ti │ │ │ ├── c++ │ │ │ │ └── real │ │ │ ├── error.h │ │ │ ├── flags.h │ │ │ ├── getcsc.h │ │ │ ├── getkey.h │ │ │ ├── graph.h │ │ │ ├── info.h │ │ │ ├── python.h │ │ │ ├── real.h │ │ │ ├── screen.h │ │ │ ├── sprintf.h │ │ │ ├── tokens.h │ │ │ ├── ui.h │ │ │ └── vars.h │ │ └── tice.h │ ├── intce.src │ ├── makefile │ ├── os_textbuffer.src │ ├── random.src │ ├── runprgm.src │ ├── sleep.src │ ├── sleep_common.src │ ├── tice.src │ ├── ticksleep.src │ ├── usleep.src │ ├── zx0.src │ └── zx7.src ├── common.mk ├── crt │ ├── and.src │ ├── and_fast.src │ ├── bbitrev.src │ ├── bdivs.src │ ├── bdivu.src │ ├── bdvrms_abs.src │ ├── bdvrmu.src │ ├── bmuls.src │ ├── bmulu.src │ ├── bpopcnt.src │ ├── brems.src │ ├── bremu.src │ ├── bshl.src │ ├── bshrs.src │ ├── bshru.src │ ├── crt0.src │ ├── ctlz.src │ ├── cttz.src │ ├── daddsub.src │ ├── dcmp.src │ ├── ddiv.src │ ├── dmul.src │ ├── dneg.src │ ├── drem.src │ ├── dtof.src │ ├── dtol.src │ ├── dtoll.src │ ├── fpneg.src │ ├── fpupop1.src │ ├── fpupop2.src │ ├── frameset.src │ ├── frameset0.src │ ├── frbmuls.src │ ├── frem.src │ ├── frimuls.src │ ├── frimulu.src │ ├── frsmuls.src │ ├── frsmulu.src │ ├── ftod.src │ ├── ftoll.c │ ├── ftoll.src │ ├── i48abs.src │ ├── i48add.src │ ├── i48add_1.src │ ├── i48and.src │ ├── i48bitrev.src │ ├── i48bswap.src │ ├── i48cmps.src │ ├── i48cmpu.src │ ├── i48cmpzero.src │ ├── i48div.src │ ├── i48divs.src │ ├── i48divu.src │ ├── i48dvrmu.src │ ├── i48mulu.src │ ├── i48neg.src │ ├── i48not.src │ ├── i48or.src │ ├── i48popcnt.src │ ├── i48rems.src │ ├── i48remu.src │ ├── i48shl.src │ ├── i48shr.src │ ├── i48sub.src │ ├── i48sub_1.src │ ├── i48xor.src │ ├── ibitrev.src │ ├── ibitrev_fast.src │ ├── icmpzero.src │ ├── idivs.src │ ├── idivu.src │ ├── idvrms.src │ ├── idvrmu.src │ ├── imulu.src │ ├── imulu_fast.src │ ├── indcallhl.src │ ├── ineg.src │ ├── ineg_fast.src │ ├── inot.src │ ├── inot_fast.src │ ├── internal_bitrev_byte.src │ ├── ipopcnt.src │ ├── ipopcnt_fast.src │ ├── irems.src │ ├── iremu.src │ ├── ishl.src │ ├── ishrs.src │ ├── ishrs_1_fast.src │ ├── ishru_1_fast.src │ ├── labs.src │ ├── ladd.src │ ├── ladd_1.src │ ├── ladd_b.src │ ├── ladd_b_fast.src │ ├── ladd_fast.src │ ├── lbitrev.src │ ├── lbswap.src │ ├── lcmps.src │ ├── lcmps_fast.src │ ├── lcmpu.src │ ├── lcmpu_fast.src │ ├── lcmpzero.src │ ├── ldiv.src │ ├── ldivs.src │ ├── ldivs_lrems_common.src │ ├── ldivu.src │ ├── ldvrmu.src │ ├── llabs.src │ ├── lladd.src │ ├── lladd_1.src │ ├── lladd_b.src │ ├── lladd_b_fast.src │ ├── lladd_fast.src │ ├── lland.src │ ├── lland_fast.src │ ├── llbitrev.src │ ├── llbswap.src │ ├── llcmps.src │ ├── llcmps_fast.src │ ├── llcmpu.src │ ├── llcmpu_fast.src │ ├── llcmpzero.src │ ├── llcmpzero_fast.src │ ├── lldiv.src │ ├── lldivs.src │ ├── lldivu.src │ ├── lldivu_b.src │ ├── lldvrmu.src │ ├── llmulu.src │ ├── llmulu_b.src │ ├── llneg.src │ ├── llneg_fast.src │ ├── llnot.src │ ├── llnot_fast.src │ ├── llor.src │ ├── llor_fast.src │ ├── llpopcnt.src │ ├── llpopcnt_fast.src │ ├── llremu.src │ ├── llshl.src │ ├── llshl_1_fast.src │ ├── llshrs.src │ ├── llshrs_1_fast.src │ ├── llshrs_fast.src │ ├── llshru_1_fast.src │ ├── llshru_fast.src │ ├── llsub.src │ ├── llsub_1.src │ ├── llsub_fast.src │ ├── lltod.src │ ├── lltof.c │ ├── lltof.src │ ├── llxor.src │ ├── llxor_fast.src │ ├── lmulu.src │ ├── lmulu_fast.src │ ├── lneg.src │ ├── lneg_fast.src │ ├── lnot.src │ ├── lnot_fast.src │ ├── lpopcnt.src │ ├── lpopcnt_fast.src │ ├── lrems.src │ ├── lremu.src │ ├── lshl.src │ ├── lshrs.src │ ├── lshrs_1_fast.src │ ├── lshru.src │ ├── lshru_1_fast.src │ ├── lsub.src │ ├── lsub_1.src │ ├── lsub_fast.src │ ├── ltod.src │ ├── makefile │ ├── or.src │ ├── or_fast.src │ ├── os.src │ ├── popcnt_common.src │ ├── sand.src │ ├── sbitrev.src │ ├── scmpzero.src │ ├── sdivs.src │ ├── sdivu.src │ ├── sdvrms_abs.src │ ├── sdvrmu.src │ ├── setflag.src │ ├── smulu.src │ ├── smulu_fast.src │ ├── sneg.src │ ├── sneg_fast.src │ ├── snot.src │ ├── snot_fast.src │ ├── sor.src │ ├── spopcnt.src │ ├── spopcnt_fast.src │ ├── srems.src │ ├── sremu.src │ ├── sshl.src │ ├── sshrs.src │ ├── sshru.src │ ├── sxor.src │ ├── ulltod.src │ ├── ulltof.c │ ├── ulltof.src │ ├── ultof.src │ ├── xor.src │ └── xor_fast.src ├── fatdrvce │ ├── fatdrvce.asm │ ├── fatdrvce.h │ ├── macros.inc │ └── makefile ├── fileioc │ ├── fileioc.asm │ ├── fileioc.h │ └── makefile ├── fontlibc │ ├── fontlibc.asm │ ├── fontlibc.h │ └── makefile ├── graphx │ ├── fillscreen.xlsx │ ├── graphx.asm │ ├── graphx.h │ └── makefile ├── include │ ├── include_library.inc │ ├── library.inc │ └── ti84pceg.inc ├── keypadc │ ├── keypadc.asm │ ├── keypadc.h │ └── makefile ├── libc │ ├── __float32_constants.h │ ├── __float64_constants.h │ ├── abs.src │ ├── acosf.src │ ├── acoshf.c │ ├── acoshl.c │ ├── acosl.c │ ├── allocator.src │ ├── allocator_simple.src │ ├── allocator_standard.c │ ├── asctime.c │ ├── asinf.c │ ├── asinf.src │ ├── asinhf.c │ ├── asinhl.c │ ├── asinl.c │ ├── asprintf.src │ ├── assert.c │ ├── atan2f.c │ ├── atan2f.src │ ├── atan2l.c │ ├── atanf.c │ ├── atanf.src │ ├── atanhf.c │ ├── atanhl.c │ ├── atanl.c │ ├── atof.src │ ├── atol.src │ ├── atoll.src │ ├── boot_vsprintf.c │ ├── boot_vsprintf.src │ ├── bsearch.c │ ├── bzero.src │ ├── cbrtf.c │ ├── cbrtl.c │ ├── ceilf.src │ ├── ceill.c │ ├── cimagf.src │ ├── cimagl.src │ ├── clearerr.c │ ├── clock.src │ ├── cmplxf.src │ ├── cmplxl.src │ ├── conjf.src │ ├── conjl.src │ ├── copysignf.src │ ├── copysignl.src │ ├── cosf.src │ ├── coshf.c │ ├── coshf.src │ ├── coshl.c │ ├── crealf.src │ ├── creall.src │ ├── ctime.c │ ├── difftime.c │ ├── div.src │ ├── erfcf.c │ ├── erfcl.c │ ├── erff.c │ ├── erfl.c │ ├── errno_str.c │ ├── exp2f.c │ ├── exp2l.c │ ├── expf.c │ ├── expf.src │ ├── expl.c │ ├── expm1f.c │ ├── expm1l.c │ ├── ez80_builtin.src │ ├── fabsf.src │ ├── fabsl.src │ ├── fclose.c │ ├── fdim.c │ ├── fenv.c │ ├── feof.c │ ├── ferror.c │ ├── fflush.c │ ├── fgetc.c │ ├── fgets.c │ ├── files.c │ ├── float64_rounding.c │ ├── floorf.c │ ├── floorf.src │ ├── floorl.c │ ├── fmaf.c │ ├── fmal.src │ ├── fmax.c │ ├── fmin.c │ ├── fmodf.c │ ├── fmodf.src │ ├── fmodl.src │ ├── fopen.c │ ├── fpclassifyf.src │ ├── fpclassifyl.src │ ├── fprintf.src │ ├── fputc.c │ ├── fputs.c │ ├── fread.c │ ├── frexpf.src │ ├── frexpl.c │ ├── fseek.c │ ├── ftell.c │ ├── fwrite.c │ ├── getchar.src │ ├── gmtime.c │ ├── header_test.c │ ├── hypot3f.c │ ├── hypot3l.c │ ├── hypotf.c │ ├── hypotl.c │ ├── ilogbf.src │ ├── ilogbl.src │ ├── inchar.src │ ├── include │ │ ├── __math_def.h │ │ ├── alloca.h │ │ ├── assert.h │ │ ├── byteswap.h │ │ ├── cdefs.h │ │ ├── complex.h │ │ ├── ctype.h │ │ ├── errno.h │ │ ├── ez80_builtin.h │ │ ├── fenv.h │ │ ├── float.h │ │ ├── inttypes.h │ │ ├── iso646.h │ │ ├── limits.h │ │ ├── math.h │ │ ├── setjmp.h │ │ ├── stdalign.h │ │ ├── stdarg.h │ │ ├── stdbit.h │ │ ├── stdbool.h │ │ ├── stdckdint.h │ │ ├── stddef.h │ │ ├── stdint.h │ │ ├── stdio.h │ │ ├── stdlib.h │ │ ├── stdnoreturn.h │ │ ├── string.h │ │ ├── tgmath.h │ │ ├── time.h │ │ └── wchar.h │ ├── isalnum.src │ ├── isalpha.src │ ├── isascii.src │ ├── isblank.src │ ├── iscntrl.src │ ├── isdigit.src │ ├── isfinitef.src │ ├── isfinitel.src │ ├── isgraph.src │ ├── isinff.src │ ├── isinfl.src │ ├── islower.src │ ├── isnanf.src │ ├── isnanl.src │ ├── isnormalf.src │ ├── isnormall.src │ ├── isprint.src │ ├── ispunct.src │ ├── issignalingf.src │ ├── issignalingl.src │ ├── isspace.src │ ├── issubnormalf.src │ ├── issubnormall.src │ ├── isupper.src │ ├── isxdigit.src │ ├── iszerof.src │ ├── iszerol.src │ ├── ldexpf.src │ ├── ldexpl.c │ ├── lgammaf.c │ ├── lgammal.c │ ├── llrintf.c │ ├── llroundf.c │ ├── localtime.c │ ├── log10f.c │ ├── log10f.src │ ├── log10l.c │ ├── log1pf.c │ ├── log1pl.c │ ├── log2f.c │ ├── log2l.c │ ├── logb.c │ ├── logf.c │ ├── logf.src │ ├── logl.c │ ├── lrintf.c │ ├── lroundf.c │ ├── makefile │ ├── memccpy.src │ ├── memcpy.src │ ├── mempcpy.src │ ├── memrchr.src │ ├── memset.src │ ├── mktime.c │ ├── modff.src │ ├── modfl.c │ ├── nan.c │ ├── nanoprintf.c │ ├── nanoprintf.h │ ├── nearbyint.c │ ├── nextafterf.c │ ├── nextafterl.c │ ├── nexttoward.c │ ├── nextupdownf.c │ ├── nextupdownl.c │ ├── os.src │ ├── outchar.src │ ├── powf.c │ ├── powf.src │ ├── powl.c │ ├── printf.src │ ├── putchar.src │ ├── puts.src │ ├── qsort.c │ ├── quick_exit.c │ ├── rand.src │ ├── remainderf.c │ ├── remainderl.c │ ├── remove.c │ ├── remquof.c │ ├── remquol.c │ ├── rewind.c │ ├── rintf.c │ ├── roundeven.c │ ├── roundf.c │ ├── scalbln.c │ ├── signbitf.src │ ├── signbitl.src │ ├── sincosl.c │ ├── sinf.c │ ├── sinf.src │ ├── sinhf.c │ ├── sinhf.src │ ├── sinhl.c │ ├── snprintf.src │ ├── sprintf.src │ ├── sqrtf.c │ ├── sqrtf.src │ ├── sqrtl.src │ ├── srand.src │ ├── stdbit.c │ ├── stpcpy.src │ ├── strcasecmp.src │ ├── strcmp.src │ ├── strdup.src │ ├── strftime.c │ ├── strlcpy.src │ ├── strlen.src │ ├── strncmp.src │ ├── strndup.src │ ├── strnlen.src │ ├── strrchr.src │ ├── strtof.c │ ├── strtof.src │ ├── strtol.c │ ├── strtold.c │ ├── strtoll.c │ ├── strtoul.c │ ├── strtoull.c │ ├── strtox.h │ ├── tanf.c │ ├── tanf.src │ ├── tanhf.c │ ├── tanhf.src │ ├── tanhl.c │ ├── tanl.c │ ├── tgammaf.c │ ├── tgammal.c │ ├── time.c │ ├── tolower.src │ ├── toupper.src │ ├── trigpif.c │ ├── trigpil.c │ ├── truncf.src │ ├── truncl.src │ └── vsprintf.src ├── libcxx │ ├── abort_message.cpp │ ├── abort_message.h │ ├── exception.cpp │ ├── header_test.cpp │ ├── include │ │ ├── __abs_overloads │ │ ├── __cmath_type_traits │ │ ├── __config │ │ ├── algorithm │ │ ├── bit │ │ ├── cassert │ │ ├── cctype │ │ ├── cerrno │ │ ├── cfloat │ │ ├── cinttypes │ │ ├── ciso646 │ │ ├── climits │ │ ├── cmath │ │ ├── concepts │ │ ├── csetjmp │ │ ├── cstdalign │ │ ├── cstdbool │ │ ├── cstddef │ │ ├── cstdint │ │ ├── cstdio │ │ ├── cstdlib │ │ ├── cstring │ │ ├── ctgmath │ │ ├── ctime │ │ ├── cxxabi.h │ │ ├── exception │ │ ├── initializer_list │ │ ├── limits │ │ ├── memory │ │ ├── new │ │ ├── numbers │ │ ├── source_location │ │ ├── type_traits │ │ ├── typeinfo │ │ ├── utility │ │ └── version │ ├── makefile │ ├── math_test.cpp │ ├── new.cpp │ ├── type_traits.cpp │ ├── typeinfo.cpp │ ├── utility.cpp │ └── virtual.cpp ├── libload │ ├── libload.asm │ ├── libload.h │ ├── license.md │ ├── makefile │ ├── readme.md │ └── setup │ │ ├── flowchart.png │ │ └── setup.md ├── linker.mk ├── makefile.mk ├── msddrvce │ ├── macros.inc │ ├── makefile │ ├── msddrvce.asm │ └── msddrvce.h ├── softfloat │ ├── doc │ │ ├── COPYING.txt │ │ ├── README.html │ │ ├── README.txt │ │ ├── SoftFloat-history.html │ │ ├── SoftFloat-source.html │ │ ├── SoftFloat.html │ │ └── eZ80-SoftFloat.txt │ ├── f64_div.c │ ├── f64_mul.c │ ├── f64_rem.c │ ├── f64_roundToInt.c │ ├── f64_sqrt.c │ ├── f64_to_f32.c │ ├── f64_to_i32.c │ ├── f64_to_i64.c │ ├── f64_to_ui32.c │ ├── f64_to_ui64.c │ ├── i64_to_f64.c │ ├── include │ │ ├── internals.h │ │ ├── opts-GCC.h │ │ ├── platform.h │ │ ├── primitiveTypes.h │ │ ├── primitives.h │ │ ├── softfloat.h │ │ ├── softfloat_types.h │ │ └── specialize.h │ ├── isNaNF32UI.src │ ├── isNaNF64UI.src │ ├── makefile │ ├── s_addM.c │ ├── s_addMagsF64.c │ ├── s_approxRecip32_1.c │ ├── s_approxRecipSqrt32_1.c │ ├── s_approxRecipSqrt_1Ks.c │ ├── s_approxRecip_1Ks.c │ ├── s_commonNaNToF32UI.c │ ├── s_countLeadingZeros16.c │ ├── s_countLeadingZeros32.c │ ├── s_countLeadingZeros64.c │ ├── s_countLeadingZeros8.c │ ├── s_f64UIToCommonNaN.c │ ├── s_mul64To128M.c │ ├── s_mulAddF32.c │ ├── s_mulAddF64.c │ ├── s_negXM.c │ ├── s_normRoundPackToF64.c │ ├── s_normSubnormalF32Sig.c │ ├── s_normSubnormalF64Sig.c │ ├── s_normSubnormalF64Sig.src │ ├── s_propagateNaNF32UI.c │ ├── s_propagateNaNF64UI.c │ ├── s_propagateNaNF64UI.src │ ├── s_roundMToI64.c │ ├── s_roundPackToF32.c │ ├── s_roundPackToF64.c │ ├── s_roundToI32.c │ ├── s_shiftLeftM.c │ ├── s_shiftRightJam32.c │ ├── s_shiftRightJam64.c │ ├── s_shiftRightJam64.src │ ├── s_shiftRightJamM.c │ ├── s_shortShiftLeftM.c │ ├── s_shortShiftRightJam64.c │ ├── s_shortShiftRightJamM.c │ ├── s_shortShiftRightM.c │ ├── s_subM.c │ ├── s_subMagsF64.c │ ├── softfloat_isSigNaNF32UI.src │ ├── softfloat_isSigNaNF64UI.src │ ├── softfloat_raiseFlags.c │ ├── softfloat_state.c │ └── ui64_to_f64.c ├── srldrvce │ ├── makefile │ ├── srldrvce.asm │ └── srldrvce.h └── usbdrvce │ ├── makefile │ ├── usbdrvce.asm │ └── usbdrvce.h ├── test ├── check_tested.sh ├── fileioc │ ├── detect │ │ ├── .gitignore │ │ ├── autotest.json │ │ ├── makefile │ │ ├── readme.md │ │ └── src │ │ │ └── main.c │ └── resize │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ └── main.c ├── floating_point │ ├── compiletime_classification │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ ├── main.c │ │ │ └── test.asm │ ├── complex │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ ├── complex_alias.asm │ │ │ └── main.c │ ├── float32_classification │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ └── main.c │ ├── float32_frexp │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ ├── f32_frexp_LUT.h │ │ │ └── main.c │ ├── float32_ilogb │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ ├── f32_ilogb_LUT.h │ │ │ └── main.c │ ├── float32_ldexp │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ ├── f32_ldexp_LUT.h │ │ │ └── main.c │ ├── float32_math │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ └── main.cpp │ ├── float32_modf │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ ├── f32_modf_LUT.h │ │ │ └── main.c │ ├── float32_to_float64 │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ ├── f32_to_f64_LUT.h │ │ │ └── main.c │ ├── float32_trunc │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ ├── f32_trunc_LUT.h │ │ │ └── main.c │ ├── float64_arithmetic │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ ├── data.asm │ │ │ ├── f64_arithmetic_LUT.h │ │ │ └── main.cpp │ ├── float64_classification │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ └── main.c │ ├── float64_frexp │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ ├── f64_frexp_LUT.h │ │ │ └── main.c │ ├── float64_from_integer │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ ├── crt_wrap.asm │ │ │ ├── f64_from_integer_LUT.h │ │ │ └── main.c │ ├── float64_ilogb │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ ├── f64_ilogb_LUT.h │ │ │ └── main.c │ ├── float64_ldexp │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ ├── f64_ldexp_LUT.h │ │ │ └── main.c │ ├── float64_math │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ └── main.cpp │ ├── float64_rounding │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ ├── f64_rounding_LUT.h │ │ │ └── main.c │ ├── float64_to_float32 │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ ├── f64_to_f32_LUT.h │ │ │ └── main.c │ ├── float64_to_integer │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ ├── f64_to_integer_LUT.h │ │ │ └── main.c │ ├── float64_trunc │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ ├── f64_trunc_LUT.h │ │ │ └── main.c │ └── ultof │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ ├── main.c │ │ └── ultof_lut.h ├── graphx │ ├── blitting_rectangle │ │ ├── .gitignore │ │ ├── autotest.json │ │ ├── makefile │ │ ├── readme.md │ │ ├── screenshot.png │ │ └── src │ │ │ └── main.c │ └── zx0 │ │ ├── .gitignore │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ ├── gfx │ │ ├── apple.png │ │ └── convimg.yaml │ │ └── main.c ├── issues │ ├── 471 │ │ ├── .gitignore │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ └── main.c │ ├── 511 │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ └── main.c │ └── 514 │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ └── main.c ├── makefile ├── regression │ ├── bug0000 │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ └── main.c │ ├── bug0001 │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ └── main.c │ ├── bug0002 │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ └── main.c │ ├── bug0004 │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ └── main.c │ ├── bug0005 │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ └── main.c │ └── i48routines │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ └── main.c ├── standalone │ ├── asprintf_fprintf │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ ├── main.c │ │ │ └── rename.asm │ ├── concepts │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ └── main.cpp │ ├── delay │ │ ├── autotest.json │ │ ├── makefile │ │ ├── readme.md │ │ └── src │ │ │ └── main.c │ ├── errno │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ └── main.c │ ├── ez80_builtin │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ └── main.c │ ├── stdbit │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ ├── data.asm │ │ │ ├── data.h │ │ │ ├── main.cpp │ │ │ └── test.c │ ├── stopwatch │ │ ├── .gitignore │ │ ├── autotest.json │ │ ├── makefile │ │ ├── readme.md │ │ ├── screenshot.png │ │ └── src │ │ │ └── main.c │ ├── strlcpy │ │ ├── .gitignore │ │ ├── autotest.json │ │ ├── makefile │ │ └── src │ │ │ └── main.c │ ├── ticksleep │ │ ├── .gitignore │ │ ├── autotest.json │ │ ├── makefile │ │ ├── readme.md │ │ └── src │ │ │ └── main.c │ ├── timer_counter │ │ ├── .gitignore │ │ ├── autotest.json │ │ ├── makefile │ │ ├── readme.md │ │ └── src │ │ │ └── main.c │ ├── timer_counter2 │ │ ├── .gitignore │ │ ├── autotest.json │ │ ├── makefile │ │ ├── readme.md │ │ ├── screenshot.gif │ │ └── src │ │ │ └── main.c │ └── usleep │ │ ├── .gitignore │ │ ├── autotest.json │ │ ├── makefile │ │ ├── readme.md │ │ └── src │ │ └── main.c └── tested-list.md └── tools ├── cedev-config ├── Makefile └── src │ ├── cwalk.c │ ├── cwalk.h │ ├── license.md │ ├── main.c │ ├── whereami.c │ └── whereami.h └── fasmg └── makefile /.gitattributes: -------------------------------------------------------------------------------- 1 | *.c text eol=lf 2 | *.h text eol=lf 3 | *.asm text eol=lf 4 | *.inc text eol=lf 5 | *.ini text eol=lf 6 | *.log text eol=lf 7 | *.bat text eol=lf 8 | *.txt text eol=lf 9 | *.md text eol=lf 10 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | We're glad you want to contribute! Please see the [contributing](https://ce-programming.github.io/toolchain/static/contributing.html) doc page first :) 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | patreon: ceprogramming 2 | ko_fi: ceprogramming 3 | liberapay: CE-Programming 4 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | html/ 2 | venv/ 3 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | html: 2 | ./build.sh 3 | 4 | local-html: 5 | ./local-build.sh 6 | 7 | .PHONY: html local-html 8 | -------------------------------------------------------------------------------- /docs/headers/compression.rst: -------------------------------------------------------------------------------- 1 | .. _compression_h: 2 | 3 | compression.h 4 | ============= 5 | 6 | .. code-block:: c 7 | 8 | #include 9 | 10 | This header includes protoypes for various (de)compression routines. 11 | 12 | .. contents:: :local: 13 | :depth: 3 14 | 15 | API Documentation 16 | ----------------- 17 | 18 | .. doxygenfile:: compression.h 19 | :project: CE C/C++ Toolchain 20 | -------------------------------------------------------------------------------- /docs/headers/index.rst: -------------------------------------------------------------------------------- 1 | .. _headers: 2 | 3 | Miscellaneous Headers 4 | ===================== 5 | 6 | These headers contain various defines and prototypes, as well as any backwards compatibility definitions. 7 | 8 | .. toctree:: 9 | :maxdepth: 1 10 | :glob: 11 | 12 | compression 13 | intce 14 | tice 15 | 16 | Click any of the above links to navigate to the header's documentation. 17 | -------------------------------------------------------------------------------- /docs/headers/sys/index.rst: -------------------------------------------------------------------------------- 1 | .. _sys: 2 | 3 | CE Hardware Headers 4 | =================== 5 | 6 | These headers are specific to the calculator's hardware, and contain various defines and prototypes. 7 | 8 | .. toctree:: 9 | :maxdepth: 1 10 | :glob: 11 | 12 | basicusb 13 | lcd 14 | power 15 | rtc 16 | timers 17 | util 18 | 19 | Click any of the above links to navigate to the header's documentation. 20 | -------------------------------------------------------------------------------- /docs/headers/sys/lcd.rst: -------------------------------------------------------------------------------- 1 | .. _lcd_h: 2 | 3 | sys/lcd.h 4 | ========= 5 | 6 | .. code-block:: c 7 | 8 | #include 9 | 10 | This header includes defines for the PL111 LCD controller used in the CE. 11 | 12 | .. contents:: :local: 13 | :depth: 3 14 | 15 | API Documentation 16 | ----------------- 17 | 18 | .. doxygenfile:: sys/lcd.h 19 | :project: CE C/C++ Toolchain 20 | -------------------------------------------------------------------------------- /docs/headers/sys/util.rst: -------------------------------------------------------------------------------- 1 | .. _util_h: 2 | 3 | sys/util.h 4 | ========== 5 | 6 | .. code-block:: c 7 | 8 | #include 9 | 10 | This header includes defines for miscellaneous CE-specific things. 11 | 12 | .. contents:: :local: 13 | :depth: 3 14 | 15 | API Documentation 16 | ----------------- 17 | 18 | .. doxygenfile:: sys/util.h 19 | :project: CE C/C++ Toolchain 20 | -------------------------------------------------------------------------------- /docs/headers/ti/info.rst: -------------------------------------------------------------------------------- 1 | .. _info_h: 2 | 3 | ti/info.h 4 | ========= 5 | 6 | .. code-block:: c 7 | 8 | #include 9 | 10 | TI provides an API for getting basic information about a specific calculator. 11 | 12 | .. contents:: :local: 13 | :depth: 3 14 | 15 | API Documentation 16 | ----------------- 17 | 18 | .. doxygenfile:: ti/info.h 19 | :project: CE C/C++ Toolchain 20 | -------------------------------------------------------------------------------- /docs/libraries/images/graphx_buffer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/docs/libraries/images/graphx_buffer.png -------------------------------------------------------------------------------- /docs/libraries/images/graphx_oops.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/docs/libraries/images/graphx_oops.png -------------------------------------------------------------------------------- /docs/libraries/images/graphx_palette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/docs/libraries/images/graphx_palette.png -------------------------------------------------------------------------------- /docs/libraries/images/graphx_sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/docs/libraries/images/graphx_sprites.png -------------------------------------------------------------------------------- /docs/libraries/images/keycodes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/docs/libraries/images/keycodes.png -------------------------------------------------------------------------------- /docs/local-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ ! -d venv ];then 4 | python3 -m venv venv 5 | source venv/bin/activate 6 | pip3 install -r requirements.txt 7 | fi 8 | 9 | source venv/bin/activate 10 | 11 | export default_version=`git describe --abbrev=6 --dirty --always` 12 | export versions="$default_version nightly" 13 | export current_version=$default_version 14 | 15 | sphinx-build -b html . build/html 16 | 17 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | sphinx==4.5.0 2 | sphinx-design==0.3.0 3 | sphinxcontrib-applehelp==1.0.4 4 | sphinxcontrib-devhelp==1.0.2 5 | sphinxcontrib-htmlhelp==2.0.1 6 | sphinxcontrib-jsmath==1.0.1 7 | sphinxcontrib-qthelp==1.0.3 8 | sphinxcontrib-serializinghtml==1.1.5 9 | sphinx_rtd_theme==1.0.0 10 | docutils==0.16 11 | breathe==4.33.1 12 | Jinja2==3.1.4 13 | alabaster==0.7.13 14 | imagesize==1.4.1 15 | snowballstemmer==2.2.0 16 | -------------------------------------------------------------------------------- /docs/static/images/code-review.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/docs/static/images/code-review.jpg -------------------------------------------------------------------------------- /docs/static/images/hello_world.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/docs/static/images/hello_world.png -------------------------------------------------------------------------------- /docs/static/images/ides_clion_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/docs/static/images/ides_clion_1.png -------------------------------------------------------------------------------- /docs/static/images/ides_clion_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/docs/static/images/ides_clion_2.png -------------------------------------------------------------------------------- /docs/static/images/ides_clion_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/docs/static/images/ides_clion_3.png -------------------------------------------------------------------------------- /docs/static/images/ides_clion_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/docs/static/images/ides_clion_4.png -------------------------------------------------------------------------------- /docs/static/images/ides_clion_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/docs/static/images/ides_clion_5.png -------------------------------------------------------------------------------- /docs/static/images/ides_clion_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/docs/static/images/ides_clion_6.png -------------------------------------------------------------------------------- /docs/static/images/mem_layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/docs/static/images/mem_layout.png -------------------------------------------------------------------------------- /examples/hello_world/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/hello_world/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/hello_world/icon.png -------------------------------------------------------------------------------- /examples/hello_world/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/hello_world/readme.md: -------------------------------------------------------------------------------- 1 | ### Hello World Demo 2 | 3 | Displays the text `Hello, World!` on the calculator. 4 | -------------------------------------------------------------------------------- /examples/hello_world/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/hello_world/screenshot.png -------------------------------------------------------------------------------- /examples/hello_world/src/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | /* Main function, called first */ 6 | int main(void) 7 | { 8 | /* Clear the homescreen */ 9 | os_ClrHome(); 10 | 11 | /* Print a string */ 12 | os_PutStrFull("Hello, World."); 13 | 14 | /* Waits for a key */ 15 | while (!os_GetCSC()); 16 | 17 | /* Return 0 for success */ 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /examples/library_examples/fatdrvce/fat_dir_tree/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/fatdrvce/fat_dir_tree/readme.md: -------------------------------------------------------------------------------- 1 | ### FAT Directory Tree 2 | 3 | Recursively iterates through the directories present on the FAT MSD drive and 4 | prints the name of the file as it iterates. 5 | 6 | -------------------------------------------------------------------------------- /examples/library_examples/fatdrvce/fat_rom_dump/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/fatdrvce/fat_rom_dump/readme.md: -------------------------------------------------------------------------------- 1 | ### FAT ROM Dump Demo 2 | 3 | This demo create a ROM dump and stores it to a file called "ROMDUMP.ROM" in 4 | the root directory. This file can then be used in an emulator such as CEmu. 5 | 6 | -------------------------------------------------------------------------------- /examples/library_examples/fatdrvce/fat_test/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/fatdrvce/fat_test/readme.md: -------------------------------------------------------------------------------- 1 | ### FAT Test Demo 2 | 3 | This demo tests various fatdrvce API functions. 4 | -------------------------------------------------------------------------------- /examples/library_examples/fileioc/detect/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/fileioc/detect/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/fileioc/detect/readme.md: -------------------------------------------------------------------------------- 1 | ### Any File Detection Demo 2 | 3 | Uses the `ti_DetectAny` function to search for a variable. 4 | The LibLoad AppVar is used because it is known to exist. 5 | -------------------------------------------------------------------------------- /examples/library_examples/fileioc/factorize_ans/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/fileioc/factorize_ans/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/fileioc/factorize_ans/readme.md: -------------------------------------------------------------------------------- 1 | ### Factorize Ans Demo 2 | 3 | Computes the prime factors of the input number in Ans. Result stored as a List in Ans. 4 | -------------------------------------------------------------------------------- /examples/library_examples/fileioc/factorize_ans/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/fileioc/factorize_ans/screenshot.png -------------------------------------------------------------------------------- /examples/library_examples/fileioc/os_vars/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/fileioc/os_vars/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/fileioc/os_vars/readme.md: -------------------------------------------------------------------------------- 1 | ### OS Variables Demo 2 | 3 | This demo shows how to use the different OS variable accessing functions. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/library_examples/fileioc/os_vars/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/fileioc/os_vars/screenshot.png -------------------------------------------------------------------------------- /examples/library_examples/fileioc/read_write/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/fileioc/read_write/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/fileioc/read_write/readme.md: -------------------------------------------------------------------------------- 1 | ### File Write/Read Demo 2 | 3 | Writes data to a file and then reads back for verification. 4 | -------------------------------------------------------------------------------- /examples/library_examples/fileioc/rename/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/fileioc/rename/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/fileioc/rename/readme.md: -------------------------------------------------------------------------------- 1 | ### Rename Demo 2 | 3 | Renames a previously created file. 4 | -------------------------------------------------------------------------------- /examples/library_examples/fileioc/tokens/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/fileioc/tokens/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/fileioc/tokens/readme.md: -------------------------------------------------------------------------------- 1 | ### Get TI Token Demo 2 | 3 | This demo shows how to use the `ti_GetDataPtr` and `ti_GetTokenString` functions by printing the first few tokens in the TI-BASIC program `ABC`. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/library_examples/fileioc/tokens/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/fileioc/tokens/screenshot.png -------------------------------------------------------------------------------- /examples/library_examples/fontlibc/example/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/fontlibc/example/readme.md: -------------------------------------------------------------------------------- 1 | ### Text Demo 2 | 3 | Displays text using FontLibC. It shows both using the text window, and using text metrics to help position text. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/library_examples/fontlibc/example/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/fontlibc/example/screenshot.png -------------------------------------------------------------------------------- /examples/library_examples/fontlibc/example/src/fonts/fonts.h: -------------------------------------------------------------------------------- 1 | #ifndef FONTS_H 2 | #define FONTS_H 3 | 4 | #include 5 | 6 | extern const fontlib_font_t *test_font; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /examples/library_examples/fontlibc/example/src/fonts/testfont.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/fontlibc/example/src/fonts/testfont.fnt -------------------------------------------------------------------------------- /examples/library_examples/fontlibc/font_pack/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/fontlibc/font_pack/readme.md: -------------------------------------------------------------------------------- 1 | ### Font Pack Demo 2 | 3 | Uses a font pack AppVar instead of directly embedding a font into the binary. 4 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/background/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/background/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/background/readme.md: -------------------------------------------------------------------------------- 1 | ### Background Image Demo 2 | 3 | Displays a fullscreen image stored compressed in the program. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/background/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/background/screenshot.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/background/src/gfx/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/background/src/gfx/background.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/background/src/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "gfx/gfx.h" 6 | 7 | int main(void) 8 | { 9 | gfx_Begin(); 10 | 11 | gfx_SetPalette(global_palette, sizeof_global_palette, 0); 12 | 13 | zx7_Decompress(gfx_vram, background_compressed); 14 | 15 | while (!os_GetCSC()); 16 | 17 | gfx_End(); 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/background_appvar/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/background_appvar/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/background_appvar/readme.md: -------------------------------------------------------------------------------- 1 | ### Fullscreen AppVar Image Demo 2 | 3 | Uses a compressed tiled image in an AppVar to construct a fullscreen image. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/background_appvar/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/background_appvar/screenshot.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/background_appvar/src/gfx/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/background_appvar/src/gfx/image.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/blitting/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/blitting/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/blitting/readme.md: -------------------------------------------------------------------------------- 1 | ### Blitting Demo 2 | 3 | This example demonstrates blitting to manually copy data from the hidden drawing buffer to the visible screen buffer. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/blitting/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/blitting/screenshot.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/buffered_cube/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/buffered_cube/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/buffered_cube/readme.md: -------------------------------------------------------------------------------- 1 | ### Cube Buffer Demo 2 | 3 | Draws a rotating cube, where drawing is performed on the hidden back buffer. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/buffered_cube/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/buffered_cube/screenshot.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/floodfill/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/floodfill/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/floodfill/readme.md: -------------------------------------------------------------------------------- 1 | ### Flood Fill Demo 2 | 3 | Fills a polygon image with a color using the flood fill function. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/floodfill/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/floodfill/screenshot.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/hello_world/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/hello_world/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/hello_world/readme.md: -------------------------------------------------------------------------------- 1 | ### Graphical Hello World Demo 2 | 3 | Prints the text `Hello, World!` centered on the screen. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/hello_world/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/hello_world/screenshot.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/lighten_darken/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/lighten_darken/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/lighten_darken/readme.md: -------------------------------------------------------------------------------- 1 | ### Lighten and Darken Demo 2 | 3 | Uses gfx_Darken and gfx_Lighten to modify palette colors for fading effects. 4 | 5 | ![Screenshot](screenshot.gif) 6 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/lighten_darken/screenshot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/lighten_darken/screenshot.gif -------------------------------------------------------------------------------- /examples/library_examples/graphx/scaled_text/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/scaled_text/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/scaled_text/readme.md: -------------------------------------------------------------------------------- 1 | ### Scaled Text Demo 2 | 3 | This example demonstrates alternating the clipping region and using clipped text properly. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/scaled_text/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/scaled_text/screenshot.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/screen_shift/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/screen_shift/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/screen_shift/readme.md: -------------------------------------------------------------------------------- 1 | ### Screen shifting Demo 2 | 3 | Shifts the screen by pixel increments. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/screen_shift/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/screen_shift/screenshot.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/shapes/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/shapes/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/shapes/readme.md: -------------------------------------------------------------------------------- 1 | ### GraphX Shapes Demo 2 | 3 | Draws different shapes, pixels, text. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/shapes/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/shapes/screenshot.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites/readme.md: -------------------------------------------------------------------------------- 1 | ### Sprite Demo 2 | 3 | Draws a bunch of different styles of sprites on the screen. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/sprites/screenshot.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites/src/gfx/oiram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/sprites/src/gfx/oiram.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_appvar/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_appvar/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_appvar/readme.md: -------------------------------------------------------------------------------- 1 | ### Sprite AppVar Demo 2 | 3 | Demonstrates extracting and using images stored in an AppVar. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_appvar/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/sprites_appvar/screenshot.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_appvar/src/gfx/mint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/sprites_appvar/src/gfx/mint.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_appvar/src/gfx/ubuntu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/sprites_appvar/src/gfx/ubuntu.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_compress/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_compress/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_compress/readme.md: -------------------------------------------------------------------------------- 1 | ### Compressed Sprite Demo 2 | 3 | Demonstrates compressing a sprite and later decompressing in order to save 4 | storage space. 5 | 6 | ![Screenshot](screenshot.png) 7 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_compress/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/sprites_compress/screenshot.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_compress/src/gfx/apple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/sprites_compress/src/gfx/apple.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_moving/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_moving/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_moving/readme.md: -------------------------------------------------------------------------------- 1 | ### Moving a Sprite 2 | 3 | Demonstrates using the graphx and keypadc libraries together to move a sprite. 4 | Sprite incorporates transparency and partial redraw. 5 | 6 | ![Screenshot](screenshot.png) 7 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_moving/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/sprites_moving/screenshot.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_moving/src/gfx/oiram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/sprites_moving/src/gfx/oiram.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_moving/src/gfx/ubuntu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/sprites_moving/src/gfx/ubuntu.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_rlet/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_rlet/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_rlet/readme.md: -------------------------------------------------------------------------------- 1 | ### RLETSprite Demo 2 | 3 | Draws a sprite with RLE transparency in many clipping scenarios and converts to 4 | and from a normal sprite with transparency. Created for testing. 5 | 6 | ![Screenshot](screenshot.png) 7 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_rlet/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/sprites_rlet/screenshot.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_rlet/src/gfx/ubuntu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/sprites_rlet/src/gfx/ubuntu.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_rotate_flip/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_rotate_flip/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_rotate_flip/readme.md: -------------------------------------------------------------------------------- 1 | ### Rotated and Flipped Sprite Demo 2 | 3 | Rotates sprites quickly clockwise and counterclockwise, including vertical 4 | and horizontal flips. 5 | 6 | ![Screenshot](screenshot.png) 7 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_rotate_flip/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/sprites_rotate_flip/screenshot.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_rotate_flip/src/gfx/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/sprites_rotate_flip/src/gfx/star.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_rotate_scale/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_rotate_scale/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_rotate_scale/readme.md: -------------------------------------------------------------------------------- 1 | ### Rotation and Scaling Sprite Demo 2 | 3 | Rotates and scales a sprite directly to the screen. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_rotate_scale/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/sprites_rotate_scale/screenshot.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_rotate_scale/src/gfx/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/sprites_rotate_scale/src/gfx/star.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_scaled/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_scaled/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_scaled/readme.md: -------------------------------------------------------------------------------- 1 | ### Scaled Sprite Demo 2 | 3 | Draws normal and transparent scaled sprites directly to the screen. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_scaled/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/sprites_scaled/screenshot.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/sprites_scaled/src/gfx/oiram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/sprites_scaled/src/gfx/oiram.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/text_clipped/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/text_clipped/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/text_clipped/readme.md: -------------------------------------------------------------------------------- 1 | ### Text Clipping Demo 2 | 3 | This example how to do text clipping by bouncing a string around a fixed box. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/text_clipped/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/text_clipped/screenshot.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/text_custom/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/text_custom/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/text_custom/readme.md: -------------------------------------------------------------------------------- 1 | ### Character Demo 2 | 3 | Flips a text string and displays it upside down. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/text_custom/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/text_custom/screenshot.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/text_flipped/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/text_flipped/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/text_flipped/readme.md: -------------------------------------------------------------------------------- 1 | ### Character Demo 2 | 3 | Flips a text string and displays it upside down. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/text_flipped/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/text_flipped/screenshot.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/tilemap/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/tilemap/readme.md: -------------------------------------------------------------------------------- 1 | ### Tilemap Demo 2 | 3 | An example of tilemaping using a tileset, tilemap, and the keypad. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/tilemap/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/tilemap/screenshot.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/tilemap/src/gfx/tileset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/tilemap/src/gfx/tileset.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/tilemap_appvar/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/tilemap_appvar/readme.md: -------------------------------------------------------------------------------- 1 | ### Tilemap Appvar Demo 2 | 3 | Demonstrates storage of a tileset in an appvar. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/tilemap_appvar/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/tilemap_appvar/screenshot.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/tilemap_appvar/src/gfx/tileset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/tilemap_appvar/src/gfx/tileset.png -------------------------------------------------------------------------------- /examples/library_examples/graphx/tilemap_compressed/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/tilemap_compressed/readme.md: -------------------------------------------------------------------------------- 1 | ### Compressed Tilemap Demo 2 | 3 | A compressed tilemap and tileset, decompressed at runtime. 4 | -------------------------------------------------------------------------------- /examples/library_examples/graphx/tilemap_compressed/src/gfx/tileset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/graphx/tilemap_compressed/src/gfx/tileset.png -------------------------------------------------------------------------------- /examples/library_examples/keypadc/multiple_keys/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/keypadc/multiple_keys/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/keypadc/multiple_keys/readme.md: -------------------------------------------------------------------------------- 1 | ### Multiple Keypad Keys Demo 2 | 3 | This demo shows how to register multiple keypresses at the same time. 4 | 5 | ![Screenshot](screenshot.gif) 6 | -------------------------------------------------------------------------------- /examples/library_examples/keypadc/multiple_keys/screenshot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/keypadc/multiple_keys/screenshot.gif -------------------------------------------------------------------------------- /examples/library_examples/keypadc/single_keys/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/library_examples/keypadc/single_keys/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/keypadc/single_keys/readme.md: -------------------------------------------------------------------------------- 1 | ### Keypad Arrow Key Demo 2 | 3 | Changes the color of the screen depending on which arrow keys are pressed. 4 | 5 | ![Screenshot](screenshot.gif) 6 | -------------------------------------------------------------------------------- /examples/library_examples/keypadc/single_keys/screenshot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/keypadc/single_keys/screenshot.gif -------------------------------------------------------------------------------- /examples/library_examples/msddrvce/msd_bandwidth/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/msddrvce/msd_bandwidth/readme.md: -------------------------------------------------------------------------------- 1 | ### MSD Bandwidth Demo 2 | 3 | Performs a bandwidth write/read test of a USB mass storage device. 4 | -------------------------------------------------------------------------------- /examples/library_examples/msddrvce/msd_list_partitions/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/msddrvce/msd_list_partitions/readme.md: -------------------------------------------------------------------------------- 1 | ### MSD Partition List Demo 2 | 3 | Lists the available partitions available on the mass storage device 4 | -------------------------------------------------------------------------------- /examples/library_examples/srldrvce/srl_echo/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/srldrvce/srl_echo/icon.png -------------------------------------------------------------------------------- /examples/library_examples/srldrvce/srl_echo/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/usbdrvce/device_tree/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/usbdrvce/device_tree/readme.md: -------------------------------------------------------------------------------- 1 | ### Device Tree Demo 2 | 3 | Displays a tree of connected usb devices. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/library_examples/usbdrvce/device_tree/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/library_examples/usbdrvce/device_tree/screenshot.png -------------------------------------------------------------------------------- /examples/library_examples/usbdrvce/link_library/readme.md: -------------------------------------------------------------------------------- 1 | ### Link Library Demo 2 | 3 | Example library for simple usb communication. 4 | -------------------------------------------------------------------------------- /examples/library_examples/usbdrvce/test/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/usbdrvce/test/readme.md: -------------------------------------------------------------------------------- 1 | ### USB Test Demo 2 | 3 | This demo tests usb api. 4 | 5 | -------------------------------------------------------------------------------- /examples/library_examples/usbdrvce/timer/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/library_examples/usbdrvce/timer/readme.md: -------------------------------------------------------------------------------- 1 | ### USB Timer Demo 2 | 3 | This demo tests the timer api from usbdrvce. 4 | 5 | -------------------------------------------------------------------------------- /examples/makefile: -------------------------------------------------------------------------------- 1 | #----------------------------------------------- 2 | # This makefile builds all the example projects 3 | #----------------------------------------------- 4 | 5 | MAKEFILES = hello_world/makefile $(wildcard */*/makefile) $(wildcard */*/*/makefile) 6 | 7 | all clean gfx .PHONY: $(MAKEFILES) 8 | 9 | $(MAKEFILES): 10 | $(MAKE) -C $(dir $@) $(or $(MAKECMDGOALS),$(findstring debug,$@)) 11 | 12 | .PHONY: all clean gfx 13 | -------------------------------------------------------------------------------- /examples/standalone_examples/args/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/standalone_examples/args/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/standalone_examples/args/readme.md: -------------------------------------------------------------------------------- 1 | ### Args Demo 2 | 3 | Demonstrates using argc and argv. 4 | -------------------------------------------------------------------------------- /examples/standalone_examples/c++/tireal_pi_montecarlo/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/standalone_examples/c++/tireal_pi_montecarlo/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Program Options 3 | # ---------------------------- 4 | 5 | NAME = CPPREAL 6 | ICON = icon.png 7 | DESCRIPTION = "ti::real pi montecarlo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/standalone_examples/c++/tireal_pi_montecarlo/readme.md: -------------------------------------------------------------------------------- 1 | ### ti::real pi estimation (C++ demo) 2 | 3 | This uses the Monte Carlo method to estimate pi. 4 | 5 | As expected, it is very slow. You can quit by pressing a key at any time. 6 | You can also just run it in CEmu, unthrottled, where it takes around 30s. 7 | -------------------------------------------------------------------------------- /examples/standalone_examples/c++/tireal_pi_montecarlo/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/standalone_examples/c++/tireal_pi_montecarlo/screenshot.png -------------------------------------------------------------------------------- /examples/standalone_examples/c++/tireal_test/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/standalone_examples/c++/tireal_test/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Program Options 3 | # ---------------------------- 4 | 5 | NAME = CPPREAL 6 | ICON = icon.png 7 | DESCRIPTION = "ti::real C++ demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/standalone_examples/c++/tireal_test/readme.md: -------------------------------------------------------------------------------- 1 | ### ti::real usage (C++ demo) 2 | 3 | Interacts with the toolchain's C++ class wrapping TI's Real number format. 4 | -------------------------------------------------------------------------------- /examples/standalone_examples/c++/tireal_test/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/standalone_examples/c++/tireal_test/screenshot.png -------------------------------------------------------------------------------- /examples/standalone_examples/debug/assert/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/standalone_examples/debug/assert/console.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/standalone_examples/debug/assert/console.png -------------------------------------------------------------------------------- /examples/standalone_examples/debug/assert/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/standalone_examples/debug/assert/readme.md: -------------------------------------------------------------------------------- 1 | ### Stopwatch Demo 2 | 3 | This demo demonstrates using static_assert and assert from standard C. 4 | 5 | ![Screenshot](screenshot.png) 6 | ![Console](console.png) 7 | -------------------------------------------------------------------------------- /examples/standalone_examples/debug/assert/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/standalone_examples/debug/assert/screenshot.png -------------------------------------------------------------------------------- /examples/standalone_examples/eval/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/standalone_examples/eval/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/standalone_examples/eval/readme.md: -------------------------------------------------------------------------------- 1 | ### Evaluate 2 | 3 | This demo shows how to use `os_EvalVar` and `os_Eval` to evaluate tokenized expressions. 4 | -------------------------------------------------------------------------------- /examples/standalone_examples/framerate_limiting/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | .DS_Store 6 | convimg.yaml.lst 7 | -------------------------------------------------------------------------------- /examples/standalone_examples/framerate_limiting/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/standalone_examples/framerate_limiting/icon.png -------------------------------------------------------------------------------- /examples/standalone_examples/framerate_limiting/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | ARCHIVED = NO 10 | 11 | CFLAGS = -Wall -Wextra -Oz 12 | CXXFLAGS = -Wall -Wextra -Oz 13 | 14 | # ---------------------------- 15 | 16 | include $(shell cedev-config --makefile) 17 | -------------------------------------------------------------------------------- /examples/standalone_examples/framerate_limiting/readme.md: -------------------------------------------------------------------------------- 1 | ### Framerate Limiting 2 | 3 | This demo demonstrates using `clock()` to limit the framerate of a program. 4 | -------------------------------------------------------------------------------- /examples/standalone_examples/lcd_cursor/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | .vscode 9 | *.gif -------------------------------------------------------------------------------- /examples/standalone_examples/lcd_cursor/Makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/standalone_examples/lcd_cursor/README.md: -------------------------------------------------------------------------------- 1 | # LCD Cursor demo 2 | 3 | This demo shows you how to use the LCD's hardware cursor. 4 | -------------------------------------------------------------------------------- /examples/standalone_examples/lcd_cursor/Screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/standalone_examples/lcd_cursor/Screenshot.png -------------------------------------------------------------------------------- /examples/standalone_examples/lcd_cursor/src/gfx/cursor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/standalone_examples/lcd_cursor/src/gfx/cursor.png -------------------------------------------------------------------------------- /examples/standalone_examples/lcd_fade/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/standalone_examples/lcd_fade/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/standalone_examples/lcd_fade/readme.md: -------------------------------------------------------------------------------- 1 | ### LCD Fade Demo 2 | 3 | Controls the LCD backlight by fading in and out. 4 | -------------------------------------------------------------------------------- /examples/standalone_examples/lcd_fill/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/standalone_examples/lcd_fill/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/standalone_examples/lcd_fill/readme.md: -------------------------------------------------------------------------------- 1 | ### Fill Screen Demo 2 | 3 | Fills the screen with a single color. 4 | 5 | ![Screenshot](screenshot.gif) 6 | -------------------------------------------------------------------------------- /examples/standalone_examples/lcd_fill/screenshot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/standalone_examples/lcd_fill/screenshot.gif -------------------------------------------------------------------------------- /examples/standalone_examples/math_test/readme.md: -------------------------------------------------------------------------------- 1 | ### Math test 2 | 3 | Exercises a bunch of math functions. 4 | 5 | -------------------------------------------------------------------------------- /examples/standalone_examples/os_input/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/standalone_examples/os_input/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/standalone_examples/os_input/readme.md: -------------------------------------------------------------------------------- 1 | ### OS Input Demo 2 | 3 | Gets an input string from the OS. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/standalone_examples/os_input/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/standalone_examples/os_input/screenshot.png -------------------------------------------------------------------------------- /examples/standalone_examples/random/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/standalone_examples/random/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/standalone_examples/random/readme.md: -------------------------------------------------------------------------------- 1 | ### Random Fill Screen Demo 2 | 3 | Fills the screen with random colors. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/standalone_examples/random/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/standalone_examples/random/screenshot.png -------------------------------------------------------------------------------- /examples/standalone_examples/real_time_clock/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/standalone_examples/real_time_clock/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/standalone_examples/real_time_clock/readme.md: -------------------------------------------------------------------------------- 1 | ### Real Time Clock Demo 2 | 3 | Demonstrates the basics of the real time clock (RTC). 4 | 5 | ![Screenshot](screenshot.gif) 6 | -------------------------------------------------------------------------------- /examples/standalone_examples/real_time_clock/screenshot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/standalone_examples/real_time_clock/screenshot.gif -------------------------------------------------------------------------------- /examples/standalone_examples/runprgm/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/standalone_examples/runprgm/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/standalone_examples/runprgm/prgm/PRGM1.8xp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/standalone_examples/runprgm/prgm/PRGM1.8xp -------------------------------------------------------------------------------- /examples/standalone_examples/runprgm/prgm/PRGM2.8xp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/standalone_examples/runprgm/prgm/PRGM2.8xp -------------------------------------------------------------------------------- /examples/standalone_examples/runprgm/readme.md: -------------------------------------------------------------------------------- 1 | ### Run Program 2 | 3 | This demo shows how to use os_RunPrgm to run programs stored on the calculator. 4 | -------------------------------------------------------------------------------- /examples/standalone_examples/sleep/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/standalone_examples/sleep/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/standalone_examples/sleep/readme.md: -------------------------------------------------------------------------------- 1 | ### Sleep Demo 2 | 3 | Demonstrates using `sleep()` to sleep for a number of seconds. 4 | -------------------------------------------------------------------------------- /examples/standalone_examples/sleep/src/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(void) 5 | { 6 | /* Clear the homescreen */ 7 | os_ClrHome(); 8 | 9 | /* Wait for 5 seconds */ 10 | os_PutStrFull("Waiting..."); 11 | sleep(5); 12 | os_PutStrFull(" Done!"); 13 | delay(100); 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /examples/standalone_examples/stopwatch/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/standalone_examples/stopwatch/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/standalone_examples/stopwatch/readme.md: -------------------------------------------------------------------------------- 1 | ### Stopwatch Demo 2 | 3 | This demo demonstrates using `clock()` to implement a simple stopwatch 4 | displaying seconds with hundredths precision. 5 | 6 | ![Screenshot](screenshot.png) 7 | -------------------------------------------------------------------------------- /examples/standalone_examples/stopwatch/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/standalone_examples/stopwatch/screenshot.png -------------------------------------------------------------------------------- /examples/standalone_examples/timer/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /examples/standalone_examples/timer/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /examples/standalone_examples/timer/readme.md: -------------------------------------------------------------------------------- 1 | ### Timer Demo 2 | 3 | This demo demonstrates using `clock()` to implement a simple timer 4 | displaying seconds with hundredths precision. 5 | 6 | ![Screenshot](screenshot.png) 7 | -------------------------------------------------------------------------------- /examples/standalone_examples/timer/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/examples/standalone_examples/timer/screenshot.png -------------------------------------------------------------------------------- /resources/macOS/dmg/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/resources/macOS/dmg/background.png -------------------------------------------------------------------------------- /resources/macOS/dmg/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/resources/macOS/dmg/icon.icns -------------------------------------------------------------------------------- /resources/windows/make.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/resources/windows/make.exe -------------------------------------------------------------------------------- /src/ce/boot_sprintf.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | ; to reduce binary size (or performance in the case of sprintf), ti's routines 6 | ; can be linked instead of the toolchain's routines 7 | 8 | public _boot_sprintf 9 | _boot_sprintf := 0000BCh 10 | -------------------------------------------------------------------------------- /src/ce/include/c++/tireal.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | #warning is deprecated; use instead 3 | 4 | -------------------------------------------------------------------------------- /src/crt/bdivs.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __bdivs 5 | __bdivs: 6 | ; I: B=dividend, C=divisor 7 | ; O: a=B/C 8 | 9 | push hl 10 | 11 | ld l, b 12 | call __bdvrms_abs 13 | 14 | ld a, c 15 | xor a, b 16 | 17 | ld a, l 18 | pop hl 19 | ret p 20 | 21 | neg 22 | ret 23 | 24 | 25 | extern __bdvrms_abs 26 | -------------------------------------------------------------------------------- /src/crt/bdivu.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __bdivu 5 | __bdivu: 6 | ; I: B=dividend, C=divisor 7 | ; O: a=B/C 8 | 9 | push bc 10 | push hl 11 | 12 | call __bdvrmu 13 | ld a, l 14 | 15 | pop hl 16 | pop bc 17 | ret 18 | 19 | 20 | extern __bdvrmu 21 | -------------------------------------------------------------------------------- /src/crt/bmuls.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __bmuls 5 | __bmuls: 6 | push bc 7 | ld c,a 8 | mlt bc 9 | ld a,c 10 | pop bc 11 | ret 12 | -------------------------------------------------------------------------------- /src/crt/bmulu.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __bmulu 5 | __bmulu: 6 | push bc 7 | mlt bc 8 | ld a,c 9 | pop bc 10 | ret 11 | -------------------------------------------------------------------------------- /src/crt/brems.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __brems 5 | __brems: 6 | ; I: A=dividend, C=divisor 7 | ; O: a=A%C 8 | 9 | push hl 10 | 11 | ld l, a 12 | push hl 13 | call __bdvrms_abs.hijack_a_l_dividend 14 | 15 | pop af 16 | 17 | ld a, h 18 | pop hl 19 | ret p 20 | 21 | neg 22 | ret 23 | 24 | 25 | extern __bdvrms_abs.hijack_a_l_dividend 26 | -------------------------------------------------------------------------------- /src/crt/bremu.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __bremu 5 | __bremu: 6 | ; I: A=dividend, C=divisor 7 | ; O: a=A%C 8 | 9 | push bc 10 | push hl 11 | 12 | ld b, a 13 | call __bdvrmu 14 | ld a, h 15 | 16 | pop hl 17 | pop bc 18 | ret 19 | 20 | 21 | extern __bdvrmu 22 | -------------------------------------------------------------------------------- /src/crt/bshl.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __bshl 5 | 6 | if PREFER_OS_CRT 7 | 8 | __bshl := 000100h 9 | 10 | else 11 | 12 | __bshl: 13 | ; CC: if B!=0: B*(4*r(PC)+1)+6*r(PC)+(ADL?6*r(SPL)+3*w(SPL):4*r(SPS)+2*w(SPS))+1 14 | ; if B==0: 4*r(PC)+(ADL?3*r(SPL):2*r(SPS))+2 15 | inc b 16 | dec b 17 | ret z 18 | push bc 19 | .loop: 20 | add a, a 21 | djnz .loop 22 | pop bc 23 | ret 24 | 25 | end if 26 | -------------------------------------------------------------------------------- /src/crt/bshrs.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __bshrs 5 | __bshrs: 6 | ; CC: if B!=0: B*(5*r(PC)+1)+6*r(PC)+(ADL?6*r(SPL)+3*w(SPL):4*r(SPS)+2*w(SPS))+1 7 | ; if B==0: 4*r(PC)+(ADL?3*r(SPL):2*r(SPS))+2 8 | inc b 9 | dec b 10 | ret z 11 | push bc 12 | .loop: 13 | sra a 14 | djnz .loop 15 | pop bc 16 | ret 17 | -------------------------------------------------------------------------------- /src/crt/bshru.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __bshru 5 | 6 | if PREFER_OS_CRT 7 | 8 | __bshru := 000104h 9 | 10 | else 11 | 12 | __bshru: 13 | ; CC: if B!=0: B*(5*r(PC)+1)+6*r(PC)+(ADL?6*r(SPL)+3*w(SPL):4*r(SPS)+2*w(SPS))+1 14 | ; if B==0: 4*r(PC)+(ADL?3*r(SPL):2*r(SPS))+2 15 | inc b 16 | dec b 17 | ret z 18 | push bc 19 | .loop: 20 | srl a 21 | djnz .loop 22 | pop bc 23 | ret 24 | 25 | end if 26 | -------------------------------------------------------------------------------- /src/crt/dneg.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public __dneg 6 | 7 | ; assumes BC:UDE:UHL 8 | __dneg: 9 | rl b 10 | ccf 11 | rr b 12 | ret 13 | -------------------------------------------------------------------------------- /src/crt/drem.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public __drem 6 | 7 | ; float64_t f64_rem(bool, float64_t, const float64_t*) 8 | __drem: 9 | push af, iy 10 | ld iy, 9 11 | add iy, sp 12 | push iy, bc, de, hl 13 | 14 | rl b 15 | push af ; Carry = signbit(x) 16 | 17 | call ___f64_rem 18 | 19 | pop af, af, af, af, af 20 | pop iy, af ; restore 21 | ret 22 | 23 | extern ___f64_rem 24 | -------------------------------------------------------------------------------- /src/crt/dtof.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public __dtof 6 | 7 | __dtof: 8 | ; f64_ret_f32 9 | push af, iy, bc, de, hl 10 | call ___f64_to_f32 11 | pop af 12 | ld a, e 13 | pop de 14 | ld e, a 15 | pop bc, iy, af 16 | ret 17 | 18 | extern ___f64_to_f32 19 | -------------------------------------------------------------------------------- /src/crt/dtol.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public __dtol 6 | public __dtoul 7 | 8 | ; correctly handles all non-UB cases for both 9 | ; (long)long double and (unsigned long)long double 10 | __dtol: 11 | __dtoul: 12 | push bc 13 | push de 14 | call __dtoll ; same as __dtoull 15 | ld c, e 16 | pop de 17 | ld e, c 18 | pop bc 19 | ret 20 | 21 | extern __dtoll 22 | -------------------------------------------------------------------------------- /src/crt/fpupop2.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __fpupop2 5 | __fpupop2: 6 | push bc 7 | ld bc, 0800000h 8 | add hl, bc 9 | jr nc, ncarry 10 | add hl, bc 11 | scf 12 | ncarry: 13 | ld d, c 14 | pop bc 15 | rl e 16 | jr nz, nzero 17 | or a, a 18 | sbc hl, hl 19 | nzero: 20 | rl d 21 | inc e 22 | dec e 23 | ret 24 | -------------------------------------------------------------------------------- /src/crt/frameset.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __frameset 5 | __frameset: 6 | pop de 7 | push ix 8 | ld ix,0 9 | add ix,sp 10 | add hl,sp 11 | ld sp,hl 12 | ex de,hl 13 | jp (hl) 14 | -------------------------------------------------------------------------------- /src/crt/frameset0.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __frameset0 5 | __frameset0: 6 | pop hl 7 | push ix 8 | ld ix,0 9 | add ix,sp 10 | jp (hl) 11 | -------------------------------------------------------------------------------- /src/crt/frem.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public __frem 6 | 7 | ; wraps _fmodf 8 | __frem: 9 | push iy, de, hl 10 | 11 | push de, hl ; y 12 | ld e, a 13 | push de ; x_hi8 14 | push bc ; x_lo24 15 | call _fmodf 16 | pop bc, bc, bc, bc 17 | 18 | ld a, e 19 | ex (sp), hl 20 | pop bc, de, iy 21 | ret 22 | 23 | extern _fmodf 24 | -------------------------------------------------------------------------------- /src/crt/ftoll.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public __ftoll 6 | public __ftoull 7 | 8 | ; __ftoll_c correctly handles all non-UB cases for both 9 | ; (long long)float and (unsigned long long)float 10 | __ftoll: 11 | __ftoull: 12 | ld d, a 13 | push iy, de, hl 14 | call __ftoll_c 15 | pop af, af, iy 16 | ret 17 | 18 | extern __ftoll_c 19 | -------------------------------------------------------------------------------- /src/crt/i48abs.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public _i48abs 6 | 7 | ; int48_t i48abs(int48_t) 8 | _i48abs: 9 | pop bc 10 | pop de 11 | ex (sp), hl 12 | 13 | ; read the signbit 14 | push hl 15 | add hl, hl 16 | ex (sp), hl 17 | 18 | push bc 19 | ex de, hl 20 | jp c, __i48neg ; negative 21 | ; positive 22 | ret 23 | 24 | extern __i48neg 25 | -------------------------------------------------------------------------------- /src/crt/i48add.src: -------------------------------------------------------------------------------- 1 | ; Performs 48-bit addition 2 | ; 3 | ; Returns: 4 | ; ude:uhl = ude:uhl + uiy:ubc 5 | 6 | assume adl=1 7 | 8 | section .text 9 | public __i48add 10 | __i48add: 11 | add hl, bc 12 | ex de, hl 13 | push bc 14 | lea bc, iy 15 | adc hl, bc 16 | pop bc 17 | ex de, hl 18 | ret 19 | -------------------------------------------------------------------------------- /src/crt/i48add_1.src: -------------------------------------------------------------------------------- 1 | ; Performs 48-bit addition 2 | ; 3 | ; Returns: 4 | ; ude:uhl = ude:uhl + 1 5 | 6 | assume adl=1 7 | 8 | section .text 9 | 10 | public __i48add_1 11 | __i48add_1: 12 | inc hl 13 | add hl, de 14 | or a, a 15 | sbc hl, de 16 | ret nz 17 | ; carry 18 | inc de 19 | ret 20 | -------------------------------------------------------------------------------- /src/crt/i48div.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | ; public _i48div 6 | 7 | ; i48div_t i48div(int48_t numer, int48_t denom); 8 | ; _i48div: 9 | -------------------------------------------------------------------------------- /src/crt/i48divu.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __i48divu 5 | 6 | ; Result in ude:uhl 7 | __i48divu: 8 | push iy 9 | push bc 10 | 11 | call __i48dvrmu 12 | 13 | pop bc 14 | pop iy 15 | ret 16 | 17 | extern __i48dvrmu -------------------------------------------------------------------------------- /src/crt/i48remu.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __i48remu 5 | 6 | ; Result in ude:uhl 7 | __i48remu: 8 | push iy 9 | push bc 10 | 11 | call __i48dvrmu 12 | lea de, iy 13 | or a, a 14 | sbc hl, hl 15 | add hl, bc 16 | 17 | pop bc 18 | pop iy 19 | ret 20 | 21 | extern __i48dvrmu -------------------------------------------------------------------------------- /src/crt/i48sub.src: -------------------------------------------------------------------------------- 1 | ; Performs 48-bit subtraction 2 | ; 3 | ; Returns: 4 | ; ude:uhl = ude:uhl - uiy:ubc 5 | 6 | assume adl=1 7 | 8 | section .text 9 | public __i48sub 10 | __i48sub: 11 | or a, a 12 | sbc hl, bc 13 | ex de, hl 14 | push bc 15 | lea bc, iy 16 | sbc hl, bc 17 | pop bc 18 | ex de, hl 19 | ret 20 | -------------------------------------------------------------------------------- /src/crt/i48sub_1.src: -------------------------------------------------------------------------------- 1 | ; Performs 48-bit subtraction 2 | ; 3 | ; Returns: 4 | ; ude:uhl = ude:uhl - 1 5 | 6 | assume adl=1 7 | 8 | section .text 9 | 10 | public __i48sub_1 11 | __i48sub_1: 12 | add hl, de 13 | or a, a 14 | sbc hl, de 15 | dec hl 16 | ret nz 17 | ; carry 18 | dec de 19 | ret 20 | -------------------------------------------------------------------------------- /src/crt/ibitrev.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __ibitrev 5 | __ibitrev: 6 | push af 7 | ld a, l ; a=L 8 | call __internal_bitrev_two_bytes ; a=HLU', uhl=HLL' 9 | ld h, l 10 | ld l, a ; uhl=HL'[HLU'] 11 | call __internal_bitrev_two_bytes ; a=H', uhl=L'[HLU'][HLU] 12 | ld l, h 13 | ld h, a ; uhl=L'H'[HLU'] 14 | pop af 15 | ret 16 | 17 | extern __internal_bitrev_two_bytes 18 | -------------------------------------------------------------------------------- /src/crt/icmpzero.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __icmpzero 5 | __icmpzero: 6 | add hl, de 7 | or a, a 8 | sbc hl, de 9 | ret 10 | -------------------------------------------------------------------------------- /src/crt/idivs.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __idivs 5 | 6 | if PREFER_OS_CRT 7 | 8 | __idivs := 00013Ch 9 | 10 | else 11 | 12 | __idivs: 13 | ; I: UHL=dividend, UBC=divisor 14 | ; O: uhl=UHL/UBC 15 | 16 | push de 17 | 18 | call __idvrms 19 | 20 | pop de 21 | ret 22 | 23 | 24 | extern __idvrms 25 | 26 | end if 27 | -------------------------------------------------------------------------------- /src/crt/idivu.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __idivu 5 | 6 | if PREFER_OS_CRT 7 | 8 | __idivu := 000140h 9 | 10 | else 11 | 12 | __idivu: 13 | ; I: UHL=dividend, UBC=divisor 14 | ; O: uhl=UHL/UBC 15 | 16 | push de 17 | 18 | call __idvrmu 19 | ex de, hl 20 | 21 | pop de 22 | ret 23 | 24 | 25 | extern __idvrmu 26 | 27 | end if 28 | -------------------------------------------------------------------------------- /src/crt/indcallhl.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __indcallhl 5 | __indcallhl: 6 | jp (hl) 7 | -------------------------------------------------------------------------------- /src/crt/ineg_fast.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __ineg_fast 5 | __ineg_fast: 6 | add hl, de ; uhl=UHL+UDE 7 | ex de, hl ; ude=UHL+UDE, uhl=UDE 8 | or a, a 9 | sbc hl, de ; uhl=UDE-(UHL+UDE) 10 | ; =UDE-UHL-UDE 11 | ; =-UHL 12 | ret 13 | -------------------------------------------------------------------------------- /src/crt/inot_fast.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __inot_fast 5 | __inot_fast: 6 | add hl, de ; uhl=UHL+UDE 7 | ex de, hl ; ude=UHL+UDE, uhl=UDE 8 | scf 9 | sbc hl, de ; uhl=UDE-(UHL+UDE)-1 10 | ; =UDE-UHL-UDE-1 11 | ; =-UHL-1 12 | ; =~UHL 13 | ret 14 | -------------------------------------------------------------------------------- /src/crt/internal_bitrev_byte.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __internal_bitrev_two_bytes 5 | __internal_bitrev_two_bytes: 6 | rra 7 | adc hl, hl 8 | rra 9 | adc hl, hl 10 | rra 11 | adc hl, hl 12 | rra 13 | adc hl, hl 14 | rra 15 | adc hl, hl 16 | rra 17 | adc hl, hl 18 | rra 19 | adc hl, hl 20 | rra 21 | adc hl, hl 22 | rra 23 | ret 24 | -------------------------------------------------------------------------------- /src/crt/irems.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __irems 5 | 6 | if PREFER_OS_CRT 7 | 8 | __irems := 00016Ch 9 | 10 | else 11 | 12 | __irems: 13 | ; I: UHL=dividend, UBC=divisor 14 | ; O: uhl=UHL%UBC 15 | 16 | push de 17 | 18 | call __idvrms 19 | ex de, hl 20 | 21 | pop de 22 | ret 23 | 24 | 25 | extern __idvrms 26 | 27 | end if 28 | -------------------------------------------------------------------------------- /src/crt/iremu.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __iremu 5 | 6 | if PREFER_OS_CRT 7 | 8 | __iremu := 000170h 9 | 10 | else 11 | 12 | __iremu: 13 | ; I: UHL=dividend, UBC=divisor 14 | ; O: uhl=UHL%UBC 15 | 16 | push de 17 | 18 | call __idvrmu 19 | 20 | pop de 21 | ret 22 | 23 | extern __idvrmu 24 | 25 | end if 26 | -------------------------------------------------------------------------------- /src/crt/ishrs_1_fast.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __ishru_1_fast 5 | __ishru_1_fast: 6 | push hl 7 | ld hl, 2 8 | add hl, sp 9 | sra (hl) 10 | pop hl 11 | rr h 12 | rr l 13 | ret 14 | -------------------------------------------------------------------------------- /src/crt/ishru_1_fast.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __ishru_1_fast 5 | __ishru_1_fast: 6 | push hl 7 | ld hl, 2 8 | add hl, sp 9 | srl (hl) 10 | pop hl 11 | rr h 12 | rr l 13 | ret 14 | -------------------------------------------------------------------------------- /src/crt/labs.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _labs 5 | _labs: 6 | pop bc 7 | pop hl 8 | pop de 9 | push de 10 | push hl 11 | push bc 12 | bit 7, e 13 | ret z 14 | jp __lneg 15 | 16 | extern __lneg 17 | -------------------------------------------------------------------------------- /src/crt/ladd.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __ladd 5 | 6 | if PREFER_OS_CRT 7 | 8 | __ladd := 00019Ch 9 | 10 | else 11 | 12 | __ladd: 13 | push af 14 | add hl, bc 15 | adc a, e 16 | ld e, a 17 | pop af 18 | ret 19 | 20 | end if 21 | -------------------------------------------------------------------------------- /src/crt/ladd_1.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __ladd_1 5 | __ladd_1: 6 | inc hl 7 | add hl, bc 8 | or a, a 9 | sbc hl, bc 10 | ret nz 11 | inc e 12 | ret 13 | -------------------------------------------------------------------------------- /src/crt/ladd_b.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __ladd_b 5 | 6 | if PREFER_OS_CRT 7 | 8 | __ladd_b := 0001A0h 9 | 10 | else 11 | 12 | __ladd_b: 13 | push bc 14 | inc.s bc 15 | ld c, a 16 | ld b, 0 17 | add hl, bc 18 | pop bc 19 | ret nc 20 | inc e 21 | ret 22 | 23 | end if 24 | -------------------------------------------------------------------------------- /src/crt/ladd_b_fast.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __ladd_b_fast 5 | __ladd_b_fast: 6 | add a, l 7 | ld l, a 8 | ret nc 9 | inc h 10 | ret nz 11 | ld bc, 1 shl 16 12 | add hl, bc 13 | ret nc 14 | inc e 15 | ret 16 | -------------------------------------------------------------------------------- /src/crt/ladd_fast.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __ladd_fast 5 | __ladd_fast: 6 | add hl, bc 7 | adc a, e 8 | ld e, a 9 | ret 10 | -------------------------------------------------------------------------------- /src/crt/lbitrev.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __lbitrev 5 | __lbitrev: 6 | push af 7 | ld a, h ; a=H 8 | ld h, l ; uhl=[HLU]LL 9 | call __internal_bitrev_two_bytes ; a=HLU', uhl=LLH' 10 | ld h, l 11 | ld l, a ; uhl=LH'[HLU'] 12 | ld a, e ; a=E 13 | call __internal_bitrev_two_bytes ; a=L', uhl=H'[HLU']E' 14 | ld e, a ; e=L' 15 | pop af 16 | ret 17 | 18 | extern __internal_bitrev_two_bytes 19 | -------------------------------------------------------------------------------- /src/crt/lbswap.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __lbswap 5 | __lbswap: 6 | push hl ; ...[hlu]hl <- (sp) 7 | inc sp ; ...[hlu]h <- (sp) 8 | ld h, e ; uhl = [hlu]el 9 | push hl ; ...[hlu]h[hlu]el <- (sp) 10 | inc sp ; ...[hlu]h[hlu]e <- (sp) 11 | ld e, l 12 | pop hl ; euhl = lh[hlu]e 13 | ; ...[hlu] <- (sp) 14 | inc sp ; ... <- (sp) 15 | ret 16 | -------------------------------------------------------------------------------- /src/crt/lcmps.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __lcmps 5 | 6 | if PREFER_OS_CRT 7 | 8 | __lcmps := 0001A8h 9 | 10 | else 11 | 12 | __lcmps: 13 | push de 14 | ld d, a 15 | ld a, e 16 | sub a, d 17 | jr nz, .finish 18 | sbc hl, bc 19 | add hl, bc 20 | sbc a, a 21 | .finish: 22 | ld a, d 23 | pop de 24 | ret 25 | 26 | end if 27 | -------------------------------------------------------------------------------- /src/crt/lcmps_fast.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __lcmps_fast 5 | __lcmps_fast: 6 | ld d, a 7 | ld a, e 8 | sub a, d 9 | ret nz 10 | sbc hl, bc 11 | sbc a, a 12 | ret 13 | -------------------------------------------------------------------------------- /src/crt/lcmpu.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __lcmpu 5 | 6 | if PREFER_OS_CRT 7 | 8 | __lcmpu := 0001ACh 9 | 10 | else 11 | 12 | __lcmpu: 13 | cp a, e 14 | ccf 15 | ret nz 16 | or a, a 17 | sbc hl, bc 18 | add hl, bc 19 | ret 20 | 21 | end if 22 | -------------------------------------------------------------------------------- /src/crt/lcmpu_fast.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __lcmpu_fast 5 | __lcmpu_fast: 6 | sub a, e 7 | ccf 8 | ret nz 9 | or a, a 10 | sbc hl, bc 11 | ret 12 | -------------------------------------------------------------------------------- /src/crt/lcmpzero.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __lcmpzero 5 | __lcmpzero: 6 | inc e 7 | dec e 8 | ret nz 9 | add hl, bc 10 | or a, a 11 | sbc hl, bc 12 | ret p 13 | inc e 14 | dec de 15 | ret 16 | -------------------------------------------------------------------------------- /src/crt/ldivs_lrems_common.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __ldivs_lrems_common 5 | __ldivs_lrems_common: 6 | ; I: ZF=EUHL>=0 7 | ; O: aubc=abs(AUBC), euhl=abs(EUHL) 8 | 9 | call nz, __lneg 10 | 11 | or a, a 12 | ret p 13 | 14 | push hl 15 | sbc hl, hl 16 | sbc hl, bc 17 | ex (sp), hl 18 | pop bc 19 | cpl 20 | sbc a, -1 21 | 22 | ret 23 | 24 | extern __lneg 25 | -------------------------------------------------------------------------------- /src/crt/llabs.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _imaxabs, _llabs 5 | _imaxabs: 6 | _llabs: 7 | pop iy 8 | pop hl 9 | pop de 10 | pop bc 11 | push bc 12 | push de 13 | push hl 14 | ld a, b 15 | or a, a 16 | call m, __llneg.hijack_nc 17 | jp (iy) 18 | 19 | 20 | extern __llneg.hijack_nc 21 | -------------------------------------------------------------------------------- /src/crt/lladd.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __lladd 5 | __lladd: 6 | push iy 7 | ld iy, 0 8 | add iy, sp 9 | push bc 10 | ld bc, (iy + 6) 11 | add hl, bc 12 | ex de, hl 13 | ld bc, (iy + 9) 14 | adc hl, bc 15 | ex de, hl 16 | pop bc 17 | jr nc, .nc48 18 | inc bc 19 | .nc48: 20 | ld iy, (iy + 12) 21 | add iy, bc 22 | lea bc, iy 23 | pop iy 24 | ret 25 | -------------------------------------------------------------------------------- /src/crt/lladd_1.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __lladd_1 5 | __lladd_1: 6 | inc hl 7 | add hl, de 8 | or a, a 9 | sbc hl, de 10 | ret nz 11 | inc de 12 | sbc hl, de 13 | add hl, de 14 | ret nz 15 | inc bc 16 | ret 17 | -------------------------------------------------------------------------------- /src/crt/lladd_b.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __lladd_b 5 | __lladd_b: 6 | push bc 7 | inc.s bc 8 | ld c, a 9 | ld b, 0 10 | add hl, bc 11 | jr nc, .finish 12 | ld c, 1 13 | ex de, hl 14 | add hl, bc 15 | ex de, hl 16 | .finish: 17 | pop bc 18 | ret nc 19 | inc bc 20 | ret 21 | -------------------------------------------------------------------------------- /src/crt/lladd_fast.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __lladd_fast 5 | __lladd_fast: 6 | ld iy, 0 7 | add iy, sp 8 | push bc 9 | ld bc, (iy + 3) 10 | add hl, bc 11 | ex de, hl 12 | ld bc, (iy + 6) 13 | adc hl, bc 14 | ex de, hl 15 | pop bc 16 | ld a, c 17 | adc a, (iy + 9) 18 | ld c, a 19 | ld a, b 20 | adc a, (iy + 10) 21 | ld b, a 22 | ret 23 | -------------------------------------------------------------------------------- /src/crt/llcmps_fast.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __llcmps_fast 5 | __llcmps_fast: 6 | ld iy, 0 7 | add iy, sp 8 | ld a, b 9 | sub a, (iy + 10) 10 | ret nz 11 | ld a, c 12 | sub a, (iy + 9) 13 | jr nz, .finish 14 | ex de, hl 15 | ld bc, (iy + 6) 16 | sbc hl, bc 17 | jr nz, .finish 18 | ex de, hl 19 | ld bc, (iy + 3) 20 | sbc hl, bc 21 | .finish: 22 | sbc a, a 23 | ret 24 | -------------------------------------------------------------------------------- /src/crt/llcmpu.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __llcmpu 5 | __llcmpu: 6 | push iy 7 | ld iy, 0 8 | add iy, sp 9 | push hl 10 | ld hl, (iy + 12) 11 | sbc.s hl, bc 12 | jr nz, .ne 13 | ld hl, (iy + 9) 14 | sbc hl, de 15 | jr nz, .ne 16 | pop hl 17 | push bc 18 | ld bc, (iy + 6) 19 | sbc hl, bc 20 | add hl, bc 21 | pop bc 22 | pop iy 23 | ret 24 | 25 | .ne: 26 | ccf 27 | pop hl 28 | pop iy 29 | ret 30 | -------------------------------------------------------------------------------- /src/crt/llcmpu_fast.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __llcmpu_fast 5 | __llcmpu_fast: 6 | ld iy, 0 7 | add iy, sp 8 | ld a, b 9 | sub a, (iy + 10) 10 | ret nz 11 | ld a, c 12 | sub a, (iy + 9) 13 | ret nz 14 | ex de, hl 15 | ld bc, (iy + 6) 16 | sbc hl, bc 17 | ret nz 18 | ex de, hl 19 | ld bc, (iy + 3) 20 | sbc hl, bc 21 | ret 22 | -------------------------------------------------------------------------------- /src/crt/llcmpzero.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __llcmpzero 5 | __llcmpzero: 6 | inc b 7 | dec b 8 | ret nz 9 | inc.s bc 10 | dec c 11 | jr nz, .p_nz 12 | or a, a 13 | sbc hl, bc 14 | jr nz, .p_nz 15 | sbc hl, de 16 | ret z 17 | add hl, de 18 | .p_nz: 19 | inc b 20 | ld b, 0 21 | ret 22 | -------------------------------------------------------------------------------- /src/crt/llcmpzero_fast.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __llcmpzero_fast 5 | __llcmpzero_fast: 6 | xor a, a 7 | add a, b 8 | ret nz 9 | cp a, c 10 | jr nz, .p_nz 11 | mlt bc 12 | adc hl, bc 13 | jr nz, .p_nz 14 | adc hl, de 15 | ret z 16 | .p_nz: 17 | inc a 18 | ret 19 | -------------------------------------------------------------------------------- /src/crt/lldivu.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __lldivu 5 | __lldivu: 6 | 7 | push iy 8 | push af 9 | 10 | call __lldvrmu 11 | 12 | ld hl, (iy + 15) 13 | ld de, (iy + 18) 14 | ld bc, (iy + 21) 15 | 16 | pop af 17 | pop iy 18 | 19 | ret 20 | 21 | extern __lldvrmu 22 | -------------------------------------------------------------------------------- /src/crt/llpopcnt.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __llpopcnt 5 | __llpopcnt: 6 | call __lpopcnt 7 | push de 8 | push hl 9 | ex de, hl 10 | ld l, b 11 | ld e, c 12 | ld d, a 13 | call __lpopcnt 14 | add a, d 15 | pop hl 16 | pop de 17 | ret 18 | 19 | extern __lpopcnt 20 | -------------------------------------------------------------------------------- /src/crt/llpopcnt_fast.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __llpopcnt_fast 5 | __llpopcnt_fast: 6 | ; Destroys: HL, DE 7 | call __lpopcnt_fast 8 | ex de, hl 9 | ld l, b 10 | ld e, c 11 | ld d, a 12 | call __lpopcnt_fast 13 | add a, d 14 | ret 15 | 16 | extern __lpopcnt_fast 17 | -------------------------------------------------------------------------------- /src/crt/llremu.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __llremu 5 | __llremu: 6 | 7 | push iy 8 | push af 9 | 10 | call __lldvrmu 11 | 12 | pop af 13 | pop iy 14 | 15 | ret 16 | 17 | extern __lldvrmu 18 | -------------------------------------------------------------------------------- /src/crt/llshl_1_fast.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __llshl_1_fast 5 | __llshl_1_fast: 6 | add hl, hl 7 | ex de, hl 8 | adc hl, hl 9 | ex de, hl 10 | rl c 11 | rl b 12 | ret 13 | -------------------------------------------------------------------------------- /src/crt/llshrs_1_fast.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __llshrs_1_fast 5 | __llshrs_1_fast: 6 | push hl 7 | push de 8 | ld hl, 2 9 | add hl, sp 10 | sra b 11 | rr c 12 | rr (hl) 13 | pop de 14 | inc hl 15 | inc hl 16 | inc hl 17 | rr d 18 | rr e 19 | rr (hl) 20 | pop hl 21 | rr h 22 | rr l 23 | ret 24 | -------------------------------------------------------------------------------- /src/crt/llshru_1_fast.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __llshru_1_fast 5 | __llshru_1_fast: 6 | push hl 7 | push de 8 | ld hl, 2 9 | add hl, sp 10 | srl b 11 | rr c 12 | rr (hl) 13 | pop de 14 | inc hl 15 | inc hl 16 | inc hl 17 | rr d 18 | rr e 19 | rr (hl) 20 | pop hl 21 | rr h 22 | rr l 23 | ret 24 | -------------------------------------------------------------------------------- /src/crt/llshru_fast.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __llshru_fast 5 | __llshru_fast: 6 | ld iy, 0 7 | add iy, sp 8 | 9 | ld a, (iy + 3) 10 | or a, a 11 | ret z 12 | 13 | ld a, c 14 | ld c, b 15 | ld b, (iy + 3) 16 | 17 | push de 18 | push hl 19 | 20 | srl c 21 | jp __llshrs_fast.hijack_llshru 22 | 23 | 24 | extern __llshrs_fast.hijack_llshru 25 | -------------------------------------------------------------------------------- /src/crt/llsub.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __llsub 5 | __llsub: 6 | push iy 7 | ld iy, 0 8 | add iy, sp 9 | push bc 10 | ld bc, (iy + 6) 11 | sbc hl, bc 12 | ex de, hl 13 | ld bc, (iy + 9) 14 | sbc hl, bc 15 | ex de, hl 16 | ex (sp), hl 17 | ld bc, (iy + 12) 18 | sbc hl, bc 19 | ld c, l 20 | ld b, h 21 | pop hl 22 | pop iy 23 | ret 24 | -------------------------------------------------------------------------------- /src/crt/llsub_1.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __llsub_1 5 | __llsub_1: 6 | add hl, de 7 | or a, a 8 | sbc hl, de 9 | dec hl 10 | ret nz 11 | ex de, hl 12 | add hl, de 13 | ex de, hl 14 | ret c 15 | dec bc 16 | ret 17 | -------------------------------------------------------------------------------- /src/crt/llsub_fast.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __llsub_fast 5 | __llsub_fast: 6 | ld iy, 0 7 | add iy, sp 8 | push bc 9 | ld bc, (iy + 3) 10 | sbc hl, bc 11 | ex de, hl 12 | ld bc, (iy + 6) 13 | sbc hl, bc 14 | ex de, hl 15 | pop bc 16 | ld a, c 17 | sbc a, (iy + 9) 18 | ld c, a 19 | ld a, b 20 | sbc a, (iy + 10) 21 | ld b, a 22 | ret 23 | -------------------------------------------------------------------------------- /src/crt/lltod.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public __lltod 6 | 7 | __lltod: 8 | ; i64_ret_f64 9 | push af, iy, bc, de, hl 10 | call ___i64_to_f64 11 | pop af, af, af, iy, af 12 | ret 13 | 14 | extern ___i64_to_f64 15 | -------------------------------------------------------------------------------- /src/crt/lltof.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | float _lltof_c(long long x) 6 | { 7 | uint8_t exponent = x ? __builtin_clrsbll(x) : LLONG_WIDTH - 1; 8 | if (exponent >= LLONG_WIDTH - LONG_WIDTH) { 9 | return (float)((long)x); 10 | } 11 | exponent = LLONG_WIDTH - LONG_WIDTH - exponent; 12 | return ldexpf((float)((long)(x >> exponent)), exponent); 13 | } 14 | -------------------------------------------------------------------------------- /src/crt/lltof.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __lltof 5 | __lltof: 6 | push af, iy, bc, de, hl 7 | call __lltof_c 8 | pop af 9 | ld a, e 10 | pop de 11 | ld e, a 12 | pop bc, iy, af 13 | ret 14 | 15 | extern __lltof_c 16 | -------------------------------------------------------------------------------- /src/crt/lneg.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __lneg 5 | 6 | if PREFER_OS_CRT 7 | 8 | __lneg := 0001D0h 9 | 10 | else 11 | 12 | __lneg: 13 | push af 14 | push de 15 | ex de, hl ; ude=UHL, l=E 16 | xor a, a ; a=0 17 | sbc hl, hl ; uhl=0 18 | sbc hl, de ; uhl=-UHL 19 | pop de ; e=E 20 | sbc a, e 21 | ld e, a ; euhl=-EUHL 22 | pop af 23 | ret 24 | 25 | end if 26 | -------------------------------------------------------------------------------- /src/crt/lneg_fast.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __lneg_fast 5 | __lneg_fast: 6 | ld c, e ; c=E 7 | ex de, hl ; ude=UHL, l=E 8 | xor a, a ; a=0 9 | sbc hl, hl ; uhl=0 10 | sbc hl, de ; uhl=-UHL 11 | sbc a, c 12 | ld e, a ; euhl=-EUHL 13 | ret 14 | -------------------------------------------------------------------------------- /src/crt/lnot_fast.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __lnot_fast 5 | __lnot_fast: 6 | ld a, e ; a=E 7 | add hl, de ; uhl=UHL+x 8 | ex de, hl ; ude=UHL+x, uhl=x 9 | scf 10 | sbc hl, de ; uhl=x-(UHL+x)-1 11 | ; =x-UHL-x-1 12 | ; =-UHL-1 13 | ; =~UHL 14 | cpl ; a=~E 15 | ld e, a ; e=~E 16 | ret 17 | -------------------------------------------------------------------------------- /src/crt/lshrs_1_fast.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __lshru_1_fast 5 | __lshru_1_fast: 6 | push hl 7 | ld hl, 2 8 | add hl, sp 9 | sra e 10 | rr (hl) 11 | pop hl 12 | rr h 13 | rr l 14 | ret 15 | -------------------------------------------------------------------------------- /src/crt/lshru_1_fast.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __lshru_1_fast 5 | __lshru_1_fast: 6 | push hl 7 | ld hl, 2 8 | add hl, sp 9 | srl e 10 | rr (hl) 11 | pop hl 12 | rr h 13 | rr l 14 | ret 15 | -------------------------------------------------------------------------------- /src/crt/lsub.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __lsub 5 | 6 | if PREFER_OS_CRT 7 | 8 | __lsub := 0001F8h 9 | 10 | else 11 | 12 | __lsub: 13 | push af 14 | or a, a 15 | sbc hl, bc 16 | cpl 17 | ccf 18 | adc a, e 19 | ld e, a 20 | pop af 21 | ret 22 | 23 | end if 24 | -------------------------------------------------------------------------------- /src/crt/lsub_1.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __lsub_1 5 | __lsub_1: 6 | add hl, bc 7 | or a, a 8 | sbc hl, bc 9 | dec hl 10 | ret nz 11 | dec e 12 | ret 13 | -------------------------------------------------------------------------------- /src/crt/lsub_fast.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __lsub_fast 5 | __lsub_fast: 6 | or a, a 7 | sbc hl, bc 8 | cpl 9 | ccf 10 | adc a, e 11 | ld e, a 12 | ret 13 | -------------------------------------------------------------------------------- /src/crt/sand.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __sand 5 | 6 | if PREFER_OS_CRT 7 | 8 | __sand := 000200h 9 | 10 | else 11 | 12 | __sand: 13 | push af 14 | ld a, h 15 | and a, b 16 | ld h, a 17 | ld a, l 18 | and a, c 19 | ld l, a 20 | pop af 21 | ret 22 | 23 | end if 24 | -------------------------------------------------------------------------------- /src/crt/sbitrev.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __sbitrev 5 | __sbitrev: 6 | push af 7 | ld a, l ; a=L 8 | push hl 9 | dec sp 10 | pop hl 11 | inc sp ; uhl=HL? 12 | call __internal_bitrev_two_bytes ; a=H', uhl=L?L' 13 | ld h, l 14 | ld l, a ; hl=L'H' 15 | pop af 16 | ret 17 | 18 | extern __internal_bitrev_two_bytes 19 | -------------------------------------------------------------------------------- /src/crt/scmpzero.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __scmpzero 5 | __scmpzero: 6 | add hl, de 7 | or a, a 8 | sbc.s hl, de 9 | ret 10 | -------------------------------------------------------------------------------- /src/crt/sdivs.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __sdivs 5 | 6 | if PREFER_OS_CRT 7 | 8 | __sdivs := 000208h 9 | 10 | else 11 | 12 | __sdivs: 13 | ; I: HL=dividend, BC=divisor 14 | ; O: uhl=HL/BC 15 | 16 | push de 17 | 18 | call __sdvrms_abs 19 | ex de, hl 20 | 21 | pop de 22 | ret p 23 | 24 | jp __ineg 25 | 26 | extern __ineg 27 | extern __sdvrms_abs 28 | 29 | end if 30 | -------------------------------------------------------------------------------- /src/crt/sdivu.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __sdivu 5 | 6 | if PREFER_OS_CRT 7 | 8 | __sdivu := 00020Ch 9 | 10 | else 11 | 12 | __sdivu: 13 | ; I: HL=dividend, BC=divisor 14 | ; O: uhl=HL/BC 15 | 16 | push de 17 | 18 | call __sdvrmu 19 | ex de, hl 20 | 21 | pop de 22 | ret 23 | 24 | extern __sdvrmu 25 | 26 | end if 27 | -------------------------------------------------------------------------------- /src/crt/sdvrmu.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __sdvrmu 5 | 6 | __sdvrmu: 7 | ; I: HL=dividend, BC=divisor 8 | ; O: a=0, ude=HL/BC, uhl=HL%BC 9 | 10 | push hl 11 | dec sp 12 | pop de 13 | inc sp 14 | ld e, 0 15 | 16 | inc bc 17 | dec.s bc 18 | 19 | push af 20 | ld a, 16 21 | 22 | jp __idvrmu.hijack_a_iters_ude_dividend 23 | 24 | extern __idvrmu.hijack_a_iters_ude_dividend 25 | -------------------------------------------------------------------------------- /src/crt/setflag.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public __setflag 6 | 7 | if PREFER_OS_CRT 8 | 9 | __setflag := 000218h 10 | 11 | else 12 | 13 | __setflag: 14 | ret po 15 | push af 16 | ex (sp), hl 17 | ld a, l 18 | xor a, $80 ; invert S flag 19 | ld l, a 20 | ex (sp), hl 21 | pop af 22 | ret 23 | 24 | end if 25 | -------------------------------------------------------------------------------- /src/crt/sneg.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __sneg 5 | 6 | if PREFER_OS_CRT 7 | 8 | __sneg := 00022Ch 9 | 10 | else 11 | 12 | __sneg := __ineg 13 | 14 | extern __ineg 15 | 16 | end if 17 | -------------------------------------------------------------------------------- /src/crt/sneg_fast.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __sneg_fast 5 | __sneg_fast := __ineg_fast 6 | 7 | extern __ineg_fast 8 | -------------------------------------------------------------------------------- /src/crt/snot.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __snot 5 | 6 | if PREFER_OS_CRT 7 | 8 | __snot := 000230h 9 | 10 | else 11 | 12 | __snot := __inot 13 | 14 | extern __inot 15 | 16 | end if 17 | -------------------------------------------------------------------------------- /src/crt/snot_fast.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __snot_fast 5 | __snot_fast := __inot_fast 6 | 7 | extern __inot_fast 8 | -------------------------------------------------------------------------------- /src/crt/sor.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __sor 5 | 6 | if PREFER_OS_CRT 7 | 8 | __sor := 000234h 9 | 10 | else 11 | 12 | __sor: 13 | push af 14 | ld a, h 15 | or a, b 16 | ld h, a 17 | ld a, l 18 | or a, c 19 | ld l, a 20 | pop af 21 | ret 22 | 23 | end if 24 | -------------------------------------------------------------------------------- /src/crt/srems.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __srems 5 | 6 | if PREFER_OS_CRT 7 | 8 | __srems := 000238h 9 | 10 | else 11 | 12 | __srems: 13 | ; I: HL=dividend, BC=divisor 14 | ; O: uhl=HL%BC 15 | 16 | push de 17 | 18 | call __sdvrms_abs 19 | 20 | pop de 21 | ret nc 22 | 23 | jp __ineg 24 | 25 | extern __ineg 26 | extern __sdvrms_abs 27 | 28 | end if 29 | -------------------------------------------------------------------------------- /src/crt/sremu.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __sremu 5 | 6 | if PREFER_OS_CRT 7 | 8 | __sremu := 00023Ch 9 | 10 | else 11 | 12 | __sremu: 13 | ; I: HL=dividend, BC=divisor 14 | ; O: uhl=HL%BC 15 | 16 | push de 17 | 18 | call __sdvrmu 19 | 20 | pop de 21 | ret 22 | 23 | extern __sdvrmu 24 | 25 | end if 26 | -------------------------------------------------------------------------------- /src/crt/sshl.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __sshl 5 | 6 | if PREFER_OS_CRT 7 | 8 | __sshl := 000240h 9 | 10 | else 11 | 12 | __sshl := __ishl 13 | 14 | extern __ishl 15 | 16 | end if 17 | -------------------------------------------------------------------------------- /src/crt/sxor.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __sxor 5 | 6 | if PREFER_OS_CRT 7 | 8 | __sxor := 000268h 9 | 10 | else 11 | 12 | __sxor: 13 | push af 14 | ld a, h 15 | xor a, b 16 | ld h, a 17 | ld a, l 18 | xor a, c 19 | ld l, a 20 | pop af 21 | ret 22 | 23 | end if 24 | -------------------------------------------------------------------------------- /src/crt/ulltod.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public __ulltod 6 | 7 | __ulltod: 8 | ; u64_ret_f64 9 | push af, iy, bc, de, hl 10 | call ___ui64_to_f64 11 | pop af, af, af, iy, af 12 | ret 13 | 14 | extern ___ui64_to_f64 15 | -------------------------------------------------------------------------------- /src/crt/ulltof.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public __ulltof 5 | __ulltof: 6 | push af, iy, bc, de, hl 7 | call __ulltof_c 8 | pop af 9 | ld a, e 10 | pop de 11 | ld e, a 12 | pop bc, iy, af 13 | ret 14 | 15 | extern __ulltof_c 16 | -------------------------------------------------------------------------------- /src/graphx/fillscreen.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/src/graphx/fillscreen.xlsx -------------------------------------------------------------------------------- /src/libc/abs.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _abs 5 | _abs: 6 | pop hl 7 | pop de 8 | push de 9 | push hl 10 | or a,a 11 | sbc hl,hl 12 | sbc hl,de 13 | ret p 14 | ex de,hl 15 | ret 16 | -------------------------------------------------------------------------------- /src/libc/acoshl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "__float64_constants.h" 3 | 4 | /** 5 | * @remarks Minimum relative precision of: 6 | * 2^-42.37 at +1.000000358e+00 with ideal log1pl 7 | */ 8 | long double acoshl(long double x) { 9 | if (x < 0x1.0p+511L) { 10 | long double t = x - 1.0L; 11 | return log1pl(t + sqrtl(2.0L * t + t * t)); 12 | } 13 | return logl(x) + F64_LN2; 14 | } 15 | -------------------------------------------------------------------------------- /src/libc/asinf.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _asinf 5 | public _asin 6 | 7 | if PREFER_OS_LIBC 8 | 9 | _asinf := 022104h 10 | _asin := _asinf 11 | 12 | else 13 | 14 | _asinf := __asinf_c 15 | _asin := __asin_c 16 | 17 | extern __asinf_c 18 | extern __asin_c 19 | 20 | end if 21 | -------------------------------------------------------------------------------- /src/libc/asprintf.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public _asprintf 6 | public _vasprintf 7 | 8 | if HAS_PRINTF 9 | 10 | _asprintf := __asprintf_c 11 | _vasprintf := __vasprintf_c 12 | 13 | extern __asprintf_c 14 | extern __vasprintf_c 15 | 16 | else 17 | 18 | _asprintf := _boot_asprintf 19 | _vasprintf := _boot_vasprintf 20 | 21 | extern _boot_asprintf 22 | extern _boot_vasprintf 23 | 24 | end if 25 | -------------------------------------------------------------------------------- /src/libc/assert.c: -------------------------------------------------------------------------------- 1 | #undef NDEBUG 2 | #include 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | void __assert_fail_loc(const struct __assert_loc *loc) { 9 | dbg_sprintf(dbgerr, "assert: %s:%" PRIu32 ": %s: Assertion `%s' failed.\n", 10 | loc->__file, loc->__line, loc->__function, loc->__assertion); 11 | abort(); 12 | } 13 | -------------------------------------------------------------------------------- /src/libc/atan2f.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _atan2f 5 | public _atan2 6 | 7 | if PREFER_OS_LIBC 8 | 9 | _atan2f := 02210Ch 10 | _atan2 := _atan2f 11 | 12 | else 13 | 14 | _atan2f := __atan2f_c 15 | _atan2 := __atan2_c 16 | 17 | extern __atan2f_c 18 | extern __atan2_c 19 | 20 | end if 21 | -------------------------------------------------------------------------------- /src/libc/atanf.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _atanf 5 | public _atan 6 | 7 | if PREFER_OS_LIBC 8 | 9 | _atanf := 022108h 10 | _atan := _atanf 11 | 12 | else 13 | 14 | _atanf := __atanf_c 15 | _atan := __atan_c 16 | 17 | extern __atanf_c 18 | extern __atan_c 19 | 20 | end if 21 | -------------------------------------------------------------------------------- /src/libc/atof.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _atof, _atoff 5 | 6 | if PREFER_OS_LIBC 7 | 8 | _atoff := 022110h 9 | _atof := _atoff 10 | 11 | else 12 | 13 | _atof: 14 | _atoff: 15 | pop hl 16 | pop bc 17 | push bc 18 | push hl 19 | or a,a 20 | sbc hl,hl 21 | push hl 22 | push bc 23 | call _strtod 24 | pop bc 25 | pop hl 26 | ret 27 | 28 | extern __frameset0 29 | extern _strtod 30 | 31 | end if 32 | -------------------------------------------------------------------------------- /src/libc/atol.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _atoi, _atol 5 | _atoi: 6 | _atol: 7 | pop bc 8 | ex (sp),hl 9 | push bc 10 | ld bc,10 11 | push bc 12 | ld c,b 13 | push bc 14 | push hl 15 | call _strtol 16 | pop af 17 | pop af 18 | pop af 19 | ret 20 | 21 | extern _strtol 22 | -------------------------------------------------------------------------------- /src/libc/atoll.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _atoll 5 | _atoll: 6 | pop bc 7 | ex (sp),hl 8 | push bc 9 | ld bc,10 10 | push bc 11 | ld c,b 12 | push bc 13 | push hl 14 | call _strtoll 15 | pop af 16 | pop af 17 | pop af 18 | ret 19 | 20 | extern _strtoll 21 | -------------------------------------------------------------------------------- /src/libc/bzero.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public _bzero 6 | 7 | ; void bzero(void* buf, size_t n) 8 | _bzero: 9 | ld hl, 6 10 | add hl, sp 11 | ld bc, (hl) ; size 12 | inc bc 13 | cpd ; dec hl 14 | ret po ; zero size 15 | dec hl 16 | dec hl 17 | ld de, (hl) ; buf 18 | ld hl, $E40000 ; large region of all zeros on the Ti84CE 19 | ldir 20 | ret 21 | -------------------------------------------------------------------------------- /src/libc/cbrtl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /** 4 | * @remarks Minimum ulp: 5 | * ulp of -257 at +0x1.ffe3f201d9f88p-808 assuming ideal logl expl 6 | */ 7 | long double cbrtl(long double x) 8 | { 9 | if (x == 0.0L) { 10 | return x; 11 | } 12 | return copysignl(expl(logl(fabsl(x)) / 3.0L), x); 13 | } 14 | -------------------------------------------------------------------------------- /src/libc/ceill.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long double ceill(long double x) { 4 | if (signbit(x)) { 5 | return truncl(x); 6 | } 7 | if (!isfinite(x)) { 8 | return x; 9 | } 10 | long double frac = modfl(x, &x); 11 | if (!iszero(frac)) { 12 | x += 1.0L; 13 | } 14 | return x; 15 | } 16 | -------------------------------------------------------------------------------- /src/libc/cimagf.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public _cimagf, _cimag 6 | 7 | ; float cimagf(float _Complex) 8 | _cimagf: 9 | _cimag: 10 | ld iy, 0 11 | add iy, sp 12 | ld sp, iy 13 | ld hl, (iy + 7) 14 | ld e, (iy + 10) 15 | ret 16 | -------------------------------------------------------------------------------- /src/libc/cimagl.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public _cimagl 6 | 7 | ; long double cimagl(long double _Complex) 8 | _cimagl: 9 | ld iy, 0 10 | add iy, sp 11 | ld sp, iy 12 | ld hl, (iy + 11) 13 | ld de, (iy + 14) 14 | ld bc, (iy + 17) 15 | ret 16 | -------------------------------------------------------------------------------- /src/libc/cmplxl.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public _CMPLXL 6 | 7 | ; long double _Complex CMPLXL(long double x, long double y) /* struct ABI */ 8 | _CMPLXL: 9 | pop iy, de 10 | or a, a 11 | sbc hl, hl 12 | add hl, sp 13 | push de ; ZDS II sret 14 | ld bc, 8 ; sizeof(long double _Complex) 15 | ldir 16 | ; skip over the padding 17 | inc hl 18 | ld c, 8 19 | ldir 20 | ex (sp), hl ; ZDS II sret 21 | jp (iy) 22 | -------------------------------------------------------------------------------- /src/libc/copysignf.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _copysign, _copysignf 5 | 6 | _copysign: 7 | _copysignf: 8 | pop bc 9 | pop de 10 | pop hl 11 | ld a,l 12 | inc sp 13 | ex (sp),hl 14 | dec sp 15 | push hl 16 | push de 17 | push bc 18 | add hl,hl 19 | rla 20 | rrca 21 | ld l,a 22 | ex de,hl 23 | ret 24 | -------------------------------------------------------------------------------- /src/libc/copysignl.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public _copysignl 6 | _copysignl: 7 | ld hl, 19 ; upper 8 bits of y 8 | add hl, sp 9 | rl (hl) ; extract the signbit of y 10 | pop iy, hl, de, bc 11 | push bc, de, hl 12 | rl b ; clear the signbit of x, signbit of y is in the LSB 13 | rrc b ; rotate the LSB into the MSB to copy the signbit of y 14 | jp (iy) 15 | -------------------------------------------------------------------------------- /src/libc/coshf.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _coshf 5 | public _cosh 6 | 7 | if PREFER_OS_LIBC 8 | 9 | _coshf := 022134h 10 | _cosh := _coshf 11 | 12 | else 13 | 14 | _coshf := __coshf_c 15 | _cosh := __cosh_c 16 | 17 | extern __coshf_c 18 | extern __cosh_c 19 | 20 | end if 21 | -------------------------------------------------------------------------------- /src/libc/crealf.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public _crealf, _creal 6 | 7 | ; float crealf(float _Complex) 8 | _crealf: 9 | _creal: 10 | pop bc, hl, de 11 | push de, hl, bc 12 | ret 13 | -------------------------------------------------------------------------------- /src/libc/creall.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public _creall 6 | 7 | ; long double creall(long double _Complex) 8 | _creall: 9 | pop iy, hl, de, bc 10 | push bc, de, hl 11 | jp (iy) 12 | -------------------------------------------------------------------------------- /src/libc/ctime.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | char *ctime(const time_t *timer) 6 | { 7 | return asctime(localtime(timer)); 8 | } 9 | -------------------------------------------------------------------------------- /src/libc/difftime.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double difftime(time_t end, time_t beginning) 4 | { 5 | /* assuming typedef unsigned long time_t */ 6 | return (double)((signed long)(end - beginning)); 7 | } 8 | -------------------------------------------------------------------------------- /src/libc/div.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _div 5 | _div: 6 | pop de 7 | pop iy 8 | pop hl 9 | pop bc 10 | push de 11 | push de 12 | push de 13 | push de 14 | 15 | call __idvrms 16 | ld (iy), hl 17 | ld (iy + 3), de 18 | 19 | ret 20 | 21 | extern __idvrms 22 | -------------------------------------------------------------------------------- /src/libc/exp2f.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float exp2f(float x) 4 | { 5 | // this can be made much more accurately using frexp and ldexp 6 | return expf(x * (float)M_LN2); 7 | } 8 | 9 | double exp2(double) __attribute__((alias("exp2f"))); 10 | -------------------------------------------------------------------------------- /src/libc/exp2l.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "__float64_constants.h" 3 | 4 | long double exp2l(long double x) 5 | { 6 | // this can be made much more accurately using frexp and ldexp 7 | return expl(x * F64_LN2); 8 | } 9 | -------------------------------------------------------------------------------- /src/libc/expf.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _expf 5 | public _exp 6 | 7 | if PREFER_OS_LIBC 8 | 9 | _expf := 022124h 10 | _exp := _expf 11 | 12 | else 13 | 14 | _expf := __expf_c 15 | _exp := __exp_c 16 | 17 | extern __expf_c 18 | extern __exp_c 19 | 20 | end if 21 | -------------------------------------------------------------------------------- /src/libc/expm1l.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "__float64_constants.h" 3 | 4 | /** 5 | * @remarks Approximate minimum ulp: 6 | * ulp of -4098 at +0x1.3683c27b9c856p-13 with ideal expl 7 | */ 8 | long double expm1l(long double x) { 9 | if (fabsl(x) < 0x1.0p-13L) { 10 | long double x_sqr = x * x; 11 | return (x_sqr * x) * F64_1_DIV_3 + 0.5L * (x_sqr) + x; 12 | } 13 | return expl(x) - 1.0L; 14 | } 15 | -------------------------------------------------------------------------------- /src/libc/fabsf.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _fabsf, _fabs 5 | 6 | if PREFER_OS_LIBC 7 | 8 | _fabsf := 0220F0h 9 | _fabs := _fabsf 10 | 11 | else 12 | 13 | _fabs: 14 | _fabsf: 15 | pop bc, hl ,de 16 | push de, hl, bc 17 | res 7, e 18 | ret 19 | 20 | end if 21 | -------------------------------------------------------------------------------- /src/libc/fabsl.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public _fabsl 6 | 7 | _fabsl: 8 | pop iy, hl ,de, bc 9 | push bc, de, hl 10 | res 7, b 11 | jp (iy) 12 | -------------------------------------------------------------------------------- /src/libc/feof.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int __attribute__((weak)) feof(FILE *stream) 5 | { 6 | return stream->eof; 7 | } 8 | -------------------------------------------------------------------------------- /src/libc/ferror.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int __attribute__((weak)) ferror(FILE *stream) 5 | { 6 | return stream->err; 7 | } 8 | -------------------------------------------------------------------------------- /src/libc/fflush.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int __attribute__((weak)) fflush(FILE *stream) 5 | { 6 | (void)stream; 7 | 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /src/libc/files.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | FILE _file_streams[FOPEN_MAX]; 4 | -------------------------------------------------------------------------------- /src/libc/floorf.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _floorf 5 | public _floor 6 | 7 | if PREFER_OS_LIBC 8 | 9 | _floorf := 0220F4h 10 | _floor := _floorf 11 | 12 | else 13 | 14 | _floorf := __floorf_c 15 | _floor := __floor_c 16 | 17 | extern __floorf_c 18 | extern __floor_c 19 | 20 | end if 21 | -------------------------------------------------------------------------------- /src/libc/floorl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long double floorl(long double x) { 4 | if (!signbit(x)) { 5 | return truncl(x); 6 | } 7 | if (!isfinite(x)) { 8 | return x; 9 | } 10 | long double frac = modfl(x, &x); 11 | if (!iszero(frac)) { 12 | x -= 1.0L; 13 | } 14 | return x; 15 | } 16 | -------------------------------------------------------------------------------- /src/libc/fmaf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float fmaf(float x, float y, float z) 4 | { 5 | return x * y + z; // FIXME: accuracy 6 | } 7 | 8 | double fma(double, double, double) __attribute__((alias("fmaf"))); 9 | -------------------------------------------------------------------------------- /src/libc/fmal.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public _fmal 6 | 7 | _fmal: 8 | ; flags handled by softfloat 9 | ld iy, 0 10 | add iy, sp 11 | ld a, (iy + 28) 12 | rlca 13 | ld (iy + 11), a ; signC 14 | ld a, (iy + 10) 15 | xor a, (iy + 19) 16 | rlca 17 | ld (iy + 20), a ; signZ 18 | jq _softfloat_mulAddF64 19 | 20 | extern _softfloat_mulAddF64 21 | -------------------------------------------------------------------------------- /src/libc/fmodf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float _fmodf_c(float x, float y) 4 | { 5 | return x - truncf(x / y) * y; 6 | } 7 | 8 | double _fmod_c(double, double) __attribute__((alias("_fmodf_c"))); 9 | -------------------------------------------------------------------------------- /src/libc/fmodf.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _fmodf 5 | public _fmod 6 | 7 | if PREFER_OS_LIBC 8 | 9 | _fmodf := 0220FCh 10 | _fmod := _fmodf 11 | 12 | else 13 | 14 | _fmodf := __fmodf_c 15 | _fmod := __fmod_c 16 | 17 | extern __fmodf_c 18 | extern __fmod_c 19 | 20 | end if 21 | -------------------------------------------------------------------------------- /src/libc/fprintf.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | if HAS_PRINTF 6 | 7 | public _fprintf 8 | public _vfprintf 9 | 10 | _fprintf := __fprintf_c 11 | _vfprintf := __vfprintf_c 12 | 13 | extern __fprintf_c 14 | extern __vfprintf_c 15 | 16 | end if 17 | -------------------------------------------------------------------------------- /src/libc/fputs.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int __attribute__((weak)) fputs(const char *__restrict str, FILE *__restrict stream) 5 | { 6 | unsigned int i = 0; 7 | char c; 8 | 9 | while ((c = str[i])) 10 | { 11 | if (fputc(c, stream) == EOF) 12 | { 13 | return EOF; 14 | } 15 | i++; 16 | } 17 | 18 | return 1; 19 | } 20 | -------------------------------------------------------------------------------- /src/libc/fseek.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int __attribute__((weak)) fseek(FILE *stream, long int offset, int origin) 5 | { 6 | if (stream == NULL || 7 | stream == stdin || 8 | stream == stdout || 9 | stream == stderr) 10 | { 11 | return -1; 12 | } 13 | 14 | return ti_Seek((int)offset, origin, stream->slot); 15 | } 16 | -------------------------------------------------------------------------------- /src/libc/ftell.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | long int __attribute__((weak)) ftell(FILE *stream) 5 | { 6 | if (stream == NULL || 7 | stream == stdin || 8 | stream == stdout || 9 | stream == stderr) 10 | { 11 | return -1L; 12 | } 13 | 14 | return (long int)ti_Tell(stream->slot); 15 | } 16 | -------------------------------------------------------------------------------- /src/libc/getchar.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _getchar 5 | _getchar := _inchar 6 | extern _inchar 7 | -------------------------------------------------------------------------------- /src/libc/include/alloca.h: -------------------------------------------------------------------------------- 1 | #ifndef _ALLOCA_H 2 | #define _ALLOCA_H 3 | 4 | #include 5 | 6 | __BEGIN_DECLS 7 | 8 | void *alloca(size_t __size) __NOEXCEPT; 9 | #define alloca(size) __builtin_alloca(size) 10 | 11 | __END_DECLS 12 | 13 | #endif /* _ALLOCA_H */ 14 | -------------------------------------------------------------------------------- /src/libc/include/errno.h: -------------------------------------------------------------------------------- 1 | #ifndef _ERRNO_H 2 | #define _ERRNO_H 3 | 4 | #define EPERM 1 /* permission error */ 5 | #define EINVAL 2 /* invalid argument */ 6 | #define EIO 3 /* io error */ 7 | #define EDOM 4 /* math domain error */ 8 | #define ERANGE 5 /* math range error */ 9 | 10 | extern int errno; 11 | 12 | #endif /* _ERRNO_H */ 13 | -------------------------------------------------------------------------------- /src/libc/include/iso646.h: -------------------------------------------------------------------------------- 1 | #ifndef _ISO646_H 2 | #define _ISO646_H 3 | 4 | #ifndef __cplusplus 5 | #define and && 6 | #define and_eq &= 7 | #define bitand & 8 | #define bitor | 9 | #define compl ~ 10 | #define not ! 11 | #define not_eq != 12 | #define or || 13 | #define or_eq |= 14 | #define xor ^ 15 | #define xor_eq ^= 16 | #endif 17 | 18 | #endif /* _ISO646_H */ 19 | -------------------------------------------------------------------------------- /src/libc/include/setjmp.h: -------------------------------------------------------------------------------- 1 | #ifndef _SETJMP_H 2 | #define _SETJMP_H 3 | 4 | #include 5 | 6 | __BEGIN_DECLS 7 | 8 | typedef unsigned char jmp_buf[12]; 9 | 10 | int setjmp(jmp_buf env) __attribute__((returns_twice)); 11 | void longjmp(jmp_buf env, int val) __attribute__((noreturn)); 12 | 13 | __END_DECLS 14 | 15 | #endif /* _SETJMP_H */ 16 | -------------------------------------------------------------------------------- /src/libc/include/stdalign.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDALIGN_H 2 | #define _STDALIGN_H 3 | 4 | #ifndef __cplusplus 5 | 6 | #define alignas _Alignas 7 | #define alignof _Alignof 8 | 9 | #define __alignas_is_defined 1 10 | #define __alignof_is_defined 1 11 | 12 | #endif /* __cplusplus */ 13 | 14 | #endif /* _STDALIGN_H */ 15 | -------------------------------------------------------------------------------- /src/libc/include/stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDBOOL_H 2 | #define _STDBOOL_H 3 | 4 | #ifndef __cplusplus 5 | 6 | #define bool _Bool 7 | #define false 0 8 | #define true 1 9 | 10 | #else /* __cplusplus */ 11 | 12 | #define _Bool bool 13 | 14 | #endif /* __cplusplus */ 15 | 16 | #define __bool_true_false_are_defined 1 17 | 18 | #endif /* _STDBOOL_H */ 19 | -------------------------------------------------------------------------------- /src/libc/include/stdckdint.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDCKDINT_H 2 | #define _STDCKDINT_H 3 | 4 | #define __STDC_VERSION_STDCKDINT_H__ 202311L 5 | 6 | #define ckd_add(R, A, B) __builtin_add_overflow((A), (B), (R)) 7 | #define ckd_sub(R, A, B) __builtin_sub_overflow((A), (B), (R)) 8 | #define ckd_mul(R, A, B) __builtin_mul_overflow((A), (B), (R)) 9 | 10 | #endif /* _STDCKDINT_H */ 11 | -------------------------------------------------------------------------------- /src/libc/include/stdnoreturn.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDNORETURN_H 2 | #define _STDNORETURN_H 3 | 4 | #ifndef __cplusplus 5 | 6 | #define noreturn _Noreturn 7 | 8 | #endif /* __cplusplus */ 9 | 10 | #endif /* _STDNORETURN_H */ 11 | -------------------------------------------------------------------------------- /src/libc/isalnum.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _isalnum 5 | _isalnum: 6 | pop de 7 | ex (sp),hl 8 | push de 9 | ld a,l 10 | sub a,48 11 | add a,-10 12 | sbc hl,hl 13 | inc hl 14 | ret z 15 | sub a,65-(48+10) 16 | res 5,a 17 | cp a,26 18 | adc hl,hl 19 | ret 20 | -------------------------------------------------------------------------------- /src/libc/isalpha.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _isalpha 5 | _isalpha: 6 | pop de 7 | ex (sp),hl 8 | push de 9 | ld a,l 10 | sub a,65 11 | res 5,a 12 | add a,-26 13 | sbc hl,hl 14 | inc hl 15 | ret 16 | -------------------------------------------------------------------------------- /src/libc/isascii.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _isascii 5 | _isascii: 6 | pop de 7 | ex (sp),hl 8 | push de 9 | sla l 10 | sbc hl,hl 11 | inc hl 12 | ret 13 | -------------------------------------------------------------------------------- /src/libc/isblank.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _isblank 5 | _isblank: 6 | pop de 7 | ex (sp),hl 8 | push de 9 | ld a,l 10 | cp a,32 11 | ret z 12 | xor a,9 13 | ret z 14 | sbc hl,hl 15 | ret 16 | -------------------------------------------------------------------------------- /src/libc/iscntrl.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _iscntrl 5 | _iscntrl: 6 | pop de 7 | ex (sp),hl 8 | push de 9 | ld a,l 10 | cp a,127 11 | ret z 12 | add a,-32 13 | sbc hl,hl 14 | inc hl 15 | ret 16 | -------------------------------------------------------------------------------- /src/libc/isdigit.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _isdigit 5 | _isdigit: 6 | pop de 7 | ex (sp),hl 8 | push de 9 | ld a,l 10 | sub a,48 11 | sub a,10 12 | sbc hl,hl 13 | ret 14 | -------------------------------------------------------------------------------- /src/libc/isfinitef.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public __isfinitef 6 | 7 | ; bool _isfinitef(float) 8 | __isfinitef: 9 | ld hl, 5 10 | add hl, sp 11 | ld hl, (hl) 12 | add hl, hl 13 | ld a, h 14 | sub a, $FF ; NaN/inf exponent won't underflow 15 | sbc a, a 16 | ret 17 | 18 | -------------------------------------------------------------------------------- /src/libc/isfinitel.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public __isfinitel 6 | 7 | ; bool _isfinitel(long double) 8 | __isfinitel: 9 | ld hl, 8 10 | add hl, sp 11 | ld hl, (hl) ; load the upper 24bits 12 | add hl, hl ; clears signbit 13 | ld de, $2000 ; (1 << (5 + 8)) 14 | add hl, de ; attempts to overflow the exponent 15 | sbc a, a 16 | inc a 17 | ret 18 | -------------------------------------------------------------------------------- /src/libc/isgraph.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _isgraph 5 | _isgraph: 6 | pop de 7 | ex (sp),hl 8 | push de 9 | ld a,l 10 | sub a,33 11 | sub a,94 12 | sbc hl,hl 13 | ret 14 | -------------------------------------------------------------------------------- /src/libc/isinff.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public __isinff 6 | 7 | ; bool _isinff(float) 8 | __isinff: 9 | xor a, a 10 | ld iy, 0 11 | add iy, sp 12 | ld hl, (iy+3) 13 | adc hl, hl 14 | ret nz ; finite or NaN 15 | ; HL is zero 16 | ld a, (iy+6) 17 | rla 18 | add a, 1 ; attempt to overflow the exponent 19 | sbc a, a 20 | ret 21 | -------------------------------------------------------------------------------- /src/libc/islower.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _islower 5 | _islower: 6 | pop de 7 | ex (sp),hl 8 | push de 9 | ld a,l 10 | sub a,97 11 | sub a,26 12 | sbc hl,hl 13 | ret 14 | -------------------------------------------------------------------------------- /src/libc/isnanf.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public __isnanf 6 | 7 | ; bool _isnanf(float) 8 | __isnanf: 9 | xor a, a 10 | ld iy, 0 11 | add iy, sp 12 | ld hl, (iy+3) 13 | adc hl, hl 14 | ret z ; infinity 15 | ld a, (iy+6) 16 | rla 17 | add a, 1 ; attempt to overflow the exponent 18 | sbc a, a 19 | ret 20 | -------------------------------------------------------------------------------- /src/libc/isnormalf.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public __isnormalf 6 | 7 | ; bool _isnormalf(float) 8 | __isnormalf: 9 | ld hl, 5 10 | add hl, sp 11 | ld hl, (hl) ; load the upper 16 bits 12 | add hl, hl ; clears signbit 13 | ld a, h 14 | dec a 15 | cp a, $FE ; tests for zero/denormal/inf/NaN exponents 16 | sbc a, a ; -1 if normal, 0 otherwise 17 | ret 18 | -------------------------------------------------------------------------------- /src/libc/isprint.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _isprint 5 | _isprint: 6 | pop de 7 | ex (sp),hl 8 | push de 9 | ld a,l 10 | sub a,32 11 | add a,-95 12 | sbc hl,hl 13 | inc hl 14 | ret 15 | -------------------------------------------------------------------------------- /src/libc/ispunct.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _ispunct 5 | _ispunct: 6 | pop de 7 | ex (sp),hl 8 | push de 9 | ld a,l 10 | sub a,33 11 | cp a,48-33 12 | ret c 13 | sub a,58-33 14 | cp a,65-58 15 | ret c 16 | sub a,91-58 17 | cp a,97-91 18 | ret c 19 | sub a,123-91 20 | cp a,127-123 21 | ret c 22 | sbc hl,hl 23 | ret -------------------------------------------------------------------------------- /src/libc/issignalingl.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public __issignalingl 6 | 7 | ; assumes quiet NaN is NaN with bit 51 set 8 | ; bool _issignalingl(long double) 9 | __issignalingl: 10 | ld hl, 9 11 | add hl, sp 12 | bit 3, (hl) ; 51 % 8 == 3 13 | jp z, __isnanl 14 | xor a, a ; quiet bit set, return false 15 | ret 16 | 17 | extern __isnanl 18 | -------------------------------------------------------------------------------- /src/libc/isspace.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _isspace 5 | _isspace: 6 | pop de 7 | ex (sp),hl 8 | push de 9 | ld a,l 10 | cp a,32 11 | ret z 12 | sub a,9 13 | add a,-5 14 | sbc hl,hl 15 | inc hl 16 | ret 17 | -------------------------------------------------------------------------------- /src/libc/issubnormalf.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public __issubnormalf 6 | 7 | ; bool _issubnormalf(float) 8 | __issubnormalf: 9 | xor a, a 10 | pop bc, hl 11 | adc hl, hl 12 | ex (sp), hl 13 | push hl, bc 14 | ret z ; zero mantissa is not subnormal 15 | adc hl, hl 16 | sub a, l 17 | sbc a, a 18 | inc a 19 | ret 20 | -------------------------------------------------------------------------------- /src/libc/isupper.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _isupper 5 | _isupper: 6 | pop de 7 | ex (sp),hl 8 | push de 9 | ld a,l 10 | sub a,65 11 | sub a,26 12 | sbc hl,hl 13 | ret 14 | -------------------------------------------------------------------------------- /src/libc/isxdigit.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _isxdigit 5 | _isxdigit: 6 | pop de 7 | ex (sp),hl 8 | push de 9 | ld a,l 10 | sub a,48 11 | add a,-10 12 | sbc hl,hl 13 | inc hl 14 | ret z 15 | sub a,65-(48+10) 16 | res 5,a 17 | cp a,6 18 | adc hl,hl 19 | ret 20 | -------------------------------------------------------------------------------- /src/libc/iszerof.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public __iszerof 6 | 7 | ; bool _iszerof(float) 8 | __iszerof: 9 | xor a, a 10 | pop bc, hl 11 | adc hl, hl 12 | ex (sp), hl 13 | push hl, bc 14 | ret nz ; non-zero mantissa 15 | ld a, l 16 | adc a, a 17 | sub a, 1 18 | sbc a, a 19 | ret 20 | -------------------------------------------------------------------------------- /src/libc/iszerol.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public __iszerol 6 | 7 | ; bool iszerol(long double) 8 | __iszerol: 9 | pop bc, hl, de 10 | xor a, a 11 | adc hl, de 12 | pop de 13 | push bc, bc, bc, bc 14 | ; return if mantissa is non-zero 15 | ret nz ; mant_nonzero 16 | ret c ; mant_carry 17 | ld a, d 18 | rla ; clear the signbit 19 | or a, e 20 | sub a, 1 21 | sbc a, a 22 | ret 23 | -------------------------------------------------------------------------------- /src/libc/llrintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llrintf(float x) 4 | { 5 | return rintf(x); 6 | } 7 | 8 | long long llrint(double) __attribute__((alias("llrintf"))); 9 | -------------------------------------------------------------------------------- /src/libc/llroundf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llroundf(float x) 4 | { 5 | return roundf(x); 6 | } 7 | 8 | long long llround(double) __attribute__((alias("llroundf"))); 9 | -------------------------------------------------------------------------------- /src/libc/localtime.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #define SECS_PER_MIN 60UL 7 | 8 | struct tm *localtime(const time_t *timer) 9 | { 10 | time_t timer2 = *timer; 11 | timer2 -= LOCALTIME_GMT_OFFSET * SECS_PER_MIN; 12 | 13 | return gmtime(&timer2); 14 | } 15 | -------------------------------------------------------------------------------- /src/libc/log10f.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float _log10f_c(float x) 4 | { 5 | return logf(x) * (float)(M_LOG10E); 6 | } 7 | 8 | double _log10_c(double) __attribute__((alias("_log10f_c"))); 9 | -------------------------------------------------------------------------------- /src/libc/log10f.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _log10f 5 | public _log10 6 | 7 | if PREFER_OS_LIBC 8 | 9 | _log10f := 0220E8h 10 | _log10 := _log10f 11 | 12 | else 13 | 14 | _log10f := __log10f_c 15 | _log10 := __log10_c 16 | 17 | extern __log10f_c 18 | extern __log10_c 19 | 20 | end if 21 | -------------------------------------------------------------------------------- /src/libc/log10l.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "__float64_constants.h" 3 | 4 | long double log10l(long double x) 5 | { 6 | return logl(x) * F64_LOG10E; 7 | } 8 | -------------------------------------------------------------------------------- /src/libc/log1pl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "__float64_constants.h" 3 | 4 | /** 5 | * @remarks Approximate minimum ulp: 6 | * ulp of +4097 at +0x1.0003239899b0ap-13 with ideal expl 7 | */ 8 | long double log1pl(long double x) { 9 | if (fabsl(x) < 0x1.2p-13L) { 10 | long double x_sqr = x * x; 11 | return (x_sqr * x) * F64_1_DIV_3 - 0.5L * (x_sqr) + x; 12 | } 13 | return logl(1.0L + x); 14 | } 15 | -------------------------------------------------------------------------------- /src/libc/log2f.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float log2f(float x) 4 | { 5 | // this can be made much more accurately using frexp and ldexp 6 | return logf(x) * (float)(M_LOG2E); 7 | } 8 | 9 | double log2(double) __attribute__((alias("log2f"))); 10 | -------------------------------------------------------------------------------- /src/libc/log2l.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "__float64_constants.h" 3 | 4 | long double log2l(long double x) 5 | { 6 | // this can be made much more accurately using frexp and ldexp 7 | return logl(x) * F64_LOG2E; 8 | } 9 | -------------------------------------------------------------------------------- /src/libc/logf.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _logf 5 | public _log 6 | 7 | if PREFER_OS_LIBC 8 | 9 | _logf := 0220E4h 10 | _log := _logf 11 | 12 | else 13 | 14 | _logf := __logf_c 15 | _log := __log_c 16 | 17 | extern __logf_c 18 | extern __log_c 19 | 20 | end if 21 | -------------------------------------------------------------------------------- /src/libc/lrintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lrintf(float x) 4 | { 5 | return rintf(x); 6 | } 7 | 8 | long lrint(double) __attribute__((alias("lrintf"))); 9 | -------------------------------------------------------------------------------- /src/libc/lroundf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lroundf(float x) 4 | { 5 | return roundf(x); 6 | } 7 | 8 | long lround(double) __attribute__((alias("lroundf"))); 9 | -------------------------------------------------------------------------------- /src/libc/memrchr.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public _memrchr 6 | 7 | _memrchr: 8 | ld iy, 0 9 | add iy, sp 10 | ld hl, (iy + 3) 11 | ld bc, (iy + 9) 12 | dec bc 13 | add hl, bc 14 | jr c, .ret_zero 15 | inc bc 16 | ld a, (iy + 6) 17 | cpdr 18 | inc hl 19 | ret z ; found match 20 | .ret_zero: 21 | ; return NULL 22 | or a, a 23 | sbc hl, hl 24 | ret 25 | -------------------------------------------------------------------------------- /src/libc/memset.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public _memset 6 | 7 | _memset: 8 | ld iy, 0 9 | add iy, sp 10 | ld hl, (iy + 3) 11 | ld bc, (iy + 9) 12 | cpi 13 | add hl, bc 14 | ret c 15 | dec hl 16 | ld e, (iy + 6) 17 | ld (hl), e 18 | ret po 19 | push hl 20 | pop de 21 | dec de 22 | lddr 23 | ret 24 | -------------------------------------------------------------------------------- /src/libc/outchar.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | weak _outchar 5 | _outchar: 6 | pop de 7 | ex (sp),hl 8 | push de 9 | ld iy,$d00080 ; ti.flags 10 | ld a,l 11 | cp a,32 12 | jp nc,$207B8 ; ti.PutC 13 | cp a,10 14 | jp z,$0207F0 ; ti.NewLine 15 | ret 16 | -------------------------------------------------------------------------------- /src/libc/powf.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _powf 5 | public _pow 6 | 7 | if PREFER_OS_LIBC 8 | 9 | _powf := 0220F8h 10 | _pow := _powf 11 | 12 | else 13 | 14 | _powf := __powf_c 15 | _pow := __pow_c 16 | 17 | extern __powf_c 18 | extern __pow_c 19 | 20 | end if 21 | -------------------------------------------------------------------------------- /src/libc/printf.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | if HAS_PRINTF 6 | 7 | public _printf 8 | public _vprintf 9 | 10 | _printf := __printf_c 11 | _vprintf := __vprintf_c 12 | 13 | extern __printf_c 14 | extern __vprintf_c 15 | 16 | end if 17 | -------------------------------------------------------------------------------- /src/libc/putchar.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _putchar 5 | _putchar: 6 | pop de 7 | ex (sp),hl 8 | push de 9 | push hl 10 | push hl 11 | call _outchar 12 | pop hl 13 | pop hl 14 | ret 15 | 16 | extern _outchar 17 | -------------------------------------------------------------------------------- /src/libc/puts.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _puts 5 | _puts: 6 | pop de 7 | ex (sp),hl 8 | push de 9 | .loop: 10 | ld a,(hl) 11 | or a,a 12 | jr z,.newline 13 | ld e,a 14 | push hl 15 | push de 16 | call _outchar 17 | pop de 18 | pop hl 19 | inc hl 20 | jr .loop 21 | .newline: 22 | ld l,10 23 | push hl 24 | call _outchar 25 | pop hl 26 | ret 27 | 28 | extern _outchar 29 | -------------------------------------------------------------------------------- /src/libc/rand.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _rand 5 | _rand: 6 | call _random 7 | ld de,8388608 8 | sbc hl,de 9 | ret p 10 | add hl,de 11 | ret 12 | 13 | extern _random 14 | -------------------------------------------------------------------------------- /src/libc/remainderf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float remainderf(float x, float y) 4 | { 5 | return x - roundevenf(x / y) * y; 6 | } 7 | 8 | double remainder(double, double) __attribute__((alias("remainderf"))); 9 | -------------------------------------------------------------------------------- /src/libc/remainderl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long double remainderl(long double x, long double y) 4 | { 5 | return x - roundevenl(x / y) * y; 6 | } 7 | -------------------------------------------------------------------------------- /src/libc/remove.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int __attribute__((weak)) remove(const char *filename) 5 | { 6 | return !ti_Delete(filename); 7 | } 8 | -------------------------------------------------------------------------------- /src/libc/remquof.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float remquof(float x, float y, int *quo) 4 | { 5 | const float quotient = roundevenf(x / y); 6 | *quo = quotient; 7 | return x - quotient * y; // FIXME: accuracy 8 | } 9 | 10 | double remquo(double, double, int *) __attribute__((alias("remquof"))); 11 | -------------------------------------------------------------------------------- /src/libc/remquol.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long double remquol(long double x, long double y, int *quo) 4 | { 5 | const long double quotient = roundevenl(x / y); 6 | *quo = quotient; 7 | return x - quotient * y; // FIXME: accuracy 8 | } 9 | -------------------------------------------------------------------------------- /src/libc/rewind.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void __attribute__((weak)) rewind(FILE *stream) 5 | { 6 | stream->eof = 0; 7 | 8 | (void)fseek(stream, 0L, SEEK_SET); 9 | } 10 | -------------------------------------------------------------------------------- /src/libc/rintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | float rintf(float x) 5 | { 6 | float result = nearbyintf(x); 7 | if (result != x) feraiseexcept(FE_INEXACT); 8 | return result; 9 | } 10 | 11 | double rint(double) __attribute__((alias("rintf"))); 12 | -------------------------------------------------------------------------------- /src/libc/signbitf.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public __signbitf 6 | 7 | ; bool _signbitf(float) 8 | __signbitf: 9 | ld hl, 6 10 | add hl, sp 11 | ld a, (hl) 12 | rlca ; faster than rla \ sbc a, a 13 | ret 14 | -------------------------------------------------------------------------------- /src/libc/signbitl.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public __signbitl 6 | 7 | ; bool _signbitl(long double) 8 | __signbitl: 9 | ld hl, 10 10 | add hl, sp 11 | ld a, (hl) 12 | rlca ; faster than rla \ sbc a, a 13 | ret 14 | -------------------------------------------------------------------------------- /src/libc/sinhf.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _sinhf 5 | public _sinh 6 | 7 | if PREFER_OS_LIBC 8 | 9 | _sinhf := 022130h 10 | _sinh := _sinhf 11 | 12 | else 13 | 14 | _sinhf := __sinhf_c 15 | _sinh := __sinh_c 16 | 17 | extern __sinhf_c 18 | extern __sinh_c 19 | 20 | end if 21 | -------------------------------------------------------------------------------- /src/libc/snprintf.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public _snprintf 6 | public _vsnprintf 7 | 8 | if HAS_PRINTF 9 | 10 | _snprintf := __snprintf_c 11 | _vsnprintf := __vsnprintf_c 12 | 13 | extern __snprintf_c 14 | extern __vsnprintf_c 15 | 16 | else 17 | 18 | _snprintf := _boot_snprintf 19 | _vsnprintf := _boot_vsnprintf 20 | 21 | extern _boot_snprintf 22 | extern _boot_vsnprintf 23 | 24 | end if 25 | -------------------------------------------------------------------------------- /src/libc/sprintf.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public _sprintf 6 | 7 | if HAS_PRINTF 8 | 9 | _sprintf := __sprintf_c 10 | 11 | extern __sprintf_c 12 | 13 | else 14 | 15 | ; OS routine 16 | _sprintf := 0000BCh 17 | 18 | end if 19 | -------------------------------------------------------------------------------- /src/libc/sqrtl.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public _sqrtl 6 | 7 | _sqrtl: 8 | ; flags handled by softfloat 9 | ld hl, 10 10 | add hl, sp 11 | ld a, (hl) 12 | rlca 13 | inc hl 14 | ld (hl), a 15 | jq ___f64_sqrt 16 | 17 | extern ___f64_sqrt 18 | -------------------------------------------------------------------------------- /src/libc/srand.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _srand 5 | _srand: 6 | pop bc 7 | ex (sp),hl 8 | push bc 9 | xor a,a 10 | jp __setstate 11 | 12 | extern __setstate 13 | -------------------------------------------------------------------------------- /src/libc/stpcpy.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public _stpcpy 6 | 7 | _stpcpy: 8 | pop bc 9 | pop de 10 | ex (sp), hl 11 | push de 12 | push bc 13 | xor a, a 14 | ld bc, 0 15 | push hl 16 | cpir 17 | sbc hl, hl 18 | sbc hl, bc 19 | ex (sp), hl 20 | pop bc 21 | ldir 22 | ex de, hl 23 | dec hl 24 | ret 25 | -------------------------------------------------------------------------------- /src/libc/strlen.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _strlen 5 | 6 | if PREFER_OS_LIBC 7 | 8 | _strlen := $0000D4 9 | 10 | else 11 | 12 | _strlen: 13 | pop iy 14 | ex (sp), hl 15 | xor a, a 16 | ld bc, 0 17 | cpir 18 | sbc hl, hl 19 | scf 20 | sbc hl, bc 21 | jp (iy) 22 | 23 | end if 24 | -------------------------------------------------------------------------------- /src/libc/strnlen.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _strnlen 5 | _strnlen: 6 | pop hl 7 | pop de 8 | pop bc 9 | push bc 10 | push de 11 | push hl 12 | xor a, a 13 | sbc hl, hl 14 | sbc hl, bc 15 | ret z 16 | add hl, bc 17 | sbc hl, de 18 | ex de, hl 19 | cpir 20 | add hl, de 21 | ret z 22 | inc hl 23 | ret 24 | -------------------------------------------------------------------------------- /src/libc/strrchr.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _strrchr 5 | _strrchr: 6 | pop bc,hl,de 7 | push de,hl,bc 8 | xor a,a 9 | ld bc,0 10 | cpir 11 | ld a,e 12 | ex de,hl 13 | sbc hl,hl 14 | sbc hl,bc 15 | push hl 16 | pop bc 17 | ex de,hl 18 | dec hl 19 | cpdr 20 | inc hl 21 | ret z 22 | push bc 23 | pop hl 24 | ret 25 | -------------------------------------------------------------------------------- /src/libc/strtof.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _strtof 5 | public _strtod 6 | 7 | if PREFER_OS_LIBC 8 | 9 | _strtof := 0220E0h 10 | _strtod := _strtof 11 | 12 | else 13 | 14 | _strtof := __strtof_c 15 | _strtod := __strtod_c 16 | 17 | extern __strtof_c 18 | extern __strtod_c 19 | 20 | end if 21 | -------------------------------------------------------------------------------- /src/libc/strtol.c: -------------------------------------------------------------------------------- 1 | #define STRTOX_TYPE long 2 | #define STRTOX_MAX LONG_MAX 3 | #define STRTOX_MIN LONG_MIN 4 | 5 | #define STRTOX_SIGNED 1 6 | #define STRTOX_NAME strtol 7 | 8 | #include "strtox.h" 9 | -------------------------------------------------------------------------------- /src/libc/strtoll.c: -------------------------------------------------------------------------------- 1 | #define STRTOX_TYPE long long 2 | #define STRTOX_MAX LLONG_MAX 3 | #define STRTOX_MIN LLONG_MIN 4 | 5 | #define STRTOX_SIGNED 1 6 | #define STRTOX_NAME strtoll 7 | 8 | #include "strtox.h" 9 | 10 | #if __INTMAX_WIDTH__ == __LLONG_WIDTH__ 11 | __INTMAX_TYPE__ strtoimax(const char *, char **, int) __attribute__((alias("strtoll"))); 12 | #endif /* __INTMAX_WIDTH__ == __LLONG_WIDTH__ */ 13 | -------------------------------------------------------------------------------- /src/libc/strtoul.c: -------------------------------------------------------------------------------- 1 | #define STRTOX_TYPE long 2 | #define STRTOX_MAX ULONG_MAX 3 | #define STRTOX_MIN 0 4 | 5 | #define STRTOX_SIGNED 0 6 | #define STRTOX_NAME strtoul 7 | 8 | #include "strtox.h" 9 | -------------------------------------------------------------------------------- /src/libc/tanf.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _tanf 5 | public _tan 6 | 7 | if PREFER_OS_LIBC 8 | 9 | _tanf := 022120h 10 | _tan := _tanf 11 | 12 | else 13 | 14 | _tanf := __tanf_c 15 | _tan := __tan_c 16 | 17 | extern __tanf_c 18 | extern __tan_c 19 | 20 | end if 21 | -------------------------------------------------------------------------------- /src/libc/tanhf.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _tanhf 5 | public _tanh 6 | 7 | if PREFER_OS_LIBC 8 | 9 | _tanhf := 022138h 10 | _tanh := _tanhf 11 | 12 | else 13 | 14 | _tanhf := __tanhf_c 15 | _tanh := __tanh_c 16 | 17 | extern __tanhf_c 18 | extern __tanh_c 19 | 20 | end if 21 | -------------------------------------------------------------------------------- /src/libc/tolower.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _tolower 5 | 6 | _tolower: 7 | pop de 8 | ex (sp), hl 9 | push de 10 | require _tolower.internal 11 | 12 | section .text 13 | public _tolower.internal 14 | ; ASM interface: input/output char in L, destroys AF 15 | _tolower.internal: 16 | ld a, l 17 | sub a, 'A' 18 | cp a, 1+'Z'-'A' 19 | ret nc 20 | 21 | set 5, l 22 | ret 23 | -------------------------------------------------------------------------------- /src/libc/toupper.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | public _toupper 5 | 6 | _toupper: 7 | pop de 8 | ex (sp), hl 9 | push de 10 | require _toupper.internal 11 | 12 | section .text 13 | public _toupper.internal 14 | ; ASM interface: input/output char in L, destroys AF 15 | .internal: 16 | ld a, l 17 | sub a, 'a' 18 | cp a, 1+'z'-'a' 19 | ret nc 20 | 21 | res 5, l 22 | ret 23 | -------------------------------------------------------------------------------- /src/libc/vsprintf.src: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public _vsprintf 6 | 7 | if HAS_PRINTF 8 | 9 | _vsprintf := __vsprintf_c 10 | 11 | extern __vsprintf_c 12 | 13 | else 14 | 15 | _vsprintf := _boot_vsprintf 16 | 17 | extern _boot_vsprintf 18 | 19 | end if 20 | -------------------------------------------------------------------------------- /src/libcxx/include/cassert: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | #ifndef _EZCXX_CASSERT 3 | #define _EZCXX_CASSERT 4 | 5 | #include 6 | 7 | #pragma clang system_header 8 | 9 | #endif // _EZCXX_CASSERT 10 | -------------------------------------------------------------------------------- /src/libcxx/include/cerrno: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | #ifndef _EZCXX_CERRNO 3 | #define _EZCXX_CERRNO 4 | 5 | #include 6 | 7 | #pragma clang system_header 8 | 9 | namespace std { 10 | using ::errno; 11 | } // namespace std 12 | 13 | #endif // _EZCXX_CERRNO 14 | -------------------------------------------------------------------------------- /src/libcxx/include/cfloat: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | #ifndef _EZCXX_CFLOAT 3 | #define _EZCXX_CFLOAT 4 | 5 | #include 6 | 7 | #pragma clang system_header 8 | 9 | #endif // _EZCXX_CFLOAT 10 | -------------------------------------------------------------------------------- /src/libcxx/include/ciso646: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | #ifndef _EZCXX_CISO646 3 | #define _EZCXX_CISO646 4 | 5 | #include 6 | 7 | #pragma clang system_header 8 | 9 | #endif // _EZCXX_CISO646 10 | -------------------------------------------------------------------------------- /src/libcxx/include/climits: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | #ifndef _EZCXX_CLIMITS 3 | #define _EZCXX_CLIMITS 4 | 5 | #include 6 | 7 | #pragma clang system_header 8 | 9 | #endif // _EZCXX_CLIMITS 10 | -------------------------------------------------------------------------------- /src/libcxx/include/csetjmp: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | #ifndef _EZCXX_CSETJMP 3 | #define _EZCXX_CSETJMP 4 | 5 | #include 6 | 7 | #pragma clang system_header 8 | 9 | namespace std { 10 | using ::jmp_buf; 11 | using ::setjmp; 12 | using ::longjmp; 13 | } // namespace std 14 | 15 | #endif // _EZCXX_CSETJMP 16 | -------------------------------------------------------------------------------- /src/libcxx/include/cstdalign: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | #ifndef _EZCXX_CSTDALIGN 3 | #define _EZCXX_CSTDALIGN 4 | 5 | #include 6 | 7 | #pragma clang system_header 8 | 9 | #endif // _EZCXX_CSTDALIGN 10 | -------------------------------------------------------------------------------- /src/libcxx/include/cstdbool: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | #ifndef _EZCXX_CSTDBOOL 3 | #define _EZCXX_CSTDBOOL 4 | 5 | #include 6 | 7 | #pragma clang system_header 8 | 9 | #endif // _EZCXX_CSTDBOOL 10 | -------------------------------------------------------------------------------- /src/libcxx/include/cstdio: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | #ifndef _EZCXX_CSTDIO 3 | #define _EZCXX_CSTDIO 4 | 5 | #include 6 | 7 | #pragma clang system_header 8 | 9 | #endif // _EZCXX_CSTDINT 10 | -------------------------------------------------------------------------------- /src/libcxx/include/ctgmath: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | #ifndef _EZCXX_CTGMATH 3 | #define _EZCXX_CTGMATH 4 | 5 | #include 6 | 7 | #pragma clang system_header 8 | 9 | #endif // _EZCXX_CTGMATH 10 | -------------------------------------------------------------------------------- /src/libcxx/virtual.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "abort_message.h" 4 | 5 | namespace __cxxabiv1 { 6 | 7 | void __cxa_pure_virtual() { 8 | std::__terminate_message("pure virtual method called"); 9 | } 10 | 11 | void __cxa_deleted_virtual() { 12 | std::__terminate_message("deleted virtual method called"); 13 | } 14 | 15 | } // namespace __cxxabiv1 16 | -------------------------------------------------------------------------------- /src/libload/setup/flowchart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/src/libload/setup/flowchart.png -------------------------------------------------------------------------------- /src/softfloat/include/platform.h: -------------------------------------------------------------------------------- 1 | 2 | #define LITTLEENDIAN 1 3 | 4 | #define INLINE inline 5 | 6 | #define SOFTFLOAT_BUILTIN_CLZ 1 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /src/softfloat/isNaNF32UI.src: -------------------------------------------------------------------------------- 1 | assume adl = 1 2 | 3 | section .text 4 | 5 | public _isNaNF32UI 6 | _isNaNF32UI := __isnanf 7 | 8 | extern __isnanf 9 | -------------------------------------------------------------------------------- /src/softfloat/isNaNF64UI.src: -------------------------------------------------------------------------------- 1 | assume adl = 1 2 | 3 | section .text 4 | 5 | public _isNaNF64UI 6 | _isNaNF64UI := __isnanl 7 | 8 | extern __isnanl 9 | -------------------------------------------------------------------------------- /src/softfloat/softfloat_isSigNaNF32UI.src: -------------------------------------------------------------------------------- 1 | assume adl = 1 2 | 3 | section .text 4 | 5 | public _softfloat_isSigNaNF32UI 6 | _softfloat_isSigNaNF32UI := __issignalingf 7 | 8 | extern __issignalingf 9 | -------------------------------------------------------------------------------- /src/softfloat/softfloat_isSigNaNF64UI.src: -------------------------------------------------------------------------------- 1 | assume adl = 1 2 | 3 | section .text 4 | 5 | public _softfloat_isSigNaNF64UI 6 | _softfloat_isSigNaNF64UI := __issignalingl 7 | 8 | extern __issignalingl 9 | -------------------------------------------------------------------------------- /test/fileioc/detect/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.out 8 | -------------------------------------------------------------------------------- /test/fileioc/detect/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | ARCHIVED = NO 10 | 11 | CFLAGS = -Wall -Wextra -Oz 12 | CXXFLAGS = -Wall -Wextra -Oz 13 | 14 | # ---------------------------- 15 | 16 | include $(shell cedev-config --makefile) 17 | -------------------------------------------------------------------------------- /test/fileioc/detect/readme.md: -------------------------------------------------------------------------------- 1 | ### File Detection Demo 2 | 3 | Uses the `ti_Detect` function to search for a variable. 4 | The LibLoad AppVar is used because it is known to exist. 5 | -------------------------------------------------------------------------------- /test/fileioc/resize/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | ARCHIVED = NO 10 | 11 | CFLAGS = -Wall -Wextra -Oz 12 | CXXFLAGS = -Wall -Wextra -Oz 13 | 14 | # ---------------------------- 15 | 16 | include $(shell cedev-config --makefile) 17 | -------------------------------------------------------------------------------- /test/floating_point/float64_from_integer/src/crt_wrap.asm: -------------------------------------------------------------------------------- 1 | assume adl=1 2 | 3 | section .text 4 | 5 | public _CRT_utod, _CRT_itod 6 | 7 | _CRT_utod: 8 | ld hl, 3 9 | add hl, sp 10 | ld hl, (hl) 11 | jp __utod 12 | 13 | _CRT_itod: 14 | ld hl, 3 15 | add hl, sp 16 | ld hl, (hl) 17 | jp __itod 18 | 19 | extern __utod 20 | extern __itod 21 | -------------------------------------------------------------------------------- /test/graphx/blitting_rectangle/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.out 8 | -------------------------------------------------------------------------------- /test/graphx/blitting_rectangle/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | ARCHIVED = NO 10 | 11 | CFLAGS = -Wall -Wextra -Oz 12 | CXXFLAGS = -Wall -Wextra -Oz 13 | 14 | # ---------------------------- 15 | 16 | include $(shell cedev-config --makefile) 17 | -------------------------------------------------------------------------------- /test/graphx/blitting_rectangle/readme.md: -------------------------------------------------------------------------------- 1 | ### Blitting Rectangles Demo 2 | 3 | This example demonstrates blitting to manually copy data from the hidden drawing buffer to the visible screen buffer. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /test/graphx/blitting_rectangle/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/test/graphx/blitting_rectangle/screenshot.png -------------------------------------------------------------------------------- /test/graphx/zx0/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | .DS_Store 6 | convimg.out 7 | src/gfx/convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /test/graphx/zx0/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = YES 9 | COMPRESSED_MODE = zx0 10 | ARCHIVED = NO 11 | 12 | CFLAGS = -Wall -Wextra -Oz 13 | CXXFLAGS = -Wall -Wextra -Oz 14 | 15 | # ---------------------------- 16 | 17 | include $(shell cedev-config --makefile) 18 | -------------------------------------------------------------------------------- /test/graphx/zx0/src/gfx/apple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/test/graphx/zx0/src/gfx/apple.png -------------------------------------------------------------------------------- /test/issues/471/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /test/issues/471/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /test/issues/471/src/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(void) 5 | { 6 | gfx_Begin(); 7 | 8 | gfx_SetColor(7); // green 9 | gfx_Line(-100, 20, 30, 40); 10 | 11 | gfx_SetColor(224); // red 12 | gfx_Line(30, 40, -100, 20); // same numbers as above, just flipped order 13 | 14 | while (!os_GetCSC()); 15 | 16 | gfx_End(); 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /test/issues/511/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /test/issues/514/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -Oz 11 | CXXFLAGS = -Wall -Wextra -Oz 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /test/makefile: -------------------------------------------------------------------------------- 1 | #------------------------------------------- 2 | # This makefile builds all the test projects 3 | #------------------------------------------- 4 | 5 | MAKEFILES = $(wildcard */*/makefile) 6 | 7 | all clean gfx .PHONY: $(MAKEFILES) 8 | 9 | $(MAKEFILES): 10 | $(MAKE) -C $(dir $@) $(or $(MAKECMDGOALS),$(findstring debug,$@)) 11 | 12 | .PHONY: all clean gfx 13 | -------------------------------------------------------------------------------- /test/regression/bug0000/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | ARCHIVED = NO 10 | 11 | CFLAGS = -Wall -Wextra -Oz 12 | CXXFLAGS = -Wall -Wextra -Oz 13 | 14 | # ---------------------------- 15 | 16 | include $(shell cedev-config --makefile) 17 | -------------------------------------------------------------------------------- /test/regression/bug0001/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | ARCHIVED = NO 10 | 11 | CFLAGS = -Wall -Wextra -Oz 12 | CXXFLAGS = -Wall -Wextra -Oz 13 | 14 | # ---------------------------- 15 | 16 | include $(shell cedev-config --makefile) 17 | -------------------------------------------------------------------------------- /test/regression/bug0002/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | ARCHIVED = NO 10 | 11 | CFLAGS = -Wall -Wextra -Oz 12 | CXXFLAGS = -Wall -Wextra -Oz 13 | 14 | # ---------------------------- 15 | 16 | include $(shell cedev-config --makefile) 17 | -------------------------------------------------------------------------------- /test/regression/bug0002/src/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main(void) 7 | { 8 | volatile uint64_t x = 3750000; 9 | 10 | os_ClrHome(); 11 | 12 | x *= 2.5; 13 | 14 | printf("value: %llu\n", x); 15 | 16 | os_GetKey(); 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /test/regression/bug0004/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | ARCHIVED = NO 10 | 11 | CFLAGS = -Wall -Wextra -Oz 12 | CXXFLAGS = -Wall -Wextra -Oz 13 | 14 | # ---------------------------- 15 | 16 | include $(shell cedev-config --makefile) 17 | -------------------------------------------------------------------------------- /test/regression/bug0005/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | ARCHIVED = NO 10 | 11 | CFLAGS = -Wall -Wextra -Oz 12 | CXXFLAGS = -Wall -Wextra -Oz 13 | 14 | PREFER_OS_LIBC = NO 15 | 16 | # ---------------------------- 17 | 18 | include $(shell cedev-config --makefile) 19 | -------------------------------------------------------------------------------- /test/regression/i48routines/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | ARCHIVED = NO 10 | 11 | CFLAGS = -Wall -Wextra -Oz 12 | CXXFLAGS = -Wall -Wextra -Oz 13 | 14 | PREFER_OS_LIBC = NO 15 | 16 | # ---------------------------- 17 | 18 | include $(shell cedev-config --makefile) 19 | -------------------------------------------------------------------------------- /test/standalone/delay/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | ARCHIVED = NO 10 | 11 | CFLAGS = -Wall -Wextra -Oz 12 | CXXFLAGS = -Wall -Wextra -Oz 13 | 14 | # ---------------------------- 15 | 16 | include $(shell cedev-config --makefile) 17 | -------------------------------------------------------------------------------- /test/standalone/delay/readme.md: -------------------------------------------------------------------------------- 1 | ### Delay Demo 2 | 3 | Demonstrates using `delay()` to sleep for a number of milliseconds. 4 | -------------------------------------------------------------------------------- /test/standalone/delay/src/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(void) 4 | { 5 | /* Clear the homescreen */ 6 | os_ClrHome(); 7 | 8 | /* Wait for 5 seconds */ 9 | os_PutStrFull("Waiting..."); 10 | delay(5 * 1000); 11 | os_PutStrFull(" Done!"); 12 | delay(100); 13 | 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /test/standalone/errno/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | ARCHIVED = NO 10 | 11 | CFLAGS = -Wall -Wextra -Oz 12 | CXXFLAGS = -Wall -Wextra -Oz 13 | 14 | PREFER_OS_LIBC = NO 15 | 16 | # ---------------------------- 17 | 18 | include $(shell cedev-config --makefile) 19 | -------------------------------------------------------------------------------- /test/standalone/stopwatch/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.out 8 | -------------------------------------------------------------------------------- /test/standalone/stopwatch/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | ARCHIVED = NO 10 | 11 | CFLAGS = -Wall -Wextra -Oz 12 | CXXFLAGS = -Wall -Wextra -Oz 13 | 14 | # ---------------------------- 15 | 16 | include $(shell cedev-config --makefile) 17 | -------------------------------------------------------------------------------- /test/standalone/stopwatch/readme.md: -------------------------------------------------------------------------------- 1 | ### Stopwatch Demo 2 | 3 | This demo demonstrates using the hardware timers to implement a simple stopwatch 4 | displaying seconds with hundredths precision. 5 | 6 | ![Screenshot](screenshot.png) 7 | -------------------------------------------------------------------------------- /test/standalone/stopwatch/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/test/standalone/stopwatch/screenshot.png -------------------------------------------------------------------------------- /test/standalone/strlcpy/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.yaml.lst 8 | -------------------------------------------------------------------------------- /test/standalone/strlcpy/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "strlcpy test" 8 | COMPRESSED = NO 9 | 10 | CFLAGS = -Wall -Wextra -O0 11 | CXXFLAGS = -Wall -Wextra -O0 12 | 13 | # ---------------------------- 14 | 15 | include $(shell cedev-config --makefile) 16 | -------------------------------------------------------------------------------- /test/standalone/ticksleep/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.out 8 | -------------------------------------------------------------------------------- /test/standalone/ticksleep/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | ARCHIVED = NO 10 | 11 | CFLAGS = -Wall -Wextra -Oz 12 | CXXFLAGS = -Wall -Wextra -Oz 13 | 14 | # ---------------------------- 15 | 16 | include $(shell cedev-config --makefile) 17 | -------------------------------------------------------------------------------- /test/standalone/ticksleep/readme.md: -------------------------------------------------------------------------------- 1 | ### Tick Sleep Demo 2 | 3 | Demonstrates using `ticksleep()` to sleep for a number of clock ticks. 4 | -------------------------------------------------------------------------------- /test/standalone/ticksleep/src/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main(void) 6 | { 7 | /* Clear the homescreen */ 8 | os_ClrHome(); 9 | 10 | /* Wait for 5 seconds */ 11 | os_PutStrFull("Waiting..."); 12 | ticksleep(5 * CLOCKS_PER_SEC); 13 | os_PutStrFull(" Done!"); 14 | delay(100); 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /test/standalone/timer_counter/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.out 8 | -------------------------------------------------------------------------------- /test/standalone/timer_counter/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | ARCHIVED = NO 10 | 11 | CFLAGS = -Wall -Wextra -Oz 12 | CXXFLAGS = -Wall -Wextra -Oz 13 | 14 | # ---------------------------- 15 | 16 | include $(shell cedev-config --makefile) 17 | -------------------------------------------------------------------------------- /test/standalone/timer_counter/readme.md: -------------------------------------------------------------------------------- 1 | ### Second Counter Demo 2 | 3 | Uses the hardware timers to make a simple second counter. 4 | -------------------------------------------------------------------------------- /test/standalone/timer_counter2/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.out 8 | -------------------------------------------------------------------------------- /test/standalone/timer_counter2/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | ARCHIVED = NO 10 | 11 | CFLAGS = -Wall -Wextra -Oz 12 | CXXFLAGS = -Wall -Wextra -Oz 13 | 14 | # ---------------------------- 15 | 16 | include $(shell cedev-config --makefile) 17 | -------------------------------------------------------------------------------- /test/standalone/timer_counter2/readme.md: -------------------------------------------------------------------------------- 1 | ### Second Counter 2 Demo 2 | 3 | Uses the hardware timers to make a simple second counter a different way. 4 | 5 | ![Screenshot](screenshot.gif) 6 | -------------------------------------------------------------------------------- /test/standalone/timer_counter2/screenshot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CE-Programming/toolchain/107653e78e7dcac386a05d2a03a659e599b3efe4/test/standalone/timer_counter2/screenshot.gif -------------------------------------------------------------------------------- /test/standalone/usleep/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | src/gfx/*.c 4 | src/gfx/*.h 5 | src/gfx/*.8xv 6 | .DS_Store 7 | convimg.out 8 | -------------------------------------------------------------------------------- /test/standalone/usleep/makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------- 2 | # Makefile Options 3 | # ---------------------------- 4 | 5 | NAME = DEMO 6 | ICON = icon.png 7 | DESCRIPTION = "CE C Toolchain Demo" 8 | COMPRESSED = NO 9 | ARCHIVED = NO 10 | 11 | CFLAGS = -Wall -Wextra -Oz 12 | CXXFLAGS = -Wall -Wextra -Oz 13 | 14 | # ---------------------------- 15 | 16 | include $(shell cedev-config --makefile) 17 | -------------------------------------------------------------------------------- /test/standalone/usleep/readme.md: -------------------------------------------------------------------------------- 1 | ### Microsecond Sleep Demo 2 | 3 | Demonstrates using `usleep()` to sleep for a number of microseconds. 4 | -------------------------------------------------------------------------------- /test/standalone/usleep/src/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(void) 5 | { 6 | /* Clear the homescreen */ 7 | os_ClrHome(); 8 | 9 | /* Wait for 5 seconds */ 10 | os_PutStrFull("Waiting..."); 11 | usleep(5 * 1000000); 12 | os_PutStrFull(" Done!"); 13 | delay(100); 14 | 15 | return 0; 16 | } 17 | --------------------------------------------------------------------------------