├── tests ├── xmacro │ ├── debug.txt │ ├── model │ │ ├── parallel_port_log.txt │ │ └── screenshot.png │ ├── .gitignore │ ├── cdtc_project.conf │ ├── colors.def │ ├── Makefile │ ├── testfixture.c │ ├── testbench.c │ ├── local.Makefile │ └── colors.h ├── cfwi_test │ ├── model │ │ ├── parallel_port_log.txt │ │ └── screenshot.png │ ├── cdtc_project.conf │ ├── Makefile │ ├── cfwitest.c │ └── local.Makefile ├── variable_storage_class_test │ ├── model │ │ ├── parallel_port_log.txt │ │ └── screenshot.png │ ├── cdtc_project.conf │ ├── Makefile │ └── local.Makefile ├── cdtc_screen_basic_test │ ├── model │ │ ├── parallel_port_log.txt │ │ └── screenshot.png │ ├── cdtc_screen_basic_test.h │ ├── cdtc_project.conf │ ├── cdtc_screen_parameters.s │ ├── Makefile │ ├── printer.h │ ├── testbench.c │ ├── local.Makefile │ ├── printer.c │ └── cdtc_screen_basic_test.c ├── .gitignore ├── fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128 │ ├── parameters.s │ ├── model │ │ └── screenshot.png │ ├── cdtc_project.conf │ ├── Makefile │ ├── cdtc_local_machine.conf │ ├── printer.h │ ├── testbench.c │ ├── demo.c │ ├── local.Makefile │ ├── printer.c │ └── testfixture.c ├── fctdd_256_times_256_divided_by_lp_257_plus_y8_rp │ ├── cdtc_project.conf │ └── fctdd_256_times_256_divided_by_lp_257_plus_y8_rp_test.c ├── multiplication_benchmark_02_fast_constant_time_ab_aplusb_aminusb │ ├── model │ │ └── screenshot.png │ ├── cdtc_project.conf │ ├── Makefile │ ├── cdtc_local_machine.conf │ ├── printer.h │ ├── testbench.c │ ├── local.Makefile │ ├── printer.c │ └── testfixture.c ├── fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_256__xmy_lt_256 │ └── fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_256__xmy_lt_256_test.c └── Makefile ├── tool ├── 2cdt │ ├── .gitignore │ └── .is_core_tool ├── png2cpcsprite │ ├── .is_core_tool │ ├── .gitignore │ ├── .clang-format │ └── Makefile ├── cpcxfs │ ├── .gitignore │ ├── cpcxfs_build_patch.patch │ └── .is_core_tool ├── hex2bin │ ├── .gitignore │ ├── .is_core_tool │ ├── Makefile.havesourcetree │ └── Makefile ├── playtzx │ ├── .gitignore │ └── .is_core_tool ├── rasm │ ├── .gitignore │ ├── Makefile.rasm │ └── .is_core_tool ├── addhead │ ├── .gitignore │ └── .is_core_tool ├── rom │ ├── .gitignore │ └── download_roms.sh ├── caprice32 │ ├── .gitignore │ ├── bin │ │ ├── cap32_once │ │ └── cap32 │ └── caprice32_local_adjust.sh ├── idsk │ ├── .gitignore │ └── .is_core_tool ├── exomizer │ └── .gitignore ├── z88dk │ ├── .gitignore │ ├── .deprecated │ └── z88dk_prerequisites_check.sh ├── .gitignore ├── sdcc │ ├── .gitignore │ ├── .is_core_tool │ ├── sdcc_workaround_printf_optimization_bug.diff │ ├── sdcc_configure.sh │ └── Makefile ├── cpcec │ ├── Makefile.cpcec │ └── bin │ │ └── cpcec ├── scripts │ └── list_symbols_and_deltas.sh ├── Makefile └── gfx2crtc │ └── Makefile ├── cpclib ├── cfwi │ ├── .gitignore │ ├── test │ │ ├── fw_scr │ │ │ ├── output │ │ │ │ └── parallel_port_log.txt │ │ │ ├── model │ │ │ │ ├── parallel_port_log.txt │ │ │ │ └── screenshot.png │ │ │ ├── setborder.s │ │ │ ├── cdtc_project.conf │ │ │ ├── Makefile │ │ │ ├── setborder.h │ │ │ ├── random_with_8bit_lfsr.s │ │ │ ├── random_with_8bit_lfsr.h │ │ │ ├── random_with_16bit_lfsr.s │ │ │ ├── testbench.c │ │ │ ├── local.Makefile │ │ │ └── cap32_fortest.cfg │ │ ├── fw_cas │ │ │ ├── model │ │ │ │ ├── parallel_port_log.txt │ │ │ │ └── screenshot.png │ │ │ ├── cdtc_project.conf │ │ │ ├── Makefile │ │ │ ├── testbench.c │ │ │ └── local.Makefile │ │ ├── fw_km │ │ │ ├── model │ │ │ │ ├── parallel_port_log.txt │ │ │ │ └── screenshot.png │ │ │ ├── .gitignore │ │ │ ├── cdtc_project.conf │ │ │ ├── Makefile │ │ │ ├── testbench.c │ │ │ ├── local.Makefile │ │ │ └── testfixture.c │ │ ├── fw_txt │ │ │ ├── model │ │ │ │ ├── parallel_port_log.txt │ │ │ │ └── screenshot.png │ │ │ ├── .gitignore │ │ │ ├── cdtc_project.conf │ │ │ ├── Makefile │ │ │ ├── testbench.c │ │ │ ├── local.Makefile │ │ │ └── testfixture.c │ │ ├── fast_pixel_routine │ │ │ ├── test_result_reference.txt │ │ │ ├── cdtc_project.conf │ │ │ ├── Makefile │ │ │ ├── local.Makefile │ │ │ ├── testbench.c │ │ │ ├── testfixture.c │ │ │ └── prepare_screen_table_asm │ │ ├── gra_plot_absolute │ │ │ ├── test_result_reference.txt │ │ │ ├── cdtc_project.conf │ │ │ ├── Makefile │ │ │ ├── testfixture.c │ │ │ ├── local.Makefile │ │ │ └── testbench.c │ │ ├── trivial_function │ │ │ ├── test_result_reference.txt │ │ │ ├── testfixture.c │ │ │ ├── cdtc_project.conf │ │ │ ├── Makefile │ │ │ ├── local.Makefile │ │ │ └── testbench.c │ │ ├── km_set_expand │ │ │ ├── Makefile │ │ │ ├── TODO.txt │ │ │ ├── cdtc_project.conf │ │ │ └── test_km_expand.c │ │ └── .gitignore │ ├── cdtc_project.conf │ ├── Makefile │ ├── src │ │ ├── fw_txt_output.s │ │ ├── fw_txt_wr_char.s │ │ ├── fw_cas_noisy.s │ │ ├── fw_txt_set_row.s │ │ ├── fw_gra_set_pen.s │ │ ├── fw_gra_wr_char.s │ │ ├── fw_km_wait_key.s │ │ ├── fw_txt_set_pen.s │ │ ├── fw_km_char_return.s │ │ ├── fw_km_wait_char.s │ │ ├── fw_mc_set_mode.s │ │ ├── fw_scr_set_base.s │ │ ├── fw_txt_set_back.s │ │ ├── fw_gra_set_paper.s │ │ ├── fw_km_get_shift.s │ │ ├── fw_mc_print_char.s │ │ ├── fw_txt_set_column.s │ │ ├── fw_txt_set_graphic.s │ │ ├── fw_scr_get_location.s │ │ ├── fw_txt_set_paper.s │ │ ├── fw_gra_get_pen.s │ │ ├── fw_km_get_control.s │ │ ├── fw_mc_send_printer.s │ │ ├── fw_txt_get_back.s │ │ ├── fw_txt_get_pen.s │ │ ├── fw_gra_get_paper.s │ │ ├── fw_txt_ask_state.s │ │ ├── fw_txt_get_paper.s │ │ ├── fw_km_get_translate.s │ │ ├── fw_txt_get_cursor.s │ │ ├── fw_txt_str_select.s │ │ ├── fw_cas_stop_motor.s │ │ ├── fw_cas_start_motor.s │ │ ├── fw_scr_set_mode.s │ │ ├── fw_txt_rd_char.s │ │ ├── fw_txt_validate.s │ │ ├── fw_km_get_repeat.s │ │ ├── fw_mc_set_inks.s │ │ ├── fw_cas_restore_motor.s │ │ ├── fw_kl_choke_off.s │ │ ├── fw_km_read_char.s │ │ ├── fw_km_read_key.s │ │ ├── fw_km_test_key.s │ │ ├── fw_mc_busy_printer.s │ │ ├── fw_txt_get_matrix.s │ │ ├── fw_mc_clear_inks.s │ │ ├── fw_km_set_shift.s │ │ ├── fw_km_set_delay.s │ │ ├── fw_km_set_control.s │ │ ├── fw_km_set_repeat.s │ │ ├── fw_km_set_translate.s │ │ ├── fw_cas_set_speed.s │ │ ├── fw_txt_swap_streams.s │ │ ├── fw_scr_set_border.s │ │ ├── fw_mc_sound_register.s │ │ ├── fw_txt_get_m_table.s │ │ ├── fw_gra_set_origin.s │ │ ├── fw_gra_win_width.s │ │ ├── fw_gra_win_height.s │ │ ├── fw_km_get_expand.s │ │ ├── fw_scr_set_ink.s │ │ ├── fw_gra_move_absolute.s │ │ ├── fw_gra_plot_absolute.s │ │ ├── fw_gra_line_absolute.s │ │ ├── fw_gra_move_relative.s │ │ ├── fw_mc_start_program.s │ │ ├── fw_gra_plot_relative.s │ │ ├── fw_mc_screen_offset.s │ │ ├── fw_gra_line_relative.s │ │ ├── fw_cas_catalog.s │ │ ├── fw_gra_test_absolute.s │ │ ├── fw_gra_test_relative.s │ │ ├── fw_km_exp_buffer.s │ │ ├── fw_txt_win_enable.s │ │ ├── cfwi_txt_str0_output.s │ │ ├── fw_km_set_expand.s │ │ ├── fw_txt_set_matrix.s │ │ ├── fw_txt_set_cursor.s │ │ ├── fw_txt_set_m_table.s │ │ ├── fw_cas_out_open.s │ │ ├── fw_cas_in_open.s │ │ └── fw_nowrapperneeded.s │ ├── TODO.txt │ ├── include │ │ └── cfwi │ │ │ ├── cfwi_txt.h │ │ │ ├── fw_jre.h │ │ │ ├── fw_sound.h │ │ │ ├── cfwi.h │ │ │ └── cfwi_byte_shuffling.h │ ├── local.Makefile │ └── generate_c_headers.sh ├── cdtc_stdio │ ├── cdtc_project.conf │ ├── Makefile │ ├── getchar_cpc.s │ └── putchar_cpc.s ├── cdtc │ ├── cdtc_project.conf │ ├── Makefile │ ├── include │ │ └── cdtc │ │ │ ├── uint16_t_as_uint8_t_pair.h │ │ │ ├── fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_256__xmy_lt_256.h │ │ │ ├── fctdd_256_times_256_divided_by_lp_257_plus_y8_rp.h │ │ │ ├── fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128.h │ │ │ └── assert.h │ ├── cdtc_screen_parameters.s.example │ ├── cdtc_screen_basic_plot.s │ ├── cdtc_screen_basic_configure_crtc.s │ └── fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_256__xmy_lt_256.s ├── cpcrslib │ ├── .gitignore │ ├── cpcrslib_SDCC_build_patch.patch │ └── cpcrslib_SDCC_SDCC.Makefile └── .gitignore ├── maintainer-tools ├── .gitignore └── test_custom_project.sh ├── hello_world_using_z88dk ├── .gitignore ├── hello.c └── arithtest.c ├── documentation-for-maintainers └── z80_data_transform │ ├── .gitignore │ ├── generate_macros_for_undocumented_opcodes.sh │ └── generate_names_for_first_byte_of_ops.sh ├── hello_world_using_sdcc ├── cdtc_project.conf ├── fillscreen.h ├── Makefile ├── hello.h ├── km_wait_key.s ├── cpcfirmware.h └── fillscreen.s ├── cdtc_hello_cat.png ├── cdtc_hello_works.png ├── font ├── amstrad_cpc464.eot ├── amstrad_cpc464.ttf ├── amstrad_cpc464.woff ├── stylesheet.css ├── README.md └── demo-files │ └── demo.css ├── _config.yml ├── documentation ├── cdtc_hello_works.png ├── quick_cygwin_install │ ├── img │ │ ├── 08h50m42s_838688034.png │ │ ├── 08h50m57s_742258801.png │ │ ├── 08h50m59s_270911197.png │ │ ├── 08h51m01s_575552534.png │ │ ├── 08h51m03s_486680987.png │ │ ├── 08h51m04s_239316564.png │ │ ├── 08h51m56s_300756607.png │ │ ├── 08h52m00s_844526293.png │ │ ├── 08h52m06s_262584826.png │ │ ├── 09h17m20s_549763677.png │ │ ├── 09h17m25s_530144506.png │ │ ├── 09h17m28s_616575141.png │ │ ├── 09h17m46s_167727620.png │ │ ├── 09h17m55s_048931610.png │ │ ├── 09h17m55s_451573309.png │ │ ├── 09h18m45s_599936216.png │ │ ├── 09h18m46s_704763035.png │ │ ├── 09h18m55s_191953264.png │ │ ├── 09h18m56s_379904872.png │ │ ├── 09h19m25s_916488745.png │ │ ├── 09h19m41s_894913094.png │ │ ├── 09h23m23s_869659126.png │ │ └── 09h25m13s_551072815.png │ └── README.md ├── TODO.md └── why_this_tool.md ├── samples ├── 2dstars_00_bytes │ ├── setborder.s │ ├── cdtc_project.conf │ ├── Makefile │ ├── 2dstars.s │ └── main.c └── 2dstars_01_differential │ ├── setborder.s │ ├── cdtc_project.conf │ ├── Makefile │ └── main.c ├── .clang-format ├── .gitignore ├── git_configure_this_local_repo.sh ├── .gitattributes ├── .gitmodules ├── Makefile ├── .github └── workflows │ ├── static.yml │ └── codeql-analysis.yml └── .travis.yml /tests/xmacro/debug.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tool/2cdt/.gitignore: -------------------------------------------------------------------------------- 1 | 2cdt.zip 2 | -------------------------------------------------------------------------------- /tool/png2cpcsprite/.is_core_tool: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tool/cpcxfs/.gitignore: -------------------------------------------------------------------------------- 1 | cpcxfs.zip 2 | -------------------------------------------------------------------------------- /tool/hex2bin/.gitignore: -------------------------------------------------------------------------------- 1 | Hex2bin-*/ 2 | -------------------------------------------------------------------------------- /tool/playtzx/.gitignore: -------------------------------------------------------------------------------- 1 | playtzx-* 2 | -------------------------------------------------------------------------------- /tool/rasm/.gitignore: -------------------------------------------------------------------------------- 1 | *zip 2 | bin/ 3 | -------------------------------------------------------------------------------- /cpclib/cfwi/.gitignore: -------------------------------------------------------------------------------- 1 | s968se15.pdf 2 | -------------------------------------------------------------------------------- /tests/cfwi_test/model/parallel_port_log.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tool/addhead/.gitignore: -------------------------------------------------------------------------------- 1 | addhead.zip 2 | -------------------------------------------------------------------------------- /tool/rom/.gitignore: -------------------------------------------------------------------------------- 1 | roms 2 | rom_zips 3 | -------------------------------------------------------------------------------- /maintainer-tools/.gitignore: -------------------------------------------------------------------------------- 1 | my_cdct_project 2 | -------------------------------------------------------------------------------- /tests/xmacro/model/parallel_port_log.txt: -------------------------------------------------------------------------------- 1 | 01}2 -------------------------------------------------------------------------------- /tool/caprice32/.gitignore: -------------------------------------------------------------------------------- 1 | cap32_local.cfg 2 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_scr/output/parallel_port_log.txt: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_cas/model/parallel_port_log.txt: -------------------------------------------------------------------------------- 1 | 01q2 -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_km/model/parallel_port_log.txt: -------------------------------------------------------------------------------- 1 | 01f2 -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_scr/model/parallel_port_log.txt: -------------------------------------------------------------------------------- 1 | 01=2 -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_txt/model/parallel_port_log.txt: -------------------------------------------------------------------------------- 1 | 012 -------------------------------------------------------------------------------- /tool/png2cpcsprite/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | png2cpcsprite 3 | -------------------------------------------------------------------------------- /hello_world_using_z88dk/.gitignore: -------------------------------------------------------------------------------- 1 | *.opt 2 | zcc_opt.def 3 | -------------------------------------------------------------------------------- /tests/variable_storage_class_test/model/parallel_port_log.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tool/idsk/.gitignore: -------------------------------------------------------------------------------- 1 | iDSK 2 | ._iDSK* 3 | *.tgz 4 | iDSK.*/ 5 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fast_pixel_routine/test_result_reference.txt: -------------------------------------------------------------------------------- 1 | 01,2 -------------------------------------------------------------------------------- /cpclib/cfwi/test/gra_plot_absolute/test_result_reference.txt: -------------------------------------------------------------------------------- 1 | 01,2 -------------------------------------------------------------------------------- /cpclib/cfwi/test/trivial_function/test_result_reference.txt: -------------------------------------------------------------------------------- 1 | 01*2 -------------------------------------------------------------------------------- /documentation-for-maintainers/z80_data_transform/.gitignore: -------------------------------------------------------------------------------- 1 | generated 2 | -------------------------------------------------------------------------------- /tool/exomizer/.gitignore: -------------------------------------------------------------------------------- 1 | exomizer 2 | exomizer-*/ 3 | exomizer-*.zip 4 | -------------------------------------------------------------------------------- /tool/z88dk/.gitignore: -------------------------------------------------------------------------------- 1 | z88dk 2 | *.tgz 3 | build_config.inc 4 | *.zip 5 | -------------------------------------------------------------------------------- /cpclib/cdtc_stdio/cdtc_project.conf: -------------------------------------------------------------------------------- 1 | CDTC_ROOT=../../ 2 | PROJNAME=stdio_cpc 3 | -------------------------------------------------------------------------------- /hello_world_using_sdcc/cdtc_project.conf: -------------------------------------------------------------------------------- 1 | CDTC_ROOT=../ 2 | PROJNAME=hellosdc 3 | -------------------------------------------------------------------------------- /tests/xmacro/.gitignore: -------------------------------------------------------------------------------- 1 | test_verdict.txt 2 | test_result_raw.txt 3 | cap32_fast.cfg 4 | -------------------------------------------------------------------------------- /cdtc_hello_cat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/cdtc_hello_cat.png -------------------------------------------------------------------------------- /cpclib/cdtc/cdtc_project.conf: -------------------------------------------------------------------------------- 1 | CDTC_ROOT=../../ 2 | PROJNAME=cdtc 3 | 4 | default-target: lib 5 | -------------------------------------------------------------------------------- /cpclib/cfwi/cdtc_project.conf: -------------------------------------------------------------------------------- 1 | CDTC_ROOT=../../ 2 | PROJNAME=cfwi 3 | 4 | default-target: lib 5 | -------------------------------------------------------------------------------- /tests/cdtc_screen_basic_test/model/parallel_port_log.txt: -------------------------------------------------------------------------------- 1 | 0 0x00000191 0x00002E02 0x000004B81o2 -------------------------------------------------------------------------------- /cdtc_hello_works.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/cdtc_hello_works.png -------------------------------------------------------------------------------- /cpclib/cdtc/Makefile: -------------------------------------------------------------------------------- 1 | -include cdtc_project.conf 2 | -include $(CDTC_ROOT)/sdcc-project.Makefile 3 | -------------------------------------------------------------------------------- /cpclib/cfwi/Makefile: -------------------------------------------------------------------------------- 1 | -include cdtc_project.conf 2 | -include $(CDTC_ROOT)/sdcc-project.Makefile 3 | -------------------------------------------------------------------------------- /tests/.gitignore: -------------------------------------------------------------------------------- 1 | test-result-summary.txt 2 | **/cap32_fortest.* 3 | */output 4 | test-execution.log 5 | -------------------------------------------------------------------------------- /font/amstrad_cpc464.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/font/amstrad_cpc464.eot -------------------------------------------------------------------------------- /font/amstrad_cpc464.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/font/amstrad_cpc464.ttf -------------------------------------------------------------------------------- /tool/.gitignore: -------------------------------------------------------------------------------- 1 | *.ref 2 | *.downloadlog.txt 3 | *.buildtree/ 4 | *.installtree/ 5 | build_config.inc 6 | -------------------------------------------------------------------------------- /font/amstrad_cpc464.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/font/amstrad_cpc464.woff -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | # This is for https://cpcitor.github.io/cpc-dev-tool-chain 2 | remote_theme: cpcitor/jekyll-theme-cpc 3 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/km_set_expand/Makefile: -------------------------------------------------------------------------------- 1 | -include cdtc_project.conf 2 | -include $(CDTC_ROOT)/sdcc-project.Makefile 3 | -------------------------------------------------------------------------------- /tests/cdtc_screen_basic_test/cdtc_screen_basic_test.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | uint32_t cdtc_gra_plot_test( void ); 4 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_km/.gitignore: -------------------------------------------------------------------------------- 1 | test_verdict.txt 2 | test_result_raw.txt 3 | cap32_fast.cfg 4 | debug.txt 5 | wGui.log 6 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_txt/.gitignore: -------------------------------------------------------------------------------- 1 | test_verdict.txt 2 | test_result_raw.txt 3 | cap32_fast.cfg 4 | debug.txt 5 | wGui.log 6 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/km_set_expand/TODO.txt: -------------------------------------------------------------------------------- 1 | # TODO 2 | 3 | * easily build automated test targets with basic loader etc. 4 | 5 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/km_set_expand/cdtc_project.conf: -------------------------------------------------------------------------------- 1 | CDTC_ROOT=../../../../ 2 | PROJNAME=kmsetexp 3 | 4 | default-target: dsk 5 | -------------------------------------------------------------------------------- /cpclib/cpcrslib/.gitignore: -------------------------------------------------------------------------------- 1 | cpcrslib_SDCC 2 | cpcrslib_SDCC_11.03.2012.rar 3 | cpcrslib_SDCC_latest.zip 4 | cpcrslib-master 5 | -------------------------------------------------------------------------------- /tests/xmacro/model/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/tests/xmacro/model/screenshot.png -------------------------------------------------------------------------------- /tool/rasm/Makefile.rasm: -------------------------------------------------------------------------------- 1 | rasm: $(wildcard rasm_*.c) 2 | gcc -W -Wall -Wextra -pedantic $< -O2 -lm -lrt -march=native -o $@ 3 | -------------------------------------------------------------------------------- /cpclib/.gitignore: -------------------------------------------------------------------------------- 1 | *.ref 2 | *.downloadlog.txt 3 | *.tar.bz2 4 | *.buildtree/ 5 | *.installtree/ 6 | build_config.inc 7 | download 8 | -------------------------------------------------------------------------------- /documentation/cdtc_hello_works.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/documentation/cdtc_hello_works.png -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_scr/setborder.s: -------------------------------------------------------------------------------- 1 | .module setborder 2 | 3 | _setborder:: 4 | ld bc,#0x7F10 5 | out (c),c 6 | out (c),l 7 | ret 8 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/trivial_function/testfixture.c: -------------------------------------------------------------------------------- 1 | #include "stdint.h" 2 | 3 | uint8_t perform_test() 4 | { 5 | return 42; 6 | } 7 | -------------------------------------------------------------------------------- /tests/cfwi_test/model/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/tests/cfwi_test/model/screenshot.png -------------------------------------------------------------------------------- /tool/cpcxfs/cpcxfs_build_patch.patch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/tool/cpcxfs/cpcxfs_build_patch.patch -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_txt_output.s: -------------------------------------------------------------------------------- 1 | .module fw_txt_output 2 | 3 | _fw_txt_output:: 4 | ld a,l 5 | jp 0xBB5A ; TXT OUTPUT 6 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_txt_wr_char.s: -------------------------------------------------------------------------------- 1 | .module fw_txt_wr_char 2 | 3 | _fw_txt_wr_char:: 4 | ld a,l 5 | jp 0xBB5D ; TXT WR CHAR 6 | -------------------------------------------------------------------------------- /samples/2dstars_00_bytes/setborder.s: -------------------------------------------------------------------------------- 1 | .module setborder 2 | 3 | _setborder:: 4 | ld bc,#0x7F10 5 | out (c),c 6 | out (c),l 7 | ret 8 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_cas_noisy.s: -------------------------------------------------------------------------------- 1 | .module fw_cas_noisy 2 | 3 | _fw_cas_noisy:: 4 | ld a,l 5 | jp 0xBC6B ; CAS NOISY 6 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_txt_set_row.s: -------------------------------------------------------------------------------- 1 | .module fw_txt_set_row 2 | 3 | _fw_txt_set_row:: 4 | ld a,l 5 | jp 0xBB72 ; TXT SET ROW 6 | 7 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_km/model/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/cpclib/cfwi/test/fw_km/model/screenshot.png -------------------------------------------------------------------------------- /samples/2dstars_01_differential/setborder.s: -------------------------------------------------------------------------------- 1 | .module setborder 2 | 3 | _setborder:: 4 | ld bc,#0x7F10 5 | out (c),c 6 | out (c),l 7 | ret 8 | -------------------------------------------------------------------------------- /tests/cfwi_test/cdtc_project.conf: -------------------------------------------------------------------------------- 1 | CDTC_ROOT=../../ 2 | PROJNAME=cfwitest 3 | CFLAGS=--std-sdcc99 --max-allocs-per-node 1000000 --opt-code-size 4 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_gra_set_pen.s: -------------------------------------------------------------------------------- 1 | .module fw_gra_set_pen 2 | 3 | _fw_gra_set_pen:: 4 | ld a,l 5 | jp 0xBBDE ; GRA SET PEN 6 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_gra_wr_char.s: -------------------------------------------------------------------------------- 1 | .module fw_gra_wr_char 2 | 3 | _fw_gra_wr_char:: 4 | ld a,l 5 | jp 0xBBFC ; GRA WR CHAR 6 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_km_wait_key.s: -------------------------------------------------------------------------------- 1 | .module fw_km_wait_key 2 | 3 | _fw_km_wait_key:: 4 | call 0xBB18 5 | ld l,a 6 | ret 7 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_txt_set_pen.s: -------------------------------------------------------------------------------- 1 | .module fw_txt_set_pen 2 | 3 | _fw_txt_set_pen:: 4 | ld a,l 5 | jp 0xBB90 ; TXT SET PEN 6 | 7 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_cas/model/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/cpclib/cfwi/test/fw_cas/model/screenshot.png -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_scr/model/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/cpclib/cfwi/test/fw_scr/model/screenshot.png -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_txt/model/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/cpclib/cfwi/test/fw_txt/model/screenshot.png -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_km_char_return.s: -------------------------------------------------------------------------------- 1 | .module fw_km_char_return 2 | 3 | _fw_km_char_return:: 4 | ld a,l 5 | jp 0xBB0C ; KM CHAR RETURN 6 | 7 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_km_wait_char.s: -------------------------------------------------------------------------------- 1 | .module fw_km_wait_char 2 | 3 | _fw_km_wait_char:: 4 | call 0xBB06 5 | ld l,a 6 | ret 7 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_mc_set_mode.s: -------------------------------------------------------------------------------- 1 | .module fw_mc_set_mode 2 | 3 | _fw_mc_set_mode:: 4 | ld a,l 5 | jp 0xBD1C ; MC SET MODE 6 | 7 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_scr_set_base.s: -------------------------------------------------------------------------------- 1 | .module fw_scr_set_base 2 | 3 | _fw_scr_set_base:: 4 | ld a,l 5 | jp 0xBC08 ; SCR SET BASE 6 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_txt_set_back.s: -------------------------------------------------------------------------------- 1 | .module fw_txt_set_back 2 | 3 | _fw_txt_set_back:: 4 | ld a,l 5 | jp 0xBB9F ; TXT SET BACK 6 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/.gitignore: -------------------------------------------------------------------------------- 1 | cap32_fast.cfg 2 | debug.txt 3 | test_result_raw.txt 4 | test_verdict.txt 5 | wGui.log 6 | cap32_fortest.cfg 7 | **/output 8 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_cas/cdtc_project.conf: -------------------------------------------------------------------------------- 1 | CDTC_ROOT=../../../../ 2 | PROJNAME=fwcas 3 | CFLAGS=--std-sdcc99 --max-allocs-per-node 100000 --opt-code-size 4 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_km/cdtc_project.conf: -------------------------------------------------------------------------------- 1 | CDTC_ROOT=../../../../ 2 | PROJNAME=fwkm 3 | CFLAGS=--std-sdcc99 --max-allocs-per-node 100000 --opt-code-size 4 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_scr/cdtc_project.conf: -------------------------------------------------------------------------------- 1 | CDTC_ROOT=../../../../ 2 | PROJNAME=fwscr 3 | CFLAGS=--std-sdcc99 --max-allocs-per-node 10000 --opt-code-size 4 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_txt/cdtc_project.conf: -------------------------------------------------------------------------------- 1 | CDTC_ROOT=../../../../ 2 | PROJNAME=fwscr 3 | CFLAGS=--std-sdcc99 --max-allocs-per-node 100000 --opt-code-size 4 | -------------------------------------------------------------------------------- /tool/sdcc/.gitignore: -------------------------------------------------------------------------------- 1 | sdcc-*/ 2 | sdcc.downloadlog.txt 3 | sdcc.downloadlog.txt.downloadeddata 4 | *.tmp 5 | sdcc-3.9.0 6 | .build_has_source_tree_patched 7 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_gra_set_paper.s: -------------------------------------------------------------------------------- 1 | .module fw_gra_set_paper 2 | 3 | _fw_gra_set_paper:: 4 | ld a,l 5 | jp 0xBBE4 ; GRA SET PAPER 6 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_km_get_shift.s: -------------------------------------------------------------------------------- 1 | .module fw_km_get_shift 2 | 3 | _fw_km_get_shift:: 4 | ld a,l 5 | call 0xBB30 ; KM GET SHIFT 6 | ld l,a 7 | ret 8 | 9 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_mc_print_char.s: -------------------------------------------------------------------------------- 1 | .module fw_mc_print_char 2 | 3 | _fw_mc_print_char:: 4 | ld a,l 5 | jp 0xBD2B ; MC PRINT CHAR 6 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_txt_set_column.s: -------------------------------------------------------------------------------- 1 | .module fw_txt_set_column 2 | 3 | _fw_txt_set_column:: 4 | ld a,l 5 | jp 0xBB6F ; TXT SET COLUMN 6 | 7 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_txt_set_graphic.s: -------------------------------------------------------------------------------- 1 | .module fw_txt_set_graphic 2 | 3 | _fw_txt_set_graphic:: 4 | ld a,l 5 | jp 0xBB63 ; TXT SET GRAPHIC 6 | 7 | -------------------------------------------------------------------------------- /tests/cdtc_screen_basic_test/model/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/tests/cdtc_screen_basic_test/model/screenshot.png -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_scr_get_location.s: -------------------------------------------------------------------------------- 1 | .module fw_scr_get_location 2 | 3 | _fw_scr_get_location:: 4 | call 0xBC0B ; SCR GET LOCATION 5 | ld e,a 6 | ret 7 | 8 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_txt_set_paper.s: -------------------------------------------------------------------------------- 1 | .module fw_txt_set_paper 2 | 3 | _fw_txt_set_paper:: 4 | ld a,l 5 | jp 0xBB96 ; TXT SET PAPER 6 | 7 | -------------------------------------------------------------------------------- /tool/2cdt/.is_core_tool: -------------------------------------------------------------------------------- 1 | The presence of this file in a tool directory causes it to be built and installed by default in binary distributions of cpc-dev-tool-chain. 2 | -------------------------------------------------------------------------------- /tool/caprice32/bin/cap32_once: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SCRIPTDIR=$( cd -P "$(dirname $0)" ; pwd ) 4 | 5 | exec "${SCRIPTDIR}/cap32" "$@" -a CAP32_WAITBREAKCAP32_EXIT 6 | -------------------------------------------------------------------------------- /tool/idsk/.is_core_tool: -------------------------------------------------------------------------------- 1 | The presence of this file in a tool directory causes it to be built and installed by default in binary distributions of cpc-dev-tool-chain. 2 | -------------------------------------------------------------------------------- /tool/rasm/.is_core_tool: -------------------------------------------------------------------------------- 1 | The presence of this file in a tool directory causes it to be built and installed by default in binary distributions of cpc-dev-tool-chain. 2 | -------------------------------------------------------------------------------- /tool/sdcc/.is_core_tool: -------------------------------------------------------------------------------- 1 | The presence of this file in a tool directory causes it to be built and installed by default in binary distributions of cpc-dev-tool-chain. 2 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_gra_get_pen.s: -------------------------------------------------------------------------------- 1 | .module fw_gra_get_pen 2 | 3 | _fw_gra_get_pen:: 4 | call 0xBBE1 ; GRA GET PEN 5 | ld l,a 6 | ret 7 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_km_get_control.s: -------------------------------------------------------------------------------- 1 | .module fw_km_get_control 2 | 3 | _fw_km_get_control:: 4 | ld a,l 5 | call 0xBB36 ; TXT GET CONTROL 6 | ld l,a 7 | ret 8 | 9 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_mc_send_printer.s: -------------------------------------------------------------------------------- 1 | .module fw_mc_send_printer 2 | 3 | _fw_mc_send_printer:: 4 | ld a,l 5 | jp 0xBD31 ; MC SEND PRINTER 6 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_txt_get_back.s: -------------------------------------------------------------------------------- 1 | .module fw_txt_get_back 2 | 3 | _fw_txt_get_back:: 4 | call 0xBBA2 ; TXT GET BACK 5 | ld l,a 6 | ret 7 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_txt_get_pen.s: -------------------------------------------------------------------------------- 1 | .module fw_txt_get_pen 2 | 3 | _fw_txt_get_pen:: 4 | call 0xBB93 ; TXT GET PEN 5 | ld l,a 6 | ret 7 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fast_pixel_routine/cdtc_project.conf: -------------------------------------------------------------------------------- 1 | CDTC_ROOT=../../../../ 2 | PROJNAME=fastplot 3 | CFLAGS=--std-sdcc99 --max-allocs-per-node 1000000 --opt-code-size 4 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/gra_plot_absolute/cdtc_project.conf: -------------------------------------------------------------------------------- 1 | CDTC_ROOT=../../../../ 2 | PROJNAME=graplota 3 | CFLAGS=--std-sdcc99 --max-allocs-per-node 1000000 --opt-code-size 4 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/trivial_function/cdtc_project.conf: -------------------------------------------------------------------------------- 1 | CDTC_ROOT=../../../../ 2 | PROJNAME=unittest 3 | CFLAGS=--std-sdcc99 --max-allocs-per-node 1000000 --opt-code-size 4 | -------------------------------------------------------------------------------- /tests/variable_storage_class_test/model/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/tests/variable_storage_class_test/model/screenshot.png -------------------------------------------------------------------------------- /tool/addhead/.is_core_tool: -------------------------------------------------------------------------------- 1 | The presence of this file in a tool directory causes it to be built and installed by default in binary distributions of cpc-dev-tool-chain. 2 | -------------------------------------------------------------------------------- /tool/cpcxfs/.is_core_tool: -------------------------------------------------------------------------------- 1 | The presence of this file in a tool directory causes it to be built and installed by default in binary distributions of cpc-dev-tool-chain. 2 | -------------------------------------------------------------------------------- /tool/hex2bin/.is_core_tool: -------------------------------------------------------------------------------- 1 | The presence of this file in a tool directory causes it to be built and installed by default in binary distributions of cpc-dev-tool-chain. 2 | -------------------------------------------------------------------------------- /tool/playtzx/.is_core_tool: -------------------------------------------------------------------------------- 1 | The presence of this file in a tool directory causes it to be built and installed by default in binary distributions of cpc-dev-tool-chain. 2 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_gra_get_paper.s: -------------------------------------------------------------------------------- 1 | .module fw_gra_get_paper 2 | 3 | _fw_gra_get_paper:: 4 | call 0xBBE7 ; GRA GET PAPER 5 | ld l,a 6 | ret 7 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_txt_ask_state.s: -------------------------------------------------------------------------------- 1 | .module fw_txt_ask_state 2 | 3 | _fw_txt_ask_state:: 4 | call 0xBD40 ; TXT ASK STATE 5 | ld l,a 6 | ret 7 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_txt_get_paper.s: -------------------------------------------------------------------------------- 1 | .module fw_txt_get_paper 2 | 3 | _fw_txt_get_paper:: 4 | call 0xBB99 ; TXT GET PAPER 5 | ld l,a 6 | ret 7 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_km_get_translate.s: -------------------------------------------------------------------------------- 1 | .module fw_km_get_translate 2 | 3 | _fw_km_get_translate:: 4 | ld a,l 5 | call 0xBB2A ; KM GET TRANSLATE 6 | ld l,a 7 | ret 8 | 9 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_txt_get_cursor.s: -------------------------------------------------------------------------------- 1 | .module fw_txt_get_cursor 2 | 3 | _fw_txt_get_cursor:: 4 | call 0xBB78 ; TXT GET CURSOR 5 | ld e,a 6 | ret 7 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_txt_str_select.s: -------------------------------------------------------------------------------- 1 | .module fw_txt_str_select 2 | 3 | _fw_txt_str_select:: 4 | call 0xBBB4 ; TXT STR SELECT 5 | ld l,a 6 | ret 7 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_cas_stop_motor.s: -------------------------------------------------------------------------------- 1 | .module fw_cas_stop_motor 2 | 3 | _fw_cas_stop_motor:: 4 | call 0xBC71 ; CAS STOP MOTOR 5 | ld l,a 6 | ret nc 7 | inc l 8 | ret 9 | 10 | -------------------------------------------------------------------------------- /documentation/quick_cygwin_install/img/08h50m42s_838688034.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/documentation/quick_cygwin_install/img/08h50m42s_838688034.png -------------------------------------------------------------------------------- /documentation/quick_cygwin_install/img/08h50m57s_742258801.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/documentation/quick_cygwin_install/img/08h50m57s_742258801.png -------------------------------------------------------------------------------- /documentation/quick_cygwin_install/img/08h50m59s_270911197.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/documentation/quick_cygwin_install/img/08h50m59s_270911197.png -------------------------------------------------------------------------------- /documentation/quick_cygwin_install/img/08h51m01s_575552534.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/documentation/quick_cygwin_install/img/08h51m01s_575552534.png -------------------------------------------------------------------------------- /documentation/quick_cygwin_install/img/08h51m03s_486680987.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/documentation/quick_cygwin_install/img/08h51m03s_486680987.png -------------------------------------------------------------------------------- /documentation/quick_cygwin_install/img/08h51m04s_239316564.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/documentation/quick_cygwin_install/img/08h51m04s_239316564.png -------------------------------------------------------------------------------- /documentation/quick_cygwin_install/img/08h51m56s_300756607.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/documentation/quick_cygwin_install/img/08h51m56s_300756607.png -------------------------------------------------------------------------------- /documentation/quick_cygwin_install/img/08h52m00s_844526293.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/documentation/quick_cygwin_install/img/08h52m00s_844526293.png -------------------------------------------------------------------------------- /documentation/quick_cygwin_install/img/08h52m06s_262584826.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/documentation/quick_cygwin_install/img/08h52m06s_262584826.png -------------------------------------------------------------------------------- /documentation/quick_cygwin_install/img/09h17m20s_549763677.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/documentation/quick_cygwin_install/img/09h17m20s_549763677.png -------------------------------------------------------------------------------- /documentation/quick_cygwin_install/img/09h17m25s_530144506.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/documentation/quick_cygwin_install/img/09h17m25s_530144506.png -------------------------------------------------------------------------------- /documentation/quick_cygwin_install/img/09h17m28s_616575141.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/documentation/quick_cygwin_install/img/09h17m28s_616575141.png -------------------------------------------------------------------------------- /documentation/quick_cygwin_install/img/09h17m46s_167727620.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/documentation/quick_cygwin_install/img/09h17m46s_167727620.png -------------------------------------------------------------------------------- /documentation/quick_cygwin_install/img/09h17m55s_048931610.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/documentation/quick_cygwin_install/img/09h17m55s_048931610.png -------------------------------------------------------------------------------- /documentation/quick_cygwin_install/img/09h17m55s_451573309.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/documentation/quick_cygwin_install/img/09h17m55s_451573309.png -------------------------------------------------------------------------------- /documentation/quick_cygwin_install/img/09h18m45s_599936216.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/documentation/quick_cygwin_install/img/09h18m45s_599936216.png -------------------------------------------------------------------------------- /documentation/quick_cygwin_install/img/09h18m46s_704763035.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/documentation/quick_cygwin_install/img/09h18m46s_704763035.png -------------------------------------------------------------------------------- /documentation/quick_cygwin_install/img/09h18m55s_191953264.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/documentation/quick_cygwin_install/img/09h18m55s_191953264.png -------------------------------------------------------------------------------- /documentation/quick_cygwin_install/img/09h18m56s_379904872.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/documentation/quick_cygwin_install/img/09h18m56s_379904872.png -------------------------------------------------------------------------------- /documentation/quick_cygwin_install/img/09h19m25s_916488745.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/documentation/quick_cygwin_install/img/09h19m25s_916488745.png -------------------------------------------------------------------------------- /documentation/quick_cygwin_install/img/09h19m41s_894913094.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/documentation/quick_cygwin_install/img/09h19m41s_894913094.png -------------------------------------------------------------------------------- /documentation/quick_cygwin_install/img/09h23m23s_869659126.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/documentation/quick_cygwin_install/img/09h23m23s_869659126.png -------------------------------------------------------------------------------- /documentation/quick_cygwin_install/img/09h25m13s_551072815.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/documentation/quick_cygwin_install/img/09h25m13s_551072815.png -------------------------------------------------------------------------------- /tests/fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128/parameters.s: -------------------------------------------------------------------------------- 1 | .module parameters 2 | 3 | 4 | _fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128_table == 0x8000 5 | -------------------------------------------------------------------------------- /tool/caprice32/bin/cap32: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | MODULEDIR=$( cd -P "$(dirname $0)/.." ; pwd ) 4 | 5 | exec "${MODULEDIR}/caprice32/cap32" --cfg_file="${MODULEDIR}/cap32_local.cfg" "$@" 6 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_cas_start_motor.s: -------------------------------------------------------------------------------- 1 | .module fw_cas_start_motor 2 | 3 | _fw_cas_start_motor:: 4 | call 0xBC6E ; CAS START MOTOR 5 | ld l,a 6 | ret nc 7 | inc l 8 | ret 9 | 10 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_scr_set_mode.s: -------------------------------------------------------------------------------- 1 | .module fw_scr_set_mode 2 | 3 | _fw_scr_set_mode:: 4 | ld a,l 5 | jp 0xBC0E ; TXT SET COLUMN 6 | ; rather than call + ret 7 | -------------------------------------------------------------------------------- /tests/xmacro/cdtc_project.conf: -------------------------------------------------------------------------------- 1 | # If you want to make your own project, don't copy this makefile but use script named `cdtc-project-setup.sh`. 2 | 3 | CDTC_ROOT=../../ 4 | PROJNAME=xmacro 5 | -------------------------------------------------------------------------------- /cpclib/cfwi/TODO.txt: -------------------------------------------------------------------------------- 1 | * rule to automatically run emulator caprice32 2 | * see [coverage.html](coverage.html) and fix things there 3 | * create unit tests bench that runs test and checks results 4 | 5 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_txt_rd_char.s: -------------------------------------------------------------------------------- 1 | .module fw_txt_rd_char 2 | 3 | _fw_txt_rd_char:: 4 | call 0xbb60 ; TXT RD CHAR 5 | ld h,#0 6 | ret nc 7 | ld l,a 8 | dec h 9 | ret 10 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_txt_validate.s: -------------------------------------------------------------------------------- 1 | .module fw_txt_validate 2 | 3 | _fw_txt_validate:: 4 | call 0xBB87 ; TXT VALIDATE 5 | ld e,#0 6 | ret c 7 | dec e 8 | ld d,b 9 | ret 10 | -------------------------------------------------------------------------------- /samples/2dstars_00_bytes/cdtc_project.conf: -------------------------------------------------------------------------------- 1 | # If you want to make your own project, don't copy this makefile but use script named `cdtc-project-setup.sh`. 2 | 3 | CDTC_ROOT=../../ 4 | PROJNAME=2dstarsb 5 | -------------------------------------------------------------------------------- /tool/png2cpcsprite/.clang-format: -------------------------------------------------------------------------------- 1 | UseTab: Never 2 | IndentWidth: 8 3 | ContinuationIndentWidth: 8 4 | BreakBeforeBraces: Allman 5 | AllowShortIfStatementsOnASingleLine: false 6 | IndentCaseLabels: false 7 | -------------------------------------------------------------------------------- /cpclib/cfwi/include/cfwi/cfwi_txt.h: -------------------------------------------------------------------------------- 1 | #ifndef __CFWI_TXT_H__ 2 | #define __CFWI_TXT_H__ 3 | 4 | void cfwi_txt_str0_output (const char* s) __preserves_regs(b, c, iyh, iyl); 5 | 6 | #endif /* __CFWI_TXT_H__ */ 7 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_km_get_repeat.s: -------------------------------------------------------------------------------- 1 | .module fw_km_get_repeat 2 | 3 | _fw_km_get_repeat:: 4 | call 0xBB3C ; KM GET REPEAT 5 | ld l,#0 6 | ret z 7 | dec l 8 | ret 9 | 10 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_mc_set_inks.s: -------------------------------------------------------------------------------- 1 | .module fw_mc_set_inks 2 | 3 | _fw_mc_set_inks__16:: 4 | _fw_mc_set_inks__4:: 5 | _fw_mc_set_inks__2:: 6 | ex de,hl 7 | jp 0xBD25 ; MC SET INKS 8 | -------------------------------------------------------------------------------- /hello_world_using_sdcc/fillscreen.h: -------------------------------------------------------------------------------- 1 | #ifndef _fillscreen_H_ 2 | #define _fillscreen_H_ 3 | 4 | /** Implemented in assembly. */ 5 | 6 | extern void fillscreen (unsigned char a); 7 | #endif /* _fillscreen_H_ */ 8 | -------------------------------------------------------------------------------- /samples/2dstars_01_differential/cdtc_project.conf: -------------------------------------------------------------------------------- 1 | # If you want to make your own project, don't copy this makefile but use script named `cdtc-project-setup.sh`. 2 | 3 | CDTC_ROOT=../../ 4 | PROJNAME=2dstarsp 5 | -------------------------------------------------------------------------------- /tests/cdtc_screen_basic_test/cdtc_project.conf: -------------------------------------------------------------------------------- 1 | # If you want to make your own project, don't copy this makefile but use script named `cdtc-project-setup.sh`. 2 | 3 | CDTC_ROOT=../../ 4 | PROJNAME=cdtcplot 5 | -------------------------------------------------------------------------------- /tests/variable_storage_class_test/cdtc_project.conf: -------------------------------------------------------------------------------- 1 | # If you want to make your own project, don't copy this makefile but use script named `cdtc-project-setup.sh`. 2 | 3 | CDTC_ROOT=../../ 4 | PROJNAME=varstor 5 | -------------------------------------------------------------------------------- /tests/xmacro/colors.def: -------------------------------------------------------------------------------- 1 | _XMACRO_ELEMENT(red) 2 | _XMACRO_ELEMENT(orange) 3 | _XMACRO_ELEMENT(yellow) 4 | _XMACRO_ELEMENT(green) 5 | _XMACRO_ELEMENT(cyan) 6 | _XMACRO_ELEMENT(blue) 7 | _XMACRO_ELEMENT(magenta) 8 | -------------------------------------------------------------------------------- /tool/z88dk/.deprecated: -------------------------------------------------------------------------------- 1 | The presence of this file in a cpc-dev-tool-chain directory means 2 | that the corresponding item is deprecated. 3 | 4 | Among other things, it means that by default it won't be built. 5 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_cas_restore_motor.s: -------------------------------------------------------------------------------- 1 | .module fw_cas_restore_motor 2 | 3 | _fw_cas_restore_motor:: 4 | ld a,l 5 | call 0xBC74 ; CAS RESTORE MOTOR 6 | ld l,a 7 | ret nc 8 | inc l 9 | ret 10 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_kl_choke_off.s: -------------------------------------------------------------------------------- 1 | .module fw_kl_choke_off 2 | 3 | _fw_kl_choke_off__with_return_value:: 4 | call 0xbcc8 ; KL CHOKE OFF 5 | ld l,c 6 | ld h,b 7 | ret 8 | -------------------------------------------------------------------------------- /tests/fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128/model/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/tests/fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128/model/screenshot.png -------------------------------------------------------------------------------- /tool/cpcec/Makefile.cpcec: -------------------------------------------------------------------------------- 1 | # Information in cpc-ox.h 2 | 3 | CFLAGS=-O2 4 | # -W -Wall -Wextra -pedantic -O2 5 | 6 | cpcec: Makefile $(wildcard *.c *.h) 7 | $(CC) $(CFLAGS) -DSDL_MAIN_HANDLED -xc cpcec.c -lSDL2 -o $@ 8 | -------------------------------------------------------------------------------- /tests/fctdd_256_times_256_divided_by_lp_257_plus_y8_rp/cdtc_project.conf: -------------------------------------------------------------------------------- 1 | # If you want to make your own project, don't copy this makefile but use script named `cdtc-project-setup.sh`. 2 | 3 | CDTC_ROOT=../../ 4 | PROJNAME=fctdd 5 | -------------------------------------------------------------------------------- /cpclib/cdtc_stdio/Makefile: -------------------------------------------------------------------------------- 1 | # THIS_FILE_WILL_BE_OVERWRITTEN_BY_CDTC 2 | -include cdtc_project.conf 3 | -include $(CDTC_ROOT)/sdcc-project.Makefile 4 | failure: 5 | @echo 'Cannot locate cpc-dev-tool-chain main directory.' 6 | @false 7 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_km_read_char.s: -------------------------------------------------------------------------------- 1 | .module fw_km_read_char 2 | 3 | _fw_km_read_char:: 4 | call 0xBB09 ; KM READ CHAR 5 | ld h,#0 6 | ret c 7 | dec h 8 | ld l,a 9 | ret 10 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_km_read_key.s: -------------------------------------------------------------------------------- 1 | .module fw_km_read_key 2 | 3 | _fw_km_read_key:: 4 | call 0xBB1B ; KM READ KEY 5 | ld hl,#0000 6 | ret nc 7 | ld l,a 8 | dec h 9 | ret 10 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_km_test_key.s: -------------------------------------------------------------------------------- 1 | .module fw_km_test_key 2 | 3 | _fw_km_test_key:: 4 | ld a,l 5 | call 0xBB1E ; KM TEST KEY 6 | ld l,c 7 | ld h,#0 8 | ret z 9 | dec h 10 | ret 11 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_mc_busy_printer.s: -------------------------------------------------------------------------------- 1 | .module fw_mc_busy_printer 2 | 3 | _fw_mc_busy_printer:: 4 | call 0xBD2E ; MC BUSY PRINTER 5 | ld l,#0 6 | ret nc 7 | dec l 8 | ret 9 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_txt_get_matrix.s: -------------------------------------------------------------------------------- 1 | .module fw_txt_get_matrix 2 | 3 | _fw_txt_get_matrix:: 4 | call 0xBBA5 ; TXT GET MATRIX 5 | ld e,#0 6 | ret nc 7 | dec e 8 | ret 9 | -------------------------------------------------------------------------------- /tests/cdtc_screen_basic_test/cdtc_screen_parameters.s: -------------------------------------------------------------------------------- 1 | .module cdtc_screen_basic_parameter 2 | 3 | .z80 4 | 5 | _cdtc_screen_basic__table_hl == 0x8000 ; FIXME should be automatically sanity checked and even automatically computed 6 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_cas/Makefile: -------------------------------------------------------------------------------- 1 | # THIS_FILE_WILL_BE_OVERWRITTEN_BY_CDTC 2 | -include cdtc_project.conf 3 | -include $(CDTC_ROOT)/sdcc-project.Makefile 4 | failure: 5 | @echo 'Cannot locate cpc-dev-tool-chain main directory.' 6 | @false 7 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_km/Makefile: -------------------------------------------------------------------------------- 1 | # THIS_FILE_WILL_BE_OVERWRITTEN_BY_CDTC 2 | -include cdtc_project.conf 3 | -include $(CDTC_ROOT)/sdcc-project.Makefile 4 | failure: 5 | @echo 'Cannot locate cpc-dev-tool-chain main directory.' 6 | @false 7 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_scr/Makefile: -------------------------------------------------------------------------------- 1 | # THIS_FILE_WILL_BE_OVERWRITTEN_BY_CDTC 2 | -include cdtc_project.conf 3 | -include $(CDTC_ROOT)/sdcc-project.Makefile 4 | failure: 5 | @echo 'Cannot locate cpc-dev-tool-chain main directory.' 6 | @false 7 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_txt/Makefile: -------------------------------------------------------------------------------- 1 | # THIS_FILE_WILL_BE_OVERWRITTEN_BY_CDTC 2 | -include cdtc_project.conf 3 | -include $(CDTC_ROOT)/sdcc-project.Makefile 4 | failure: 5 | @echo 'Cannot locate cpc-dev-tool-chain main directory.' 6 | @false 7 | -------------------------------------------------------------------------------- /hello_world_using_sdcc/Makefile: -------------------------------------------------------------------------------- 1 | # THIS_FILE_WILL_BE_OVERWRITTEN_BY_CDTC 2 | -include cdtc_project.conf 3 | -include $(CDTC_ROOT)/sdcc-project.Makefile 4 | failure: 5 | @echo 'Cannot locate cpc-dev-tool-chain main directory.' 6 | @false 7 | -------------------------------------------------------------------------------- /tests/fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128/cdtc_project.conf: -------------------------------------------------------------------------------- 1 | # If you want to make your own project, don't copy this makefile but use script named `cdtc-project-setup.sh`. 2 | 3 | CDTC_ROOT=../../ 4 | PROJNAME=fctdm128 5 | -------------------------------------------------------------------------------- /tests/multiplication_benchmark_02_fast_constant_time_ab_aplusb_aminusb/model/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpc-dev-tool-chain/HEAD/tests/multiplication_benchmark_02_fast_constant_time_ab_aplusb_aminusb/model/screenshot.png -------------------------------------------------------------------------------- /cpclib/cfwi/test/gra_plot_absolute/Makefile: -------------------------------------------------------------------------------- 1 | # THIS_FILE_WILL_BE_OVERWRITTEN_BY_CDTC 2 | -include cdtc_project.conf 3 | -include $(CDTC_ROOT)/sdcc-project.Makefile 4 | failure: 5 | @echo 'Cannot locate cpc-dev-tool-chain main directory.' 6 | @false 7 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/trivial_function/Makefile: -------------------------------------------------------------------------------- 1 | # THIS_FILE_WILL_BE_OVERWRITTEN_BY_CDTC 2 | -include cdtc_project.conf 3 | -include $(CDTC_ROOT)/sdcc-project.Makefile 4 | failure: 5 | @echo 'Cannot locate cpc-dev-tool-chain main directory.' 6 | @false 7 | -------------------------------------------------------------------------------- /tests/multiplication_benchmark_02_fast_constant_time_ab_aplusb_aminusb/cdtc_project.conf: -------------------------------------------------------------------------------- 1 | # If you want to make your own project, don't copy this makefile but use script named `cdtc-project-setup.sh`. 2 | 3 | CDTC_ROOT=../../ 4 | PROJNAME=fastmult 5 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | UseTab: Never 2 | IndentWidth: 4 3 | ContinuationIndentWidth: 4 4 | BreakBeforeBraces: Allman 5 | AllowShortIfStatementsOnASingleLine: false 6 | IndentCaseLabels: false 7 | AlwaysBreakAfterDefinitionReturnType: All 8 | SpacesInParentheses: true -------------------------------------------------------------------------------- /cpclib/cfwi/test/fast_pixel_routine/Makefile: -------------------------------------------------------------------------------- 1 | # THIS_FILE_WILL_BE_OVERWRITTEN_BY_CDTC 2 | -include cdtc_project.conf 3 | -include $(CDTC_ROOT)/sdcc-project.Makefile 4 | failure: 5 | @echo 'Cannot locate cpc-dev-tool-chain main directory.' 6 | @false 7 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_mc_clear_inks.s: -------------------------------------------------------------------------------- 1 | .module fw_mc_clear_inks 2 | 3 | _fw_mc_clear_inks__1:: 4 | _fw_mc_clear_inks__2:: 5 | _fw_mc_clear_inks__4:: 6 | _fw_mc_clear_inks__16:: 7 | ex de,hl 8 | jp 0xBD22 ; MC CLEAR INKS 9 | 10 | -------------------------------------------------------------------------------- /tests/cfwi_test/Makefile: -------------------------------------------------------------------------------- 1 | # THIS_FILE_WILL_BE_OVERWRITTEN_BY_CDTC 2 | -include local.Makefile 3 | -include cdtc_project.conf 4 | -include $(CDTC_ROOT)/sdcc-project.Makefile 5 | failure: 6 | @echo 'Cannot locate cpc-dev-tool-chain main directory.' 7 | @false 8 | -------------------------------------------------------------------------------- /tests/xmacro/Makefile: -------------------------------------------------------------------------------- 1 | # THIS_FILE_WILL_BE_OVERWRITTEN_BY_CDTC 2 | -include local.Makefile 3 | -include cdtc_project.conf 4 | -include $(CDTC_ROOT)/sdcc-project.Makefile 5 | failure: 6 | @echo 'Cannot locate cpc-dev-tool-chain main directory.' 7 | @false 8 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_km_set_shift.s: -------------------------------------------------------------------------------- 1 | .module fw_km_set_shift 2 | 3 | _fw_km_set_shift:: 4 | ld hl,#2 5 | add hl,sp 6 | ld a,(hl) 7 | inc hl 8 | ld b,(hl) 9 | jp 0xBB2D ; KM SET SHIFT 10 | 11 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_km_set_delay.s: -------------------------------------------------------------------------------- 1 | .module fw_km_set_delay 2 | 3 | _fw_km_set_delay:: 4 | ld hl,#2 5 | add hl,sp 6 | ld a,(hl) 7 | inc hl 8 | ld l,(hl) 9 | ld h,a 10 | jp 0xBB3F ; KM SET DELAY 11 | -------------------------------------------------------------------------------- /samples/2dstars_00_bytes/Makefile: -------------------------------------------------------------------------------- 1 | # THIS_FILE_WILL_BE_OVERWRITTEN_BY_CDTC 2 | -include local.Makefile 3 | -include cdtc_project.conf 4 | -include $(CDTC_ROOT)/sdcc-project.Makefile 5 | failure: 6 | @echo 'Cannot locate cpc-dev-tool-chain main directory.' 7 | @false 8 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_km_set_control.s: -------------------------------------------------------------------------------- 1 | .module fw_km_set_control 2 | 3 | _fw_km_set_control:: 4 | ld hl,#2 5 | add hl,sp 6 | ld a,(hl) 7 | inc hl 8 | ld b,(hl) 9 | jp 0xBB33 ; KM SET CONTROL 10 | 11 | -------------------------------------------------------------------------------- /samples/2dstars_01_differential/Makefile: -------------------------------------------------------------------------------- 1 | # THIS_FILE_WILL_BE_OVERWRITTEN_BY_CDTC 2 | -include local.Makefile 3 | -include cdtc_project.conf 4 | -include $(CDTC_ROOT)/sdcc-project.Makefile 5 | failure: 6 | @echo 'Cannot locate cpc-dev-tool-chain main directory.' 7 | @false 8 | -------------------------------------------------------------------------------- /tests/cdtc_screen_basic_test/Makefile: -------------------------------------------------------------------------------- 1 | # THIS_FILE_WILL_BE_OVERWRITTEN_BY_CDTC 2 | -include local.Makefile 3 | -include cdtc_project.conf 4 | -include $(CDTC_ROOT)/sdcc-project.Makefile 5 | failure: 6 | @echo 'Cannot locate cpc-dev-tool-chain main directory.' 7 | @false 8 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_km_set_repeat.s: -------------------------------------------------------------------------------- 1 | .module fw_km_set_repeat 2 | 3 | _fw_km_set_repeat:: 4 | ld hl,#2 5 | add hl,sp 6 | ld a,(hl) 7 | inc hl 8 | ld b,(hl) 9 | jp 0xBB39 ; KM SET REPEAT 10 | 11 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_km_set_translate.s: -------------------------------------------------------------------------------- 1 | .module fw_km_set_translate 2 | 3 | _fw_km_set_translate:: 4 | ld hl,#2 5 | add hl,sp 6 | ld a,(hl) 7 | inc hl 8 | ld b,(hl) 9 | jp 0xBB27 ; KM SET TRANSLATE 10 | 11 | -------------------------------------------------------------------------------- /tests/variable_storage_class_test/Makefile: -------------------------------------------------------------------------------- 1 | # THIS_FILE_WILL_BE_OVERWRITTEN_BY_CDTC 2 | -include local.Makefile 3 | -include cdtc_project.conf 4 | -include $(CDTC_ROOT)/sdcc-project.Makefile 5 | failure: 6 | @echo 'Cannot locate cpc-dev-tool-chain main directory.' 7 | @false 8 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_cas_set_speed.s: -------------------------------------------------------------------------------- 1 | .module fw_cas_set_speed 2 | 3 | _fw_cas_set_speed:: 4 | pop af ;; return address 5 | pop hl ;; hl = length_of_half_zero_bit 6 | dec sp 7 | pop bc ;; b = precompensation 8 | push af 9 | ld a,b 10 | jp 0xBBC0 ; GRA MOVE ABSOLUTE 11 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_txt_swap_streams.s: -------------------------------------------------------------------------------- 1 | .module fw_txt_swap_streams 2 | 3 | _fw_txt_swap_streams:: 4 | ld hl,#2 5 | add hl,sp 6 | ld b,(hl) 7 | inc hl 8 | ld c,(hl) 9 | jp 0xBBB7 ; TXT SWAP STREAM 10 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_scr_set_border.s: -------------------------------------------------------------------------------- 1 | .module fw_scr_set_border 2 | 3 | _fw_scr_set_border:: 4 | ld hl,#2 5 | add hl,sp 6 | ld c,(hl) 7 | inc hl 8 | ld b,(hl) 9 | jp 0xBC38 ; SCR SET BORDER 10 | ;rather than call + ret 11 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_scr/setborder.h: -------------------------------------------------------------------------------- 1 | #ifndef __SETBORDER_H__ 2 | #define __SETBORDER_H__ 3 | 4 | void setborder( uint8_t color ) __z88dk_fastcall __preserves_regs( a, d, e, h, l, iyh, iyl ); 5 | 6 | #define setborder_or40(color) setborder( (color) | 0x40 ) 7 | 8 | #endif /* __SETBORDER_H__ */ 9 | -------------------------------------------------------------------------------- /tests/fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128/Makefile: -------------------------------------------------------------------------------- 1 | # THIS_FILE_WILL_BE_OVERWRITTEN_BY_CDTC 2 | -include local.Makefile 3 | -include cdtc_project.conf 4 | -include $(CDTC_ROOT)/sdcc-project.Makefile 5 | failure: 6 | @echo 'Cannot locate cpc-dev-tool-chain main directory.' 7 | @false 8 | -------------------------------------------------------------------------------- /tool/cpcec/bin/cpcec: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # cpcec relies on argv[0] to find its files. 4 | # This doesn't work when calling via PATH. 5 | # Have to call with explicit file name. 6 | 7 | set -xv 8 | 9 | $( SCRIPTPATH="$( realpath "$0" )" ; cd "${SCRIPTPATH%/*}" ; realpath ../cpcec/cpcec ) "$@" 10 | -------------------------------------------------------------------------------- /tests/multiplication_benchmark_02_fast_constant_time_ab_aplusb_aminusb/Makefile: -------------------------------------------------------------------------------- 1 | # THIS_FILE_WILL_BE_OVERWRITTEN_BY_CDTC 2 | -include local.Makefile 3 | -include cdtc_project.conf 4 | -include $(CDTC_ROOT)/sdcc-project.Makefile 5 | failure: 6 | @echo 'Cannot locate cpc-dev-tool-chain main directory.' 7 | @false 8 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_mc_sound_register.s: -------------------------------------------------------------------------------- 1 | .module fw_mc_sound_register 2 | 3 | _fw_mc_sound_register:: 4 | ld hl,#2 5 | add hl,sp 6 | ld a,(hl) ; sound register number 7 | 8 | inc hl 9 | ld c,(hl) ; data 10 | 11 | jp 0xBD34 ; MC SOUND REGISTER 12 | -------------------------------------------------------------------------------- /cpclib/cdtc_stdio/getchar_cpc.s: -------------------------------------------------------------------------------- 1 | .area _CODE 2 | .module getchar 3 | _getchar:: 4 | ;;_getchar_rr_s:: 5 | call 0xBB18 6 | ld l,a 7 | xor a 8 | ld h,a 9 | ret 10 | 11 | ;; _getchar_rr_dbs:: 12 | 13 | ;; ld a,e 14 | ;; call 0xBB5A 15 | ;; ret 16 | -------------------------------------------------------------------------------- /hello_world_using_sdcc/hello.h: -------------------------------------------------------------------------------- 1 | /* This is a generated header. If you modify it, remove this line and the 2 | next to prevent overwriting. */ 3 | /* may_be_overwritten */ 4 | #ifndef _hello_H_ 5 | #define _hello_H_ 6 | /* hello.c */ 7 | extern int main (void); 8 | extern void polite_wait (char *msg); 9 | #endif /* _hello_H_ */ 10 | -------------------------------------------------------------------------------- /font/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* @font-face kit by Fonts2u (http://www.fonts2u.com) */ @font-face {font-family:"Amstrad CPC464 Regular";src:url("amstrad_cpc464.eot") format("eot"),url("amstrad_cpc464.woff") format("woff"),url("amstrad_cpc464.ttf") format("truetype"),url("amstrad_cpc464.svg#Amstrad-CPC464") format("svg");font-weight:normal;font-style:normal;} 2 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_txt_get_m_table.s: -------------------------------------------------------------------------------- 1 | .module fw_txt_get_m_table 2 | 3 | _fw_txt_get_m_table:: 4 | call 0xBBAE ; TXT GET M TABLE 5 | ld e,a ; lowest character in table 6 | ld d,#0 7 | ret nc ; if no carry, no table, return with d=0 8 | dec d 9 | ret 10 | 11 | -------------------------------------------------------------------------------- /hello_world_using_sdcc/km_wait_key.s: -------------------------------------------------------------------------------- 1 | ;; Call KM_WAIT_KEY firmware routine 2 | ;; and put return value where C compiler expects it. 3 | 4 | .globl _km_wait_key 5 | 6 | ; --------------------------------- 7 | ; Function km_wait_key 8 | ; --------------------------------- 9 | _km_wait_key: 10 | call 0xBB18 11 | ;; return value in l register 12 | ld l,a 13 | ret 14 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_scr/random_with_8bit_lfsr.s: -------------------------------------------------------------------------------- 1 | .module random_with_8bit_lfsr 2 | 3 | ; z88dk_fast_call -> input value in HL 4 | _random_with_8bit_lfsr:: 5 | ld a,(hl) ; hl = pointer to value 6 | 7 | ; http://doitwireless.com/2014/06/26/8-bit-pseudo-random-number-generator/ 8 | srl a 9 | jr NC, noxor 10 | xor #0xB8 11 | noxor: 12 | ld (hl),a 13 | ld l,a 14 | ret 15 | 16 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_scr/random_with_8bit_lfsr.h: -------------------------------------------------------------------------------- 1 | #ifndef __RANDOM_WITH_8BIT_LFSR_H__ 2 | #define __RANDOM_WITH_8BIT_LFSR_H__ 3 | 4 | uint8_t random_with_8bit_lfsr( uint8_t *state ) __z88dk_fastcall __preserves_regs( b, c, d, e, iyh, iyl ); 5 | uint8_t random_with_16bit_lfsr( uint16_t *state ) __z88dk_fastcall __preserves_regs( b, d, e, iyh, iyl ); 6 | 7 | #endif /* __RANDOM_WITH_8BIT_LFSR_H__ */ 8 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_gra_set_origin.s: -------------------------------------------------------------------------------- 1 | .module fw_gra_set_origin 2 | 3 | _fw_gra_set_origin:: 4 | ld hl,#2 5 | add hl,sp 6 | ld e,(hl) 7 | 8 | inc hl 9 | ld d,(hl) 10 | 11 | inc hl 12 | ld a,(hl) 13 | 14 | inc hl 15 | ld h,(hl) 16 | 17 | ld l,a 18 | jp 0xBBC9 ; GRA SET ORIGIN 19 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_gra_win_width.s: -------------------------------------------------------------------------------- 1 | .module fw_gra_win_width 2 | 3 | _fw_gra_win_width:: 4 | ld hl,#2 5 | add hl,sp 6 | ld e,(hl) 7 | 8 | inc hl 9 | ld d,(hl) 10 | 11 | inc hl 12 | ld a,(hl) 13 | 14 | inc hl 15 | ld h,(hl) 16 | 17 | ld l,a 18 | jp 0xBBCF ; GRA WIN WIDTH 19 | 20 | -------------------------------------------------------------------------------- /hello_world_using_sdcc/cpcfirmware.h: -------------------------------------------------------------------------------- 1 | #ifndef _cpcfirmware_H_ 2 | #define _cpcfirmware_H_ 3 | 4 | /** Small wrappers (implemented in assembly) to firmware routines. 5 | 6 | The thin assembly wrapping is to pass arguments and return value 7 | between compiler convention and actual routine practices. */ 8 | 9 | extern unsigned char km_wait_key (void); 10 | #endif /* _cpcfirmware_H_ */ 11 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_gra_win_height.s: -------------------------------------------------------------------------------- 1 | .module fw_gra_win_height 2 | 3 | _fw_gra_win_height:: 4 | ld hl,#2 5 | add hl,sp 6 | ld e,(hl) 7 | 8 | inc hl 9 | ld d,(hl) 10 | 11 | inc hl 12 | ld a,(hl) 13 | 14 | inc hl 15 | ld h,(hl) 16 | 17 | ld l,a 18 | jp 0xBBD2 ; GRA WIN HEIGHT 19 | 20 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_km_get_expand.s: -------------------------------------------------------------------------------- 1 | .module fw_km_get_expand 2 | 3 | _fw_km_get_expand:: 4 | ld hl,#2 5 | add hl,sp 6 | ld a,(hl) ; expansion token for the expansion to set 7 | inc hl 8 | ld l,(hl) ; length of the string 9 | call 0xbb12 10 | ld l,a 11 | ld h,#0 12 | ret c 13 | dec h 14 | ret 15 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_scr_set_ink.s: -------------------------------------------------------------------------------- 1 | .module fw_scr_set_ink 2 | 3 | _fw_scr_set_ink:: 4 | ld hl,#2 5 | add hl,sp 6 | ld a,(hl) 7 | ld d,a 8 | inc hl 9 | ld a,(hl) 10 | ld b,a 11 | inc hl 12 | ld a,(hl) 13 | ld c,a 14 | ld a,d 15 | jp 0xBC32 ; SCR SET INK 16 | ;rather than call + ret 17 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_gra_move_absolute.s: -------------------------------------------------------------------------------- 1 | .module fw_gra_move_absolute 2 | 3 | _fw_gra_move_absolute:: 4 | ld hl,#2 5 | add hl,sp 6 | ld e,(hl) 7 | 8 | inc hl 9 | ld d,(hl) 10 | 11 | inc hl 12 | ld a,(hl) 13 | 14 | inc hl 15 | ld h,(hl) 16 | 17 | ld l,a 18 | jp 0xBBC0 ; GRA MOVE ABSOLUTE 19 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_gra_plot_absolute.s: -------------------------------------------------------------------------------- 1 | .module fw_gra_plot_absolute 2 | 3 | _fw_gra_plot_absolute:: 4 | ld hl,#2 5 | add hl,sp 6 | ld e,(hl) 7 | 8 | inc hl 9 | ld d,(hl) 10 | 11 | inc hl 12 | ld a,(hl) 13 | 14 | inc hl 15 | ld h,(hl) 16 | 17 | ld l,a 18 | jp 0xBBEA ; GRA PLOT ABSOLUTE 19 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_gra_line_absolute.s: -------------------------------------------------------------------------------- 1 | .module fw_gra_line_absolute 2 | 3 | _fw_gra_line_absolute:: 4 | ld hl,#2 5 | add hl,sp 6 | ld e,(hl) 7 | 8 | inc hl 9 | ld d,(hl) 10 | 11 | inc hl 12 | ld a,(hl) 13 | 14 | inc hl 15 | ld h,(hl) 16 | 17 | ld l,a 18 | jp 0xBBF6 ; GRA LINE ABSOLUTE 19 | 20 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_gra_move_relative.s: -------------------------------------------------------------------------------- 1 | .module fw_gra_move_relative 2 | 3 | _fw_gra_move_relative:: 4 | ld hl,#2 5 | add hl,sp 6 | ld e,(hl) 7 | 8 | inc hl 9 | ld d,(hl) 10 | 11 | inc hl 12 | ld a,(hl) 13 | 14 | inc hl 15 | ld h,(hl) 16 | 17 | ld l,a 18 | jp 0xBBC3 ; GRA MOVE RELATIVE 19 | 20 | -------------------------------------------------------------------------------- /tests/fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128/cdtc_local_machine.conf: -------------------------------------------------------------------------------- 1 | # This file in Makefile syntax is intended to contain only variables 2 | # that are specific to this machine. Do not distribute this file or put it 3 | # in version control, as its content will not be relevant on other machines. 4 | # and would cause errors. 5 | CDTC_ROOT=/org/gourichon/localdata/SG/projects/retrocomputing/code/cpc-dev-tool-chain 6 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_mc_start_program.s: -------------------------------------------------------------------------------- 1 | .module fw_mc_start_program 2 | 3 | _fw_mc_start_program:: 4 | ld hl,#2 5 | add hl,sp 6 | ld c,(hl) ; ROM selection 7 | 8 | inc hl 9 | ld a,(hl) ; entry point, LSB 10 | 11 | inc hl 12 | ld h,(hl) ; entry point, MSB 13 | 14 | ld l,a ; entry point, LSB 15 | 16 | jp 0xBD16 ; MC START PROGRAM 17 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_gra_plot_relative.s: -------------------------------------------------------------------------------- 1 | .module fw_gra_plot_relative 2 | 3 | _fw_gra_plot_relative:: 4 | ld hl,#2 5 | add hl,sp 6 | ld e,(hl) 7 | 8 | inc hl 9 | ld d,(hl) 10 | 11 | inc hl 12 | ld a,(hl) 13 | 14 | inc hl 15 | ld h,(hl) 16 | 17 | ld l,a 18 | jp 0xBBED ; GRA PLOT RELATIVE 19 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_mc_screen_offset.s: -------------------------------------------------------------------------------- 1 | .module fw_mc_screen_offset 2 | 3 | _fw_mc_screen_offset:: 4 | ld hl,#2 5 | add hl,sp 6 | ld a,(hl) ; screen base 7 | 8 | inc hl 9 | ld c,(hl) ; screen offset, LSB 10 | 11 | inc hl 12 | ld h,(hl) ; screen offset, MSB 13 | 14 | ld l,c ; screen offset, LSB 15 | 16 | jp 0xBD1F ; MC SCREEN OFFSET 17 | -------------------------------------------------------------------------------- /tests/multiplication_benchmark_02_fast_constant_time_ab_aplusb_aminusb/cdtc_local_machine.conf: -------------------------------------------------------------------------------- 1 | # This file in Makefile syntax is intended to contain only variables 2 | # that are specific to this machine. Do not distribute this file or put it 3 | # in version control, as its content will not be relevant on other machines. 4 | # and would cause errors. 5 | CDTC_ROOT=/org/gourichon/localdata/SG/projects/retrocomputing/code/cpc-dev-tool-chain 6 | -------------------------------------------------------------------------------- /tests/xmacro/testfixture.c: -------------------------------------------------------------------------------- 1 | #include "cfwi/cfwi.h" 2 | #include "colors.h" 3 | #include "stdint.h" 4 | #include 5 | 6 | uint8_t 7 | perform_test() 8 | { 9 | int color_index = 0; 10 | for ( color_index = 0; color_index < color_count; color_index++ ) 11 | { 12 | printf( "color %d is %s\015\n", color_index, 13 | color_to_colorname( color_index ) ); 14 | } 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_gra_line_relative.s: -------------------------------------------------------------------------------- 1 | .module fw_gra_line_relative 2 | 3 | _fw_gra_line_relative:: 4 | ld hl,#2 5 | add hl,sp 6 | ld e,(hl) 7 | 8 | inc hl 9 | ld d,(hl) 10 | 11 | inc hl 12 | ld a,(hl) 13 | 14 | inc hl 15 | ld h,(hl) 16 | 17 | ld l,a 18 | jp 0xBBF9 ; GRA LINE RELATIVE 19 | 20 | -------------------------------------------------------------------------------- /hello_world_using_sdcc/fillscreen.s: -------------------------------------------------------------------------------- 1 | ;; Fill the screen using a given byte. 2 | ;; Reasonably fast while keeping very short. 3 | 4 | .globl _fillscreen 5 | 6 | _fillscreen_start:: 7 | _fillscreen: 8 | ld hl,#2 9 | add hl,sp 10 | ld a,(hl) 11 | ld hl,#0xc000 12 | ld de,#0x4000 13 | 00101$: 14 | 00102$: 15 | ld (hl),a 16 | inc hl 17 | dec e 18 | jr NZ,00102$ 19 | dec d 20 | jr NZ,00101$ 21 | ret 22 | _fillscreen_end:: 23 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_cas_catalog.s: -------------------------------------------------------------------------------- 1 | .module fw_cas_catalog 2 | 3 | _fw_cas_catalog:: 4 | ex de,hl 5 | call 0xBC9B ; CAS CATALOG 6 | ld h,a 7 | ld a,#0 8 | jr nz,nozeroflag 9 | inc a ; does not affect carry 10 | nozeroflag: 11 | rlca ; propagates carry, does not change zero flag 12 | ld h,a ; thus HL gets: (errorbyte << 8 | carry | zero << 1) 13 | ret 14 | -------------------------------------------------------------------------------- /cpclib/cdtc/include/cdtc/uint16_t_as_uint8_t_pair.h: -------------------------------------------------------------------------------- 1 | #ifndef __uint16_t_as_uint8_t_pair_t_h__ 2 | #define __uint16_t_as_uint8_t_pair_t_h__ 3 | 4 | typedef union uint16_t_as_uint8_t_pair_t 5 | { 6 | uint16_t as_uint16_t; 7 | struct 8 | { 9 | uint8_t low; 10 | uint8_t high; 11 | } as_uint8_pair; 12 | } uint16_t_as_uint8_t_pair_t; 13 | 14 | #endif /* __uint16_t_as_uint8_t_pair_t_h__ */ 15 | -------------------------------------------------------------------------------- /tests/cdtc_screen_basic_test/printer.h: -------------------------------------------------------------------------------- 1 | #ifndef __MULBENCH_TEST_PRINT_H__ 2 | #define __MULBENCH_TEST_PRINT_H__ foo 3 | 4 | #include "stdint.h" 5 | 6 | void printer_uint16( uint16_t n ); 7 | void printer_uint8_as_hex_with_prefix( uint8_t v ) __z88dk_fastcall; 8 | void printer_uint16_as_hex_with_prefix( uint16_t v ) __z88dk_fastcall; 9 | void printer_uint32_as_hex_with_prefix( uint32_t v ) __z88dk_fastcall; 10 | 11 | #endif /* __MULBENCH_TEST_PRINT_H__ */ 12 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_gra_test_absolute.s: -------------------------------------------------------------------------------- 1 | .module fw_gra_test_absolute 2 | 3 | _fw_gra_test_absolute:: 4 | ld hl,#2 5 | add hl,sp 6 | ld e,(hl) 7 | 8 | inc hl 9 | ld d,(hl) 10 | 11 | inc hl 12 | ld a,(hl) 13 | 14 | inc hl 15 | ld h,(hl) 16 | 17 | ld l,a 18 | call 0xBBF0 ; GRA TEST ABSOLUTE 19 | ld l,a 20 | ret 21 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_gra_test_relative.s: -------------------------------------------------------------------------------- 1 | .module fw_gra_test_relative 2 | 3 | _fw_gra_test_relative:: 4 | ld hl,#2 5 | add hl,sp 6 | ld e,(hl) 7 | 8 | inc hl 9 | ld d,(hl) 10 | 11 | inc hl 12 | ld a,(hl) 13 | 14 | inc hl 15 | ld h,(hl) 16 | 17 | ld l,a 18 | call 0xBBF3 ; GRA TEST RELATIVE 19 | ld l,a 20 | ret 21 | -------------------------------------------------------------------------------- /tests/cfwi_test/cfwitest.c: -------------------------------------------------------------------------------- 1 | #include "cfwi/cfwi.h" 2 | 3 | void 4 | main() 5 | { 6 | { 7 | static unsigned char x, y; 8 | 9 | for ( x = 0; x < 255; x++ ) 10 | { 11 | 12 | for ( y = 0; y < 255; y++ ) 13 | { 14 | if ( ( x ^ y ) > x ) 15 | { 16 | fw_gra_plot_absolute( 2 * x + 1, 2 * y + 1 ); 17 | } 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_km_exp_buffer.s: -------------------------------------------------------------------------------- 1 | .module fw_km_exp_buffer 2 | 3 | _fw_km_exp_buffer:: 4 | ld hl,#2 5 | add hl,sp 6 | ld e,(hl) ; buffer address LSB 7 | inc hl 8 | ld d,(hl) ; buffer address MSB 9 | inc hl 10 | ld a,(hl) ; buffer bytecount LSB 11 | inc hl 12 | ld h,(hl) ; buffer bytecount MSB 13 | ld l,a 14 | call 0xbb15 15 | ld l,#0 16 | ret c 17 | dec l 18 | ret 19 | 20 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_scr/random_with_16bit_lfsr.s: -------------------------------------------------------------------------------- 1 | .module random_with_16bit_lfsr 2 | 3 | ; z88dk_fast_call -> input value in HL 4 | _random_with_16bit_lfsr:: 5 | ld c,(hl) ; hl = pointer to value, c=lsB 6 | inc hl 7 | ld a,(hl) ; a=msB 8 | 9 | ; https://en.wikipedia.org/wiki/Linear-feedback_shift_register#Galois_LFSRs 10 | srl a 11 | rr c 12 | jr NC, noxor 13 | xor #0xB4 14 | noxor: 15 | ld (hl),a 16 | dec hl 17 | ld (hl),c 18 | ld l,c 19 | ld h,a 20 | ret 21 | -------------------------------------------------------------------------------- /tests/fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128/printer.h: -------------------------------------------------------------------------------- 1 | #ifndef __MULBENCH_TEST_PRINT_H__ 2 | #define __MULBENCH_TEST_PRINT_H__ foo 3 | 4 | #include "stdint.h" 5 | 6 | void printer_uint16( uint16_t n ); 7 | void printer_uint8_as_hex_with_prefix( uint8_t v ) __z88dk_fastcall; 8 | void printer_uint16_as_hex_with_prefix( uint16_t v ) __z88dk_fastcall; 9 | void printer_uint32_as_hex_with_prefix( uint32_t v ) __z88dk_fastcall; 10 | 11 | #endif /* __MULBENCH_TEST_PRINT_H__ */ 12 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_txt_win_enable.s: -------------------------------------------------------------------------------- 1 | .module fw_txt_win_enable 2 | 3 | _fw_txt_win_enable:: 4 | ld hl,#2 5 | add hl,sp 6 | ld b,(hl) ; left -> h 7 | inc hl 8 | ld d,(hl) ; right 9 | inc hl 10 | ld c,(hl) ; top -> l 11 | inc hl 12 | ld e,(hl) ; bottom 13 | ld h,b 14 | ld l,c 15 | jp 0xBB66 ; TXT WIN ENABLE 16 | 17 | -------------------------------------------------------------------------------- /tests/multiplication_benchmark_02_fast_constant_time_ab_aplusb_aminusb/printer.h: -------------------------------------------------------------------------------- 1 | #ifndef __MULBENCH_TEST_PRINT_H__ 2 | #define __MULBENCH_TEST_PRINT_H__ foo 3 | 4 | #include "stdint.h" 5 | 6 | void printer_uint16( uint16_t n ); 7 | void printer_uint8_as_hex_with_prefix( uint8_t v ) __z88dk_fastcall; 8 | void printer_uint16_as_hex_with_prefix( uint16_t v ) __z88dk_fastcall; 9 | void printer_uint32_as_hex_with_prefix( uint32_t v ) __z88dk_fastcall; 10 | 11 | #endif /* __MULBENCH_TEST_PRINT_H__ */ 12 | -------------------------------------------------------------------------------- /cpclib/cfwi/local.Makefile: -------------------------------------------------------------------------------- 1 | local-doc: coverage.html 2 | 3 | coverage.html: all_fw_calls_official_list.csv firmware_coverage.sh cfwi.lib 4 | time bash firmware_coverage.sh 5 | 6 | all_fw_calls_official_list.csv: s968se15.pdf 7 | pdfgrep '^[0-9][0-9]*:' "$<" | sed 's/^\([0-9]*\): \(.*[^ ]\) *#\(.*\)$$/\1,\2,\3/' >$@.tmp && mv -vf $@.tmp $@ 8 | 9 | s968se15.pdf: 10 | wget -S http://cpctech.cpcwiki.de/docs/manual/s968se15.pdf 11 | 12 | local-clean: 13 | rm -f coverage.html all_fw_calls_official_list.csv 14 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/cfwi_txt_str0_output.s: -------------------------------------------------------------------------------- 1 | 2 | ; void cfwi_txt_str0_output (const char* s); 3 | ; Output a NUL terminated string at the current cursor position 4 | ; TESTED 5 | 6 | _cfwi_txt_str0_output:: 7 | ld hl,#2 8 | add hl,sp 9 | ld e,(hl) 10 | inc hl 11 | ld d,(hl) 12 | 13 | cputs$: 14 | ld a,(de) 15 | cp #0 16 | ret z 17 | call 0xBB5A ; TXT OUTPUT 18 | inc de 19 | jr cputs$ 20 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_km_set_expand.s: -------------------------------------------------------------------------------- 1 | .module fw_km_set_expand 2 | 3 | _fw_km_set_expand:: 4 | ld hl,#2 5 | add hl,sp 6 | ld b,(hl) ; expansion token for the expansion to set 7 | inc hl 8 | ld c,(hl) ; length of the string 9 | inc hl 10 | ld a,(hl) ; address of the string, LSB 11 | inc hl 12 | ld h,(hl) ; address of the string, MSB 13 | ld l,a 14 | call 0xbb0f 15 | ld l,#0 16 | ret c 17 | inc l 18 | ret 19 | -------------------------------------------------------------------------------- /hello_world_using_z88dk/hello.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int 4 | fillscreen (unsigned char a) 5 | { 6 | unsigned char *p = 0xc000; 7 | unsigned short l; 8 | 9 | for (l = 0; l < 16384; l++) { 10 | *p = a; 11 | p++; 12 | } 13 | } 14 | 15 | int 16 | main (int argc, char **argv) 17 | { 18 | printf ("Hello world!\n"); 19 | { 20 | char c; 21 | 22 | for (c = 0; c <= 255; c++) { 23 | fillscreen (c); 24 | } 25 | } 26 | /* for (a=32; a<256; a++) { putc(a, stdout); } */ 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_txt_set_matrix.s: -------------------------------------------------------------------------------- 1 | .module fw_txt_set_matrix 2 | 3 | _fw_txt_set_matrix:: 4 | ld hl,#2 5 | add hl,sp 6 | ld a,(hl) ; character to redefine 7 | inc hl 8 | ld e,(hl) ; LSB of buffer holding new character data 9 | inc hl 10 | ld h,(hl) ; MSB of buffer holding new character data 11 | ld l,e 12 | call 0xbba8 13 | ld a,#0 14 | ret nc 15 | dec a 16 | ret 17 | -------------------------------------------------------------------------------- /hello_world_using_z88dk/arithtest.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int 4 | fillscreen (unsigned char a) 5 | { 6 | unsigned char *p = 0xc000; 7 | unsigned short l; 8 | 9 | for (l = 0; l < 16384; l++) { 10 | *p = a; 11 | p++; 12 | } 13 | } 14 | 15 | int 16 | main (int argc, char **argv) 17 | { 18 | printf ("Hello world\n"); 19 | 20 | if (2+2==4) 21 | { 22 | printf ("Ok.\n"); 23 | } else 24 | { 25 | printf ("Err.\n"); 26 | } 27 | 28 | { 29 | char c; 30 | 31 | for (c = 0; c <= 255; c++) { 32 | fillscreen (c); 33 | } 34 | } 35 | /* for (a=32; a<256; a++) { putc(a, stdout); } */ 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /font/README.md: -------------------------------------------------------------------------------- 1 | # Font credit 2 | 3 | Font looks like the original font by Amstrad Consumer Electronics and/or Locomotive Software. 4 | 5 | Font files found via [https://i.got.nothing.to/blog/](https://i.got.nothing.to/blog/). 6 | 7 | Font mentioned on https://fonts2u.com/amstrad-cpc464-regular.font 8 | which mentions "Freeware" and credits 9 | [Wesley Clarke](https://fonts2u.com/font-designers/wesley-clarke.html). 10 | 11 | SVG variant contains this text: 12 | 13 | Created by FontForge 20110222 at Mon Mar 7 13:05:32 2011 14 | By www-data 15 | Copyright Wesley Clarke 2009 16 | 17 | I have no more information. 18 | -------------------------------------------------------------------------------- /cpclib/cdtc/include/cdtc/fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_256__xmy_lt_256.h: -------------------------------------------------------------------------------- 1 | #ifndef __fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_256__xmy_lt_256_h__ 2 | #define __fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_256__xmy_lt_256_h__ 3 | 4 | #include 5 | 6 | void fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_256__xmy_lt_256_fill_table(); 7 | 8 | extern uint8_t fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_256__xmy_lt_256_table[256]; 9 | 10 | uint8_t fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_256__xmy_lt_256( uint16_t xy ) 11 | __z88dk_fastcall __preserves_regs( c, iyh, iyl ); 12 | 13 | #endif /* __fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_256__xmy_lt_256_h__ */ 14 | -------------------------------------------------------------------------------- /cpclib/cdtc_stdio/putchar_cpc.s: -------------------------------------------------------------------------------- 1 | ;; Plug a putchar implementation suitable for the CPC. 2 | ;; From http://www.cpcmania.com/Docs/Programming/Introduction_to_programming_in_SDCC_Compiling_and_testing_a_Hello_World.htm 3 | 4 | ;; FILE: putchar.s 5 | ;; Modified to suit execution on the Amstrad CPC 6 | ;; by H. Hansen 2003 7 | ;; Original lines has been marked out! 8 | 9 | .module putchar 10 | .area _CODE 11 | _putchar:: 12 | _putchar_rr_s:: 13 | ld hl,#2 14 | add hl,sp 15 | 16 | ld a,(hl) 17 | call 0xBB5A 18 | ret 19 | 20 | _putchar_rr_dbs:: 21 | 22 | ld a,e 23 | call 0xBB5A 24 | ret 25 | -------------------------------------------------------------------------------- /tool/scripts/list_symbols_and_deltas.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | OLDADDRDEC=0 4 | while read -u3 ADDR SYMBOL MODULE 5 | do 6 | ADDRDEC=$( printf %d 0x$ADDR ) 7 | if (( ADDRDEC < OLDADDRDEC )) 8 | then 9 | break 10 | fi 11 | if (( OLDADDRDEC > 0 )) 12 | then SIZE=$(( $ADDRDEC - $OLDADDRDEC )) 13 | echo -e "$OLDADDR $( printf %6d $SIZE ) \t $OLDMODULE \t $OLDSYMBOL" 14 | fi 15 | OLDADDRDEC=$ADDRDEC 16 | OLDADDR=$ADDR 17 | OLDMODULE=$MODULE 18 | OLDSYMBOL=$SYMBOL 19 | done 3< <( grep -A 1000 ^_CODE ${1?please provide name of a .map file} | sed -n 's/^ 0000\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\) \([^ ]*\) *\([^ ]*\)$/\1 \2 \3/p' ) 20 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/gra_plot_absolute/testfixture.c: -------------------------------------------------------------------------------- 1 | #include "cfwi/cfwi.h" 2 | #include "stdint.h" 3 | 4 | uint8_t perform_test() 5 | { 6 | { 7 | static unsigned char x, y; 8 | 9 | for ( x = 0; x < 255; x++ ) 10 | { 11 | 12 | for ( y = 0; y < 255; y++ ) 13 | { 14 | if ( ( x ^ y ) > x ) 15 | { 16 | fw_gra_plot_absolute( 2 * x + 1, 2 * y + 1 ); 17 | } 18 | } 19 | 20 | } 21 | } 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /documentation/TODO.md: -------------------------------------------------------------------------------- 1 | [Back to main documentation](../README.md) 2 | 3 | ### Possible evolutions 4 | 5 | These would be possible only with your help: 6 | 7 | * integration with major IDEs (any IDE knowing about makefiles and gcc-style output already works) 8 | * rules to automatically convert resources files into formats suitable for inclusions in projects (e.g. PNG image) 9 | * run emulator automatically ? 10 | * cleanly separate portable C and platform-compiler-output-specific parts, to ease not getting trapped in a particular toolset 11 | * offer multi-platform build: run your portable C part as an actual native app (makes sense only if most app logic is in portable C) 12 | 13 | [Back to main documentation](../README.md) 14 | -------------------------------------------------------------------------------- /tests/xmacro/testbench.c: -------------------------------------------------------------------------------- 1 | #include "cfwi/cfwi.h" 2 | #include "stdint.h" 3 | 4 | uint8_t perform_test(); 5 | 6 | void 7 | main() 8 | { 9 | uint32_t time_before, time_after; 10 | 11 | fw_mc_send_printer( '0' ); 12 | 13 | time_before = fw_kl_time_please(); 14 | 15 | { 16 | uint8_t rc = perform_test(); 17 | fw_mc_send_printer( '1' ); 18 | fw_mc_send_printer( rc ); 19 | } 20 | 21 | time_after = fw_kl_time_please(); 22 | 23 | { 24 | uint32_t time_delta = time_after - time_before; 25 | fw_mc_send_printer( time_delta ); 26 | } 27 | 28 | fw_mc_send_printer( '2' ); 29 | fw_mc_wait_flyback(); 30 | } 31 | 32 | void 33 | rendezvous_point() 34 | { 35 | } 36 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.cpc 2 | *.tmp 3 | \#*# 4 | .#* 5 | *.html 6 | *.disabled 7 | *.bak 8 | 9 | *~ 10 | *.asm 11 | *.bak 12 | *.bin 13 | *.bin.log 14 | *.binamsdos 15 | *.binamsdos.log 16 | build_config.inc 17 | *.buildtree/ 18 | *.cdt 19 | download 20 | *.downloadlog.txt 21 | *.dsk 22 | *.ihx 23 | *.installtree/ 24 | *.lib 25 | *.lk 26 | *.lst 27 | *.map 28 | *.noi 29 | *.opt 30 | *.ref 31 | *.rel 32 | *.rst 33 | *.sym 34 | *.tar.bz2 35 | *.tgz 36 | *.tmp 37 | *.voc 38 | 39 | printer.txt 40 | *.dump*_*.dot 41 | *~HEAD 42 | *~junk 43 | *~Junk 44 | 45 | *.binamsdos 46 | *.binamsdos.log 47 | *.orig 48 | *.au 49 | **/debug.txt 50 | **/wGui.log 51 | .build_dependencies_checked 52 | *.generated* 53 | z80_profiling_heat_map 54 | test_verdict.txt 55 | -------------------------------------------------------------------------------- /tests/cdtc_screen_basic_test/testbench.c: -------------------------------------------------------------------------------- 1 | #include "cfwi/cfwi.h" 2 | #include "stdint.h" 3 | 4 | uint8_t perform_test(); 5 | 6 | void 7 | main() 8 | { 9 | uint32_t time_before, time_after; 10 | 11 | fw_mc_send_printer( '0' ); 12 | 13 | time_before = fw_kl_time_please(); 14 | 15 | { 16 | uint8_t rc = perform_test(); 17 | fw_mc_send_printer( '1' ); 18 | fw_mc_send_printer( rc ); 19 | } 20 | 21 | time_after = fw_kl_time_please(); 22 | 23 | { 24 | uint32_t time_delta = time_after - time_before; 25 | fw_mc_send_printer( time_delta ); 26 | } 27 | 28 | fw_mc_send_printer( '2' ); 29 | fw_mc_wait_flyback(); 30 | } 31 | 32 | void 33 | rendezvous_point() 34 | { 35 | } 36 | -------------------------------------------------------------------------------- /tests/fctdd_256_times_256_divided_by_lp_257_plus_y8_rp/fctdd_256_times_256_divided_by_lp_257_plus_y8_rp_test.c: -------------------------------------------------------------------------------- 1 | #include "fctdd_256_times_256_divided_by_lp_257_plus_y8_rp.h" 2 | #include "print.h" 3 | #include 4 | #include 5 | 6 | void 7 | fctdd_256_times_256_divided_by_lp_257_plus_y8_rp_test( void ) 8 | { 9 | uint8_t x = 0; 10 | 11 | do 12 | { 13 | { 14 | uint8_t y = 15 | fctdd_256_times_256_divided_by_lp_257_plus_y8_rp_table[x]; 16 | print_uint8_as_hex( 17 | fctdd_256_times_256_divided_by_lp_257_plus_y8_rp_table[x] ); 18 | fw_gra_plot_absolute( x << 1, ( y - 56 ) << 1 ); 19 | } 20 | ++x; 21 | } while ( x != 0 ); 22 | } 23 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/trivial_function/local.Makefile: -------------------------------------------------------------------------------- 1 | test_verdict.txt: test_result_raw.txt 2 | ( if diff test_result_raw.txt test_result_reference.txt ; then echo PASS ; else echo FAIL ; fi | tee $@.tmp && mv -vf $@.tmp $@ ; ) 3 | # Make target should succeed even if test fails. 4 | 5 | test_result_raw.txt: cap32_fast.cfg dsk 6 | ( . $(CDTC_ENV_FOR_CAPRICE32) ; export SDL_VIDEODRIVER=dummy ; cap32_once $(DSKNAME) -c cap32_fast.cfg -a 'run"$(PROJNAME)' && mv -vf printer.dat $@ ) 7 | 8 | cap32_fast.cfg: $(CDTC_ENV_FOR_CAPRICE32) local.Makefile 9 | sed -e "s|speed=.*|speed=256|" -e "s|printer=.*|printer=1|" <$(CDTC_ROOT)/tool/caprice32/cap32_local.cfg >cap32_fast.cfg 10 | 11 | extra_clean: clean distclean 12 | rm -f cap32_fast.cfg test_result_raw.txt test_verdict.txt 13 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fast_pixel_routine/local.Makefile: -------------------------------------------------------------------------------- 1 | test_verdict.txt: test_result_raw.txt 2 | ( if diff test_result_raw.txt test_result_reference.txt ; then echo PASS ; else echo FAIL ; fi | tee $@.tmp && mv -vf $@.tmp $@ ; ) 3 | # Make target should succeed even if test fails. 4 | 5 | test_result_raw.txt: cap32_fast.cfg dsk 6 | ( . $(CDTC_ENV_FOR_CAPRICE32) ; export SDL_VIDEODRIVER=dummy ; cap32_once $(DSKNAME) -c cap32_fast.cfg -a 'run"$(PROJNAME)' && mv -vf printer.dat $@ ) 7 | 8 | cap32_fast.cfg: $(CDTC_ENV_FOR_CAPRICE32) local.Makefile 9 | sed -e "s|speed=.*|speed=256|" -e "s|printer=.*|printer=1|" <$(CDTC_ROOT)/tool/caprice32/cap32_local.cfg >cap32_fast.cfg 10 | 11 | extra_clean: clean distclean 12 | rm -f cap32_fast.cfg test_result_raw.txt test_verdict.txt 13 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/gra_plot_absolute/local.Makefile: -------------------------------------------------------------------------------- 1 | test_verdict.txt: test_result_raw.txt 2 | ( if diff test_result_raw.txt test_result_reference.txt ; then echo PASS ; else echo FAIL ; fi | tee $@.tmp && mv -vf $@.tmp $@ ; ) 3 | # Make target should succeed even if test fails. 4 | 5 | test_result_raw.txt: cap32_fast.cfg dsk 6 | ( . $(CDTC_ENV_FOR_CAPRICE32) ; export SDL_VIDEODRIVER=dummy ; cap32_once $(DSKNAME) -c cap32_fast.cfg -a 'run"$(PROJNAME)' && mv -vf printer.dat $@ ) 7 | 8 | cap32_fast.cfg: $(CDTC_ENV_FOR_CAPRICE32) local.Makefile 9 | sed -e "s|speed=.*|speed=256|" -e "s|printer=.*|printer=1|" <$(CDTC_ROOT)/tool/caprice32/cap32_local.cfg >cap32_fast.cfg 10 | 11 | extra_clean: clean distclean 12 | rm -f cap32_fast.cfg test_result_raw.txt test_verdict.txt 13 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_cas/testbench.c: -------------------------------------------------------------------------------- 1 | #include "stdint.h" 2 | #include "cfwi/cfwi.h" 3 | 4 | uint8_t perform_test( void ); 5 | 6 | void 7 | main() 8 | { 9 | uint32_t time_before, time_after; 10 | 11 | fw_mc_send_printer( '0' ); 12 | 13 | time_before = fw_kl_time_please(); 14 | 15 | { 16 | uint8_t rc = perform_test(); 17 | 18 | fw_mc_send_printer( '1' ); 19 | fw_mc_send_printer( rc ); 20 | } 21 | 22 | time_after = fw_kl_time_please(); 23 | 24 | { 25 | uint32_t time_delta = time_after - time_before; 26 | 27 | fw_mc_send_printer( time_delta ); 28 | } 29 | 30 | fw_mc_send_printer( '2' ); 31 | fw_mc_wait_flyback(); 32 | fw_mc_wait_flyback(); 33 | } 34 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_km/testbench.c: -------------------------------------------------------------------------------- 1 | #include "stdint.h" 2 | #include "cfwi/cfwi.h" 3 | 4 | uint8_t perform_test( void ); 5 | 6 | void 7 | main() 8 | { 9 | uint32_t time_before, time_after; 10 | 11 | fw_mc_send_printer( '0' ); 12 | 13 | time_before = fw_kl_time_please(); 14 | 15 | { 16 | uint8_t rc = perform_test(); 17 | 18 | fw_mc_send_printer( '1' ); 19 | fw_mc_send_printer( rc ); 20 | } 21 | 22 | time_after = fw_kl_time_please(); 23 | 24 | { 25 | uint32_t time_delta = time_after - time_before; 26 | 27 | fw_mc_send_printer( time_delta ); 28 | } 29 | 30 | fw_mc_send_printer( '2' ); 31 | fw_mc_wait_flyback(); 32 | fw_mc_wait_flyback(); 33 | } 34 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_scr/testbench.c: -------------------------------------------------------------------------------- 1 | #include "stdint.h" 2 | #include "cfwi/cfwi.h" 3 | 4 | uint8_t perform_test( void ); 5 | 6 | void 7 | main() 8 | { 9 | uint32_t time_before, time_after; 10 | 11 | fw_mc_send_printer( '0' ); 12 | 13 | time_before = fw_kl_time_please(); 14 | 15 | { 16 | uint8_t rc = perform_test(); 17 | 18 | fw_mc_send_printer( '1' ); 19 | fw_mc_send_printer( rc ); 20 | } 21 | 22 | time_after = fw_kl_time_please(); 23 | 24 | { 25 | uint32_t time_delta = time_after - time_before; 26 | 27 | fw_mc_send_printer( time_delta ); 28 | } 29 | 30 | fw_mc_send_printer( '2' ); 31 | fw_mc_wait_flyback(); 32 | fw_mc_wait_flyback(); 33 | } 34 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_txt/testbench.c: -------------------------------------------------------------------------------- 1 | #include "stdint.h" 2 | #include "cfwi/cfwi.h" 3 | 4 | uint8_t perform_test( void ); 5 | 6 | void 7 | main() 8 | { 9 | uint32_t time_before, time_after; 10 | 11 | fw_mc_send_printer( '0' ); 12 | 13 | time_before = fw_kl_time_please(); 14 | 15 | { 16 | uint8_t rc = perform_test(); 17 | 18 | fw_mc_send_printer( '1' ); 19 | fw_mc_send_printer( rc ); 20 | } 21 | 22 | time_after = fw_kl_time_please(); 23 | 24 | { 25 | uint32_t time_delta = time_after - time_before; 26 | 27 | fw_mc_send_printer( time_delta ); 28 | } 29 | 30 | fw_mc_send_printer( '2' ); 31 | fw_mc_wait_flyback(); 32 | fw_mc_wait_flyback(); 33 | } 34 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fast_pixel_routine/testbench.c: -------------------------------------------------------------------------------- 1 | #include "stdint.h" 2 | #include "cfwi/cfwi.h" 3 | 4 | uint8_t perform_test( void ); 5 | 6 | void 7 | main() 8 | { 9 | uint32_t time_before, time_after; 10 | 11 | fw_mc_send_printer( '0' ); 12 | 13 | time_before = fw_kl_time_please(); 14 | 15 | { 16 | uint8_t rc = perform_test(); 17 | 18 | fw_mc_send_printer( '1' ); 19 | fw_mc_send_printer( rc ); 20 | } 21 | 22 | time_after = fw_kl_time_please(); 23 | 24 | { 25 | uint32_t time_delta = time_after - time_before; 26 | 27 | fw_mc_send_printer( time_delta ); 28 | } 29 | 30 | fw_mc_send_printer( '2' ); 31 | fw_mc_wait_flyback(); 32 | fw_mc_wait_flyback(); 33 | } 34 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/gra_plot_absolute/testbench.c: -------------------------------------------------------------------------------- 1 | #include "stdint.h" 2 | #include "cfwi/cfwi.h" 3 | 4 | uint8_t perform_test( void ); 5 | 6 | void 7 | main() 8 | { 9 | uint32_t time_before, time_after; 10 | 11 | fw_mc_send_printer( '0' ); 12 | 13 | time_before = fw_kl_time_please(); 14 | 15 | { 16 | uint8_t rc = perform_test(); 17 | 18 | fw_mc_send_printer( '1' ); 19 | fw_mc_send_printer( rc ); 20 | } 21 | 22 | time_after = fw_kl_time_please(); 23 | 24 | { 25 | uint32_t time_delta = time_after - time_before; 26 | 27 | fw_mc_send_printer( time_delta ); 28 | } 29 | 30 | fw_mc_send_printer( '2' ); 31 | fw_mc_wait_flyback(); 32 | fw_mc_wait_flyback(); 33 | } 34 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/trivial_function/testbench.c: -------------------------------------------------------------------------------- 1 | #include "stdint.h" 2 | #include "cfwi/cfwi.h" 3 | 4 | uint8_t perform_test( void ); 5 | 6 | void 7 | main() 8 | { 9 | uint32_t time_before, time_after; 10 | 11 | fw_mc_send_printer( '0' ); 12 | 13 | time_before = fw_kl_time_please(); 14 | 15 | { 16 | uint8_t rc = perform_test(); 17 | 18 | fw_mc_send_printer( '1' ); 19 | fw_mc_send_printer( rc ); 20 | } 21 | 22 | time_after = fw_kl_time_please(); 23 | 24 | { 25 | uint32_t time_delta = time_after - time_before; 26 | 27 | fw_mc_send_printer( time_delta ); 28 | } 29 | 30 | fw_mc_send_printer( '2' ); 31 | fw_mc_wait_flyback(); 32 | fw_mc_wait_flyback(); 33 | } 34 | -------------------------------------------------------------------------------- /git_configure_this_local_repo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "This script applies local configuration " 4 | echo "that will avoid headeaches when updating in the future." 5 | 6 | 7 | # Config 8 | 9 | 10 | # Show changes in submodules by default 11 | git config status.submoduleSummary true 12 | 13 | # Show diff in submodules by default 14 | git config diff.submodule log 15 | 16 | # When pushing, also push submodules 17 | git config push.recurseSubmodules on-demand 18 | 19 | # All operations on submodules also propagates to their submodules, if any (currently, none). 20 | git config --global submodule.recurse true 21 | 22 | 23 | # Action 24 | 25 | 26 | # In case submodules URL have changed, heed it. 27 | git submodule sync --recursive 28 | 29 | # Actually update local files based on what they should be 30 | git submodule update --recursive 31 | -------------------------------------------------------------------------------- /maintainer-tools/test_custom_project.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eu 4 | 5 | set -xv 6 | 7 | cd "$(dirname "$(readlink -f "$0")" )" 8 | 9 | SCRIPTDIR="$PWD" 10 | 11 | cd .. 12 | 13 | export CDTC_ROOT="$PWD" 14 | 15 | cd "$SCRIPTDIR" 16 | 17 | PROJDIRNAME=my_cdct_project 18 | 19 | if [[ -e "${PROJDIRNAME:?}" ]] 20 | then 21 | mv -v --backup=numbered "${PROJDIRNAME:?}" "${PROJDIRNAME:?}".bak 22 | fi 23 | 24 | mkdir "${PROJDIRNAME:?}" 25 | 26 | cd "${PROJDIRNAME:?}" 27 | 28 | "${CDTC_ROOT}"/cdtc-project-setup.sh . 29 | 30 | { echo "#include " ; echo "int main() { printf(\"Hello World, hello ${USER:-you}.\\n\"); while (1) {} ; return 0; }" ; } >hello.c 31 | 32 | make dsk 33 | 34 | #{ echo "#include " ; echo "int main() { cpc_PrintStr(\"Hello World, hello ${USER:-you}.\\n\"); while (1) {} ; return 0; }" ; } >hello.c 35 | 36 | #make 37 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_txt_set_cursor.s: -------------------------------------------------------------------------------- 1 | .module fw_txt_set_cursor 2 | 3 | _fw_txt_set_cursor:: 4 | ld hl,#2 5 | add hl,sp 6 | ld a,(hl) 7 | inc hl 8 | ld h,(hl) 9 | ld l,a 10 | jp 0xBB75 ; TXT SET CURSOR 11 | 12 | ;; { 13 | ;; int x; 14 | 15 | ;; for ( x = 1; x <= 10; x++ ) 16 | ;; { 17 | ;; int y; 18 | 19 | ;; for ( y = 1; y <= 25; y++ ) 20 | ;; { 21 | ;; fw_txt_set_cursor( y, x << 2 ); 22 | ;; pr_uint( y ); 23 | ;; fw_txt_wr_char( ',' ); 24 | ;; pr_uint( x ); 25 | ;; } 26 | ;; } 27 | ;; } 28 | 29 | -------------------------------------------------------------------------------- /cpclib/cdtc/include/cdtc/fctdd_256_times_256_divided_by_lp_257_plus_y8_rp.h: -------------------------------------------------------------------------------- 1 | #ifndef __fctdd_256_times_256_divided_by_lp_257_plus_y8_rp_h__ 2 | #define __fctdd_256_times_256_divided_by_lp_257_plus_y8_rp_h__ 3 | 4 | #include 5 | 6 | void fctdd_256_times_256_divided_by_lp_257_plus_y8_rp_fill_table() 7 | __preserves_regs( iyh, iyl ); 8 | 9 | // We do not define it here because it conflicts if you define it yourself in C at a constant address, like: 10 | // uint8_t __at(0x1200) fctdd_256_times_256_divided_by_lp_257_plus_y8_rp_table[256]; 11 | // this is why the line below is commented out: 12 | // extern uint8_t fctdd_256_times_256_divided_by_lp_257_plus_y8_rp_table[256]; 13 | 14 | uint8_t 15 | fctdd_256_times_256_divided_by_lp_257_plus_y8_rp( uint16_t xy ) __z88dk_fastcall 16 | __preserves_regs( c, iyh, iyl ); 17 | 18 | #endif /* __fctdd_256_times_256_divided_by_lp_257_plus_y8_rp_h__ */ 19 | -------------------------------------------------------------------------------- /tool/rom/download_roms.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eu 4 | 5 | for ROM_URL in "${@}" 6 | do 7 | ERRORS="" 8 | ROMFILENAME="$(basename "$ROM_URL")" 9 | echo 10 | if 11 | unzip -lv "$ROMFILENAME" 2>/dev/null >/dev/null 12 | then 13 | echo "***** Skipping download already present and valid: $ROMFILENAME" 14 | echo 15 | else 16 | if ! wget -S ${ROM_URL} -O "${ROMFILENAME}.tmp" 17 | then 18 | echo >&2 "WARNING: download failed ${ROM_URL}" 19 | ERRORS+="${ROM_URL} " 20 | continue 21 | fi 22 | 23 | if unzip -lv "$ROMFILENAME.tmp" 24 | then 25 | mv -vf "${ROMFILENAME}.tmp" "${ROMFILENAME}" 26 | else 27 | echo >&2 "WARNING: cannot confirm valid archive $ROMFILENAME.tmp" 28 | fi 29 | fi 30 | done 31 | 32 | if [[ -z "${ERRORS}" ]] 33 | then 34 | exit 0 35 | else 36 | echo >&2 "WARNING: download failed $ERRORS" 37 | exit 1 38 | fi 39 | 40 | -------------------------------------------------------------------------------- /tests/fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128/testbench.c: -------------------------------------------------------------------------------- 1 | #include "cfwi/cfwi.h" 2 | #include "printer.h" 3 | #include "stdint.h" 4 | 5 | uint8_t perform_test(); 6 | 7 | void 8 | main() 9 | { 10 | uint32_t time_before, time_after; 11 | 12 | fw_mc_send_printer( '0' ); 13 | fw_mc_send_printer( '\n' ); 14 | 15 | time_before = fw_kl_time_please(); 16 | 17 | { 18 | uint8_t rc = perform_test(); 19 | fw_mc_send_printer( '1' ); 20 | fw_mc_send_printer( rc ); 21 | } 22 | 23 | time_after = fw_kl_time_please(); 24 | 25 | { 26 | uint32_t time_delta = time_after - time_before; 27 | fw_mc_send_printer( 'd' ); 28 | fw_mc_send_printer( '=' ); 29 | printer_uint32_as_hex_with_prefix( time_delta ); 30 | } 31 | 32 | fw_mc_send_printer( '2' ); 33 | fw_mc_wait_flyback(); 34 | } 35 | 36 | void 37 | rendezvous_point() 38 | { 39 | } 40 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_txt_set_m_table.s: -------------------------------------------------------------------------------- 1 | .module fw_txt_set_m_table 2 | 3 | _fw_txt_set_m_table:: 4 | ld hl,#5 5 | add hl,sp 6 | ld e,(hl) ; lowest affected character 7 | dec hl 8 | ld d,(hl) ; is buffer already initialized? (can also be considered high byte of 16bit DE since anything 256 or more disables the feature) 9 | dec hl 10 | ld a,(hl) ; buffer address MSB 11 | dec hl 12 | ld l,(hl) ; buffer address LSB 13 | ld h,a 14 | call 0xBBAB ; TXT SET M TABLE 15 | ; HL contains the address of the new table, nothing to do. 16 | ld e,a ; lowest character in previous table 17 | ld d,#0 18 | ret nc ; if no carry, no previous table, return with d=0 19 | dec d 20 | ret 21 | 22 | -------------------------------------------------------------------------------- /cpclib/cdtc/include/cdtc/fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128.h: -------------------------------------------------------------------------------- 1 | #ifndef __fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128_h__ 2 | #define __fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128_h__ 3 | 4 | #include 5 | 6 | void fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128_fill_table() 7 | __preserves_regs( c, iyh, iyl ); 8 | 9 | // We do not define it here because it conflicts if you define it yourself in C at a constant address, like: 10 | // uint8_t __at(0x1200) fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128_table[256]; 11 | // this is why the line below is commented out: 12 | // extern uint8_t fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128_table[256]; 13 | 14 | 15 | uint16_t fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128( uint16_t xy ) 16 | __z88dk_fastcall __preserves_regs( iyh, iyl ); 17 | 18 | #endif /* __fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128_h__ */ 19 | -------------------------------------------------------------------------------- /tests/multiplication_benchmark_02_fast_constant_time_ab_aplusb_aminusb/testbench.c: -------------------------------------------------------------------------------- 1 | #include "cfwi/cfwi.h" 2 | #include "printer.h" 3 | #include "stdint.h" 4 | 5 | uint8_t perform_test(); 6 | 7 | void 8 | main() 9 | { 10 | uint32_t time_before, time_after; 11 | 12 | fw_mc_send_printer( '0' ); 13 | fw_mc_send_printer( '\n' ); 14 | 15 | time_before = fw_kl_time_please(); 16 | 17 | { 18 | uint8_t rc = perform_test(); 19 | fw_mc_send_printer( '1' ); 20 | fw_mc_send_printer( rc ); 21 | } 22 | 23 | time_after = fw_kl_time_please(); 24 | 25 | { 26 | uint32_t time_delta = time_after - time_before; 27 | fw_mc_send_printer( 'd' ); 28 | fw_mc_send_printer( '=' ); 29 | printer_uint32_as_hex_with_prefix( time_delta ); 30 | } 31 | 32 | fw_mc_send_printer( '2' ); 33 | fw_mc_wait_flyback(); 34 | } 35 | 36 | void 37 | rendezvous_point() 38 | { 39 | } 40 | -------------------------------------------------------------------------------- /tool/sdcc/sdcc_workaround_printf_optimization_bug.diff: -------------------------------------------------------------------------------- 1 | diff -urw sdcc/src/SDCCast.c sdcc_workaround_bug/src/SDCCast.c 2 | --- sdcc/src/SDCCast.c 2021-01-03 10:47:54.000000000 +0100 3 | +++ sdcc_workaround_bug/src/SDCCast.c 2021-04-20 09:18:43.915816655 +0200 4 | @@ -3174,6 +3174,29 @@ 5 | ast *parms = tree->right; 6 | ast *func = tree->left; 7 | 8 | + return; 9 | +/* This function is buggy, it causes incorrect compilation of this file: 10 | + 11 | +#include 12 | + 13 | +int 14 | +main () 15 | +{ 16 | + printf ("1\n"); 17 | + printf ("2\n"); 18 | + 19 | + printf ("3\001"); 20 | + 21 | + printf ("4\n"); 22 | + printf ("5\n"); 23 | + return 0; 24 | +} 25 | + 26 | +It should print 1 2 3\001 4 5 27 | + 28 | +and instead prints 1 2 3\001 1 2 29 | +*/ 30 | + 31 | if (!TARGET_IS_STM8 && !TARGET_Z80_LIKE && !TARGET_PDK_LIKE) // Regression test gcc-torture-execute-20121108-1.c fails to build for hc08 and mcs51 (without --stack-auto) 32 | return; 33 | 34 | -------------------------------------------------------------------------------- /tests/fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_256__xmy_lt_256/fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_256__xmy_lt_256_test.c: -------------------------------------------------------------------------------- 1 | #include "fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_256__xmy_lt_256.h" 2 | #include 3 | #include 4 | 5 | void 6 | fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_256__xmy_lt_256_test() 7 | { 8 | uint8_t x = 0; 9 | 10 | do 11 | { 12 | --x; 13 | // print_uint8_as_hex( x ); 14 | uint8_t y = 200; 15 | 16 | /* if ( y > x ) */ 17 | /* { */ 18 | /* y = x + 1; */ 19 | /* } */ 20 | 21 | do 22 | { 23 | --y; 24 | uint8_t z = fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_256__xmy_lt_256( 25 | x << 8 ^ y ); 26 | 27 | uint8_t color = z / 4; 28 | 29 | fw_gra_set_pen( color ); 30 | 31 | fw_gra_plot_absolute( ( x + 64 ) << 1, y << 1 ); 32 | } while ( y != 0 ); 33 | } while ( x != 0 ); 34 | } 35 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # This .gitattributes file can be fully refreshed with the following line: 2 | # { export LC_ALL=C ; grep '^#' .gitattributes ; echo ; find .git?* * -type f -not -iname "*.tmp" -not -print0 | xargs -0 file | grep -v "unified diff output" | grep ":.* text" | cut -f 1 -d ":" | egrep -v '\.(vcxproj|.*~)$' | sed -e 's|^.*/\([^/]*\)$|\1|' -e 's/^[^\.].*\(\.[^/]*\)$/*\1/' -e 's/ChangeLog.*/ChangeLog*/' -e 's/$/ eol=lf/' | sort | uniq -c | sort -rn | sed 's/^........//' ; } >|.gitattributes.tmp && mv -vf .gitattributes.tmp .gitattributes 3 | 4 | *.s eol=lf 5 | Makefile eol=lf 6 | .gitignore eol=lf 7 | *.c eol=lf 8 | *.h eol=lf 9 | *.conf eol=lf 10 | *.Makefile eol=lf 11 | *.md eol=lf 12 | *.sh eol=lf 13 | *.txt eol=lf 14 | *.html eol=lf 15 | *.havesourcetree eol=lf 16 | *.css eol=lf 17 | cap32_once eol=lf 18 | cap32 eol=lf 19 | .gitmodules eol=lf 20 | .gitattributes eol=lf 21 | *.yml eol=lf 22 | *.in eol=lf 23 | *.env eol=lf 24 | *.def eol=lf 25 | *.csv eol=lf 26 | *.cfg eol=lf 27 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_cas_out_open.s: -------------------------------------------------------------------------------- 1 | .module fw_cas_out_open 2 | 3 | _fw_cas_out_open:: 4 | ;; hl = pointer to struct fw_cas_open_parameters_t 5 | ld c,(hl) ; msb(address of filename) 6 | inc hl 7 | ld a,(hl) ; lsb(address of filename) 8 | inc hl 9 | ld b,(hl) ; length of filename 10 | inc hl 11 | ld e,(hl) ; lsb(buffer) 12 | inc hl 13 | ld d,(hl) ; msb(buffer) 14 | inc hl 15 | push hl ; will be used for return value 16 | ld l,c 17 | ld h,a 18 | 19 | call 0xBC8C ; CAS OUT OPEN 20 | 21 | ld d,h 22 | ld e,l 23 | pop hl ; get back pointer to struct 24 | 25 | ld (hl),e ; lsb(header location) 26 | inc hl 27 | ld (hl),d ; msb(header location) 28 | ;; we don't inc hl again because we don't care about fully skipping value 29 | 30 | ;; prepare return value 31 | ld a,#0 ; does not affect flags 32 | jr nz,nozeroflag 33 | inc a ; does not affect carry 34 | nozeroflag: 35 | rlca ; propagates carry 36 | ld l,a ; thus L gets (NZ)<<1 | C 37 | ret 38 | -------------------------------------------------------------------------------- /documentation-for-maintainers/z80_data_transform/generate_macros_for_undocumented_opcodes.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # John Adams a.k.a. https://github.com/borilla published 4 | # https://borilla.co.uk/z80.html . Thanks for the data! 5 | 6 | # This script written by Stéphane Gourichon (cpcitor) reads data 7 | # imported from the above page and generates an assembly source file 8 | # containing macros suitable for use in the sdasz80 assembler 9 | # targetting the Z80. 10 | 11 | # The result is in 12 | # cpc-dev-tool-chain/cpclib/cdtc/asminclude/cdtc/z80_undocumented_opcodes.macros.s 13 | 14 | while read OP OPAND TIMING PREFIX OPCODE 15 | do 16 | MACRONAME=$(echo ${OP}__${OPAND} | sed 's/[ ,]/_/g') 17 | ARG="" 18 | ADDBYTES="" 19 | if [[ $OPAND =~ nn ]] 20 | then 21 | ARG=" nn" 22 | fi 23 | echo ";; ${OP} ${OPAND}. Duration: $TIMING NOPs" 24 | echo ".macro ${MACRONAME}${ARG}" 25 | echo ".db 0x${PREFIX}, 0x${OPCODE/ nn/, nn}" 26 | echo .endm 27 | echo 28 | done < <( grep i[xy][lh] z80_Instruction_Set.txt | sed 's/\*//g' ) 29 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "tool/caprice32/caprice32"] 2 | path = tool/caprice32/caprice32 3 | url = https://github.com/cpcitor/caprice32 4 | branch = integration_with_cdtc 5 | 6 | [submodule "tool/gfx2crtc/gfx2crtc"] 7 | path = tool/gfx2crtc/gfx2crtc 8 | url = https://github.com/cpcsdk/gfx2crtc 9 | [submodule "tool/deexo/deexo"] 10 | path = tool/deexo/deexo 11 | url = https://github.com/antoniovillena/deexo 12 | [submodule "tool/cpcec/cpcec"] 13 | path = tool/cpcec/cpcec 14 | url = https://github.com/cpcitor/cpcec 15 | [submodule "tool/playtzx/playtzx"] 16 | path = tool/playtzx/playtzx 17 | url = https://github.com/tcat-qldom/PlayTZX 18 | [submodule "tool/rasm/rasm"] 19 | path = tool/rasm/rasm 20 | url = https://github.com/EdouardBERGE/rasm 21 | [submodule "tool/addhead/addhead"] 22 | path = tool/addhead/addhead 23 | url = https://github.com/cpcitor/addhead 24 | [submodule "tool/cpcxfs/cpcxfs"] 25 | path = tool/cpcxfs/cpcxfs 26 | url = https://github.com/cpcitor/cpcfs 27 | [submodule "tool/2cdt/2cdt"] 28 | path = tool/2cdt/2cdt 29 | url = https://github.com/cpcitor/2cdt 30 | -------------------------------------------------------------------------------- /tool/png2cpcsprite/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS=-g -Wall -Wextra $(shell pkg-config --cflags libpng) 2 | LDFLAGS=$(shell pkg-config --libs libpng) 3 | CC=gcc 4 | 5 | SOURCES=$(wildcard *.c) 6 | 7 | BUILD_TARGET_FILE=png2cpcsprite 8 | 9 | build: $(BUILD_TARGET_FILE) 10 | 11 | $(BUILD_TARGET_FILE): $(SOURCES) Makefile 12 | $(CC) $(CFLAGS) $(SOURCES) -o $@ $(LDFLAGS) 13 | 14 | #OBJECTS=$(patsubst %.c,%.o,$(SOURCES)) 15 | 16 | #png2sprite: $(OBJECTS) 17 | # $(CC) $(CFLAGS) $(OBJECTS) -o $@ $(LDFLAGS) 18 | 19 | clean: 20 | -rm -f $(OBJECTS) 21 | 22 | indent: 23 | clang-format -i *.c 24 | 25 | astyle: $(wildcard *.c */*.c *.h */*.h) 26 | astyle --mode=c --lineend=linux --indent=spaces=8 --style=ansi --add-brackets --indent-switches --indent-classes --indent-preprocessor --convert-tabs --break-blocks --pad-oper --pad-paren-in --pad-header --unpad-paren --align-pointer=name $^ 27 | 28 | build_config.inc: $(BUILD_TARGET_FILE) Makefile 29 | (set -eu ; \ 30 | { \ 31 | echo "# with bash do \"source\" this file." ; \ 32 | cd "$($@ ; ) 35 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_cas/local.Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: run_test 2 | 3 | test_verdict.txt: model output 4 | ( if diff -ur model output ; then echo PASS ; else echo FAIL ; fi | tee $@.tmp && mv -vf $@.tmp $@ ; exit 0 ) 5 | # Make target should succeed even if test fails. 6 | 7 | run_test output: cap32_fortest.cfg dsk 8 | ( . $(CDTC_ENV_FOR_CAPRICE32) ; rm -rf output ; mkdir output ; cap32 $(DSKNAME) -c cap32_fortest.cfg -a 'run"$(PROJNAME)' -a CAP32_WAITBREAKCAP32_SCRNSHOTCAP32_EXIT ; rename 's|output/screenshot.*.png$$|output/screenshot.png|' output/screenshot*.png ; ) 9 | 10 | 11 | 12 | cap32_fortest.cfg: $(CDTC_ENV_FOR_CAPRICE32) local.Makefile 13 | sed -e "s|speed=.*|speed=4|" \ 14 | -e "s|limit_speed=.*|limit_speed=1|" \ 15 | -e "s|printer=.*|printer=1|" \ 16 | -e "s|printer_file=.*|printer_file=output/parallel_port_log.txt|" \ 17 | -e "s|sdump_dir=.*|sdump_dir=output|" \ 18 | -e "s|scr_fps=.*|scr_fps=0|" \ 19 | <$(CDTC_ROOT)/tool/caprice32/cap32_local.cfg >cap32_fortest.cfg 20 | 21 | extra_clean: clean distclean 22 | rm -f cap32_fortest.cfg test_result_raw.txt test_verdict.txt 23 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_km/local.Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: run_test 2 | 3 | test_verdict.txt: model output 4 | ( if diff -ur model output ; then echo PASS ; else echo FAIL ; fi | tee $@.tmp && mv -vf $@.tmp $@ ; exit 0 ) 5 | # Make target should succeed even if test fails. 6 | 7 | run_test output: cap32_fortest.cfg dsk 8 | ( . $(CDTC_ENV_FOR_CAPRICE32) ; rm -rf output ; mkdir output ; cap32 $(DSKNAME) -c cap32_fortest.cfg -a 'run"$(PROJNAME)' -a CAP32_WAITBREAKCAP32_SCRNSHOTCAP32_EXIT ; rename 's|output/screenshot.*.png$$|output/screenshot.png|' output/screenshot*.png ; ) 9 | 10 | 11 | 12 | cap32_fortest.cfg: $(CDTC_ENV_FOR_CAPRICE32) local.Makefile 13 | sed -e "s|speed=.*|speed=4|" \ 14 | -e "s|limit_speed=.*|limit_speed=0|" \ 15 | -e "s|printer=.*|printer=1|" \ 16 | -e "s|printer_file=.*|printer_file=output/parallel_port_log.txt|" \ 17 | -e "s|sdump_dir=.*|sdump_dir=output|" \ 18 | -e "s|scr_fps=.*|scr_fps=0|" \ 19 | <$(CDTC_ROOT)/tool/caprice32/cap32_local.cfg >cap32_fortest.cfg 20 | 21 | extra_clean: clean distclean 22 | rm -f cap32_fortest.cfg test_result_raw.txt test_verdict.txt 23 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_scr/local.Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: run_test 2 | 3 | test_verdict.txt: model output 4 | ( if diff -ur model output ; then echo PASS ; else echo FAIL ; fi | tee $@.tmp && mv -vf $@.tmp $@ ; exit 0 ) 5 | # Make target should succeed even if test fails. 6 | 7 | run_test output: cap32_fortest.cfg dsk 8 | ( . $(CDTC_ENV_FOR_CAPRICE32) ; rm -rf output ; mkdir output ; cap32 $(DSKNAME) -c cap32_fortest.cfg -a 'run"$(PROJNAME)' -a CAP32_WAITBREAKCAP32_SCRNSHOTCAP32_EXIT ; rename 's|output/screenshot.*.png$$|output/screenshot.png|' output/screenshot*.png ; ) 9 | 10 | 11 | 12 | cap32_fortest.cfg: $(CDTC_ENV_FOR_CAPRICE32) local.Makefile 13 | sed -e "s|speed=.*|speed=4|" \ 14 | -e "s|limit_speed=.*|limit_speed=1|" \ 15 | -e "s|printer=.*|printer=1|" \ 16 | -e "s|printer_file=.*|printer_file=output/parallel_port_log.txt|" \ 17 | -e "s|sdump_dir=.*|sdump_dir=output|" \ 18 | -e "s|scr_fps=.*|scr_fps=0|" \ 19 | <$(CDTC_ROOT)/tool/caprice32/cap32_local.cfg >cap32_fortest.cfg 20 | 21 | extra_clean: clean distclean 22 | rm -f cap32_fortest.cfg test_result_raw.txt test_verdict.txt 23 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_txt/local.Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: run_test 2 | 3 | test_verdict.txt: model output 4 | ( if diff -ur model output ; then echo PASS ; else echo FAIL ; fi | tee $@.tmp && mv -vf $@.tmp $@ ; exit 0 ) 5 | # Make target should succeed even if test fails. 6 | 7 | run_test output: cap32_fortest.cfg dsk 8 | ( . $(CDTC_ENV_FOR_CAPRICE32) ; rm -rf output ; mkdir output ; cap32 $(DSKNAME) -c cap32_fortest.cfg -a 'run"$(PROJNAME)' -a CAP32_WAITBREAKCAP32_SCRNSHOTCAP32_EXIT ; rename 's|output/screenshot.*.png$$|output/screenshot.png|' output/screenshot*.png ; ) 9 | 10 | 11 | 12 | cap32_fortest.cfg: $(CDTC_ENV_FOR_CAPRICE32) local.Makefile 13 | sed -e "s|speed=.*|speed=4|" \ 14 | -e "s|limit_speed=.*|limit_speed=0|" \ 15 | -e "s|printer=.*|printer=1|" \ 16 | -e "s|printer_file=.*|printer_file=output/parallel_port_log.txt|" \ 17 | -e "s|sdump_dir=.*|sdump_dir=output|" \ 18 | -e "s|scr_fps=.*|scr_fps=0|" \ 19 | <$(CDTC_ROOT)/tool/caprice32/cap32_local.cfg >cap32_fortest.cfg 20 | 21 | extra_clean: clean distclean 22 | rm -f cap32_fortest.cfg test_result_raw.txt test_verdict.txt 23 | -------------------------------------------------------------------------------- /cpclib/cfwi/include/cfwi/fw_jre.h: -------------------------------------------------------------------------------- 1 | #ifndef __FW_JRE_H__ 2 | #define __FW_JRE_H__ 3 | 4 | /** 189: JUMP RESTORE 5 | #BD37 6 | Restore the standard jumpblock. 7 | Action: 8 | Set the main firmware jumpblock to its standard state as described in sections 14.1 9 | and 15. 10 | Entry conditions: 11 | No conditions. 12 | Exit conditions: 13 | AF, BC, DE and HL corrupt. 14 | All other registers preserved. 15 | Notes: 16 | This routine may be used to restore the jumpblock to its standard routines after the 17 | user has changed entries in it. The whole of the jumpblock is set up so care must be 18 | taken if other programs, such as AMSDOS, have patched it. 19 | The indirections jumpblock is set up piecemeal by the various packs' initialization and 20 | reset routines. JUMP RESTORE does not set up the indirections. 21 | Related entries: 22 | GRA RESET 23 | KM RESET 24 | MC RESET PRINTER 25 | SCR RESET 26 | TXT RESET 27 | */ 28 | void fw_jre_jump_restore(void) __preserves_regs(iyh, iyl); 29 | 30 | #endif /* __FW_JRE_H__ */ 31 | -------------------------------------------------------------------------------- /tool/Makefile: -------------------------------------------------------------------------------- 1 | SHELL=/bin/bash 2 | 3 | #ALL_TOOLS=$(patsubst %/Makefile,%,$( wildcard tool/*/Makefile ) ) 4 | #ALL_CORE_TOOLS=$( for TOOL in $(ALL_TOOLS) ; do [[ -e "$TOOL"/.is_core_tool ]] && echo "$TOOL" ; done ; ) 5 | 6 | #ALL_CORE_TOOLS=$(shell ls -1b */.is_core_tool | sed 's|/.is_core_tool||' ; ) 7 | ALL_CORE_TOOLS=$(patsubst %/.is_core_tool,%,$(wildcard */.is_core_tool ) ) 8 | #ALL_CORE_TOOLS=$(wildcard */.is_core_tool) 9 | 10 | test: 11 | echo all: $(ALL_CORE_TOOLS) 12 | 13 | install: $(ALL_CORE_TOOLS) 14 | ( set -xveu -o pipefail ; \ 15 | export PREFIX=$$( cd ../.. ; echo $$PWD/cpc-dev-tool-chain_tools_installed ; ) ; \ 16 | export PREFIX_BIN=$${PREFIX}/bin ; \ 17 | for TOOL in $(ALL_CORE_TOOLS) ; \ 18 | do $(MAKE) -C $$TOOL install ; \ 19 | done ; ) 20 | 21 | # tool/*/Makefile: ; \ 22 | # do \ 23 | # TOOLD="${TOOLM%/*}" ; \ 24 | # make -C "$TOOLD" ; \ 25 | # for INC in "$TOOLD"/*.inc ; do echo ". $INC" >&4 ; done ; \ 26 | # done 4> ../.tools_config.env 27 | # RUN echo . ~/.tools_config.env >>~/.profile 28 | 29 | # check: 30 | # set -xv ; echo $ALL_TOOLS ; echo $ALL_CORE_TOOLS 31 | -------------------------------------------------------------------------------- /tests/fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128/demo.c: -------------------------------------------------------------------------------- 1 | #include "fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128.h" 2 | #include 3 | // #include "print.h" 4 | #include 5 | #include 6 | 7 | void 8 | fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128_demo( void ) 9 | { 10 | uint8_t x = 0; 11 | 12 | do 13 | { 14 | --x; 15 | // print_uint8_as_hex( x ); 16 | uint8_t y = 200; 17 | 18 | /* if ( y > x ) */ 19 | /* { */ 20 | /* y = x + 1; */ 21 | /* } */ 22 | 23 | do 24 | { 25 | --y; 26 | 27 | uint16_t_as_uint8_t_pair_t bytepair = { 28 | .as_uint8_pair = { .low = y, .high = x } }; 29 | 30 | uint8_t z = fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128( 31 | bytepair.as_uint16_t ); 32 | 33 | uint8_t color = z / 4; 34 | 35 | fw_gra_set_pen( color ); 36 | 37 | fw_gra_plot_absolute( x << 1, y << 1 ); 38 | } while ( y != 0 ); 39 | } while ( x != 0 ); 40 | } 41 | -------------------------------------------------------------------------------- /tests/cfwi_test/local.Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: run_test 2 | 3 | test_verdict.txt: model output 4 | ( if diff -ur model output ; then echo PASS ; else echo FAIL ; fi | tee $@.tmp && mv -vf $@.tmp $@ ; exit 0 ) 5 | # Make target should succeed even if test fails. 6 | 7 | run_test output: cap32_fortest.cfg dsk 8 | ( . $(CDTC_ENV_FOR_CAPRICE32) ; rm -rf output ; mkdir output ; cap32 $(DSKNAME) -c cap32_fortest.cfg -a 'run"$(PROJNAME)' -a CAP32_WAITBREAKCAP32_SCRNSHOT -a CAP32_EXIT ; rename 's|output/screenshot.*.png$$|output/screenshot.png|' output/screenshot*.png ; ) 9 | 10 | 11 | 12 | cap32_fortest.cfg: $(CDTC_ENV_FOR_CAPRICE32) local.Makefile 13 | sed \ 14 | -e "s|speed=.*|speed=256|" \ 15 | -e "s|limit_speed=.*|limit_speed=0|" \ 16 | -e "s|auto_pause=.*|auto_pause=0|" \ 17 | -e "s|printer=.*|printer=1|" \ 18 | -e "s|printer_file=.*|printer_file=output/parallel_port_log.txt|" \ 19 | -e "s|sdump_dir=.*|sdump_dir=output|" \ 20 | -e "s|scr_fps=.*|scr_fps=0|" \ 21 | <$(CDTC_ROOT)/tool/caprice32/cap32_local.cfg >cap32_fortest.cfg 22 | 23 | extra_clean: clean distclean 24 | rm -f cap32_fortest.cfg test_result_raw.txt test_verdict.txt 25 | -------------------------------------------------------------------------------- /tests/xmacro/local.Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: run_test 2 | 3 | test_verdict.txt: model output 4 | ( if diff -ur model output ; then echo PASS ; else echo FAIL ; fi | tee $@.tmp && mv -vf $@.tmp $@ ; exit 0 ) 5 | # Make target should succeed even if test fails. 6 | 7 | run_test output: cap32_fortest.cfg dsk 8 | ( . $(CDTC_ENV_FOR_CAPRICE32) ; rm -rf output ; mkdir output ; cap32 $(DSKNAME) -c cap32_fortest.cfg -a 'run"$(PROJNAME)' -a CAP32_WAITBREAKCAP32_SCRNSHOT -a CAP32_EXIT ; rename 's|output/screenshot.*.png$$|output/screenshot.png|' output/screenshot*.png ; ) 9 | 10 | 11 | 12 | cap32_fortest.cfg: $(CDTC_ENV_FOR_CAPRICE32) local.Makefile 13 | sed \ 14 | -e "s|speed=.*|speed=256|" \ 15 | -e "s|limit_speed=.*|limit_speed=0|" \ 16 | -e "s|auto_pause=.*|auto_pause=0|" \ 17 | -e "s|printer=.*|printer=1|" \ 18 | -e "s|printer_file=.*|printer_file=output/parallel_port_log.txt|" \ 19 | -e "s|sdump_dir=.*|sdump_dir=output|" \ 20 | -e "s|scr_fps=.*|scr_fps=0|" \ 21 | <$(CDTC_ROOT)/tool/caprice32/cap32_local.cfg >cap32_fortest.cfg 22 | 23 | extra_clean: clean distclean 24 | rm -f cap32_fortest.cfg test_result_raw.txt test_verdict.txt 25 | -------------------------------------------------------------------------------- /tests/cdtc_screen_basic_test/local.Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: run_test 2 | 3 | test_verdict.txt: model output 4 | ( if diff -ur model output ; then echo PASS ; else echo FAIL ; fi | tee $@.tmp && mv -vf $@.tmp $@ ; exit 0 ) 5 | # Make target should succeed even if test fails. 6 | 7 | run_test output: cap32_fortest.cfg dsk 8 | ( . $(CDTC_ENV_FOR_CAPRICE32) ; rm -rf output ; mkdir output ; cap32 $(DSKNAME) -c cap32_fortest.cfg -a 'run"$(PROJNAME)' -a CAP32_WAITBREAKCAP32_SCRNSHOT -a CAP32_EXIT ; rename 's|output/screenshot.*.png$$|output/screenshot.png|' output/screenshot*.png ; ) 9 | 10 | 11 | 12 | cap32_fortest.cfg: $(CDTC_ENV_FOR_CAPRICE32) local.Makefile 13 | sed \ 14 | -e "s|speed=.*|speed=256|" \ 15 | -e "s|limit_speed=.*|limit_speed=0|" \ 16 | -e "s|auto_pause=.*|auto_pause=0|" \ 17 | -e "s|printer=.*|printer=1|" \ 18 | -e "s|printer_file=.*|printer_file=output/parallel_port_log.txt|" \ 19 | -e "s|sdump_dir=.*|sdump_dir=output|" \ 20 | -e "s|scr_fps=.*|scr_fps=0|" \ 21 | <$(CDTC_ROOT)/tool/caprice32/cap32_local.cfg >cap32_fortest.cfg 22 | 23 | extra_clean: clean distclean 24 | rm -f cap32_fortest.cfg test_result_raw.txt test_verdict.txt 25 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # How this is organized. 2 | 3 | displayhelp: 4 | @echo "Choose target among the following:" 5 | @echo 6 | @sed -n 's/^\([a-z0-9_-]*\):.*$$/make \1/p' Makefile 7 | 8 | .PHONY: hello_world_using_z88dk hello_world_using_sdcc hello_world_using_sdcc-all cpcrslib cpcrslib-all sdcc-all test-custom-project 9 | 10 | hello_world_using_z88dk: hello_world_using_z88dk/Makefile 11 | LC_ALL=C $(MAKE) -C $@ all 12 | 13 | hello_world_using_sdcc: hello_world_using_sdcc/Makefile 14 | LC_ALL=C $(MAKE) -C $@ all 15 | 16 | hello_world_using_sdcc-all: hello_world_using_sdcc/Makefile 17 | LC_ALL=C $(MAKE) -C $(cap32_fortest.cfg 22 | 23 | extra_clean: clean distclean 24 | rm -f cap32_fortest.cfg test_result_raw.txt test_verdict.txt 25 | -------------------------------------------------------------------------------- /tests/fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128/local.Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: run_test 2 | 3 | test_verdict.txt: model output 4 | ( if diff -ur model output ; then echo PASS ; else echo FAIL ; fi | tee $@.tmp && mv -vf $@.tmp $@ ; exit 0 ) 5 | # Make target should succeed even if test fails. 6 | 7 | run_test output: cap32_fortest.cfg dsk 8 | ( . $(CDTC_ENV_FOR_CAPRICE32) ; rm -rf output ; mkdir output ; cap32 $(DSKNAME) -c cap32_fortest.cfg -a 'run"$(PROJNAME)' -a CAP32_WAITBREAKCAP32_SCRNSHOT -a CAP32_EXIT ; rename 's|output/screenshot.*.png$$|output/screenshot.png|' output/screenshot*.png ; ) 9 | 10 | 11 | 12 | cap32_fortest.cfg: $(CDTC_ENV_FOR_CAPRICE32) local.Makefile 13 | sed \ 14 | -e "s|speed=.*|speed=256|" \ 15 | -e "s|limit_speed=.*|limit_speed=0|" \ 16 | -e "s|auto_pause=.*|auto_pause=0|" \ 17 | -e "s|printer=.*|printer=1|" \ 18 | -e "s|printer_file=.*|printer_file=output/parallel_port_log.txt|" \ 19 | -e "s|sdump_dir=.*|sdump_dir=output|" \ 20 | -e "s|scr_fps=.*|scr_fps=0|" \ 21 | <$(CDTC_ROOT)/tool/caprice32/cap32_local.cfg >cap32_fortest.cfg 22 | 23 | extra_clean: clean distclean 24 | rm -f cap32_fortest.cfg test_result_raw.txt test_verdict.txt 25 | -------------------------------------------------------------------------------- /tests/multiplication_benchmark_02_fast_constant_time_ab_aplusb_aminusb/local.Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: run_test 2 | 3 | test_verdict.txt: model output 4 | ( if diff -ur model output ; then echo PASS ; else echo FAIL ; fi | tee $@.tmp && mv -vf $@.tmp $@ ; exit 0 ) 5 | # Make target should succeed even if test fails. 6 | 7 | run_test output: cap32_fortest.cfg dsk 8 | ( . $(CDTC_ENV_FOR_CAPRICE32) ; rm -rf output ; mkdir output ; cap32 $(DSKNAME) -c cap32_fortest.cfg -a 'run"$(PROJNAME)' -a CAP32_WAITBREAKCAP32_SCRNSHOT -a CAP32_EXIT ; rename 's|output/screenshot.*.png$$|output/screenshot.png|' output/screenshot*.png ; ) 9 | 10 | 11 | 12 | cap32_fortest.cfg: $(CDTC_ENV_FOR_CAPRICE32) local.Makefile 13 | sed \ 14 | -e "s|speed=.*|speed=256|" \ 15 | -e "s|limit_speed=.*|limit_speed=0|" \ 16 | -e "s|auto_pause=.*|auto_pause=0|" \ 17 | -e "s|printer=.*|printer=1|" \ 18 | -e "s|printer_file=.*|printer_file=output/parallel_port_log.txt|" \ 19 | -e "s|sdump_dir=.*|sdump_dir=output|" \ 20 | -e "s|scr_fps=.*|scr_fps=0|" \ 21 | <$(CDTC_ROOT)/tool/caprice32/cap32_local.cfg >cap32_fortest.cfg 22 | 23 | extra_clean: clean distclean 24 | rm -f cap32_fortest.cfg test_result_raw.txt test_verdict.txt 25 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fast_pixel_routine/testfixture.c: -------------------------------------------------------------------------------- 1 | #include "cfwi/cfwi.h" 2 | #include "stdint.h" 3 | 4 | uint8_t *address_of_screen_line[200]; 5 | uint16_t tmp0; 6 | 7 | uint8_t perform_test() 8 | { 9 | #include "prepare_screen_table_asm" 10 | { 11 | static unsigned char x, y; 12 | 13 | for ( y = 0; y < 200; y++ ) 14 | { 15 | uint8_t *lineaddr = address_of_screen_line[y]; 16 | for ( x = 255; x != 0; x-- ) 17 | { 18 | if ( ( x ^ y ) > x ) 19 | { 20 | uint8_t *addr = lineaddr + (x >> 2); 21 | uint8_t mask = 0x88 >> (x & 3); 22 | /* switch (x & 3) */ 23 | /* { */ 24 | /* case 0: */ 25 | /* mask = 0x88; */ 26 | /* case 1: */ 27 | /* mask = 0x44; */ 28 | /* case 2: */ 29 | /* mask */ 30 | *addr |= (mask & 0xF0); 31 | // fw_gra_plot_absolute( 2 * x + 1, 2 * y + 1 ); 32 | } 33 | } 34 | 35 | } 36 | } 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_cas_in_open.s: -------------------------------------------------------------------------------- 1 | .module fw_cas_in_open 2 | 3 | _fw_cas_in_open:: 4 | ;; hl = pointer to struct fw_cas_open_parameters_t 5 | ld c,(hl) ; msb(address of filename) 6 | inc hl 7 | ld a,(hl) ; lsb(address of filename) 8 | inc hl 9 | ld b,(hl) ; length of filename 10 | inc hl 11 | ld e,(hl) ; lsb(buffer) 12 | inc hl 13 | ld d,(hl) ; msb(buffer) 14 | inc hl 15 | push hl ; will be used for return value 16 | ld l,c 17 | ld h,a 18 | call 0xBC77 ; CAS IN OPEN 19 | ;; must preserve flags till ... 20 | ex (sp),hl ; hl = pointer to struct fw_cas_in_open_parameters_t 21 | ; stack contains HL returned by CAS IN OPEN 22 | ld (hl),a ; file type 23 | inc hl 24 | ld (hl),e ; lsb(data location) 25 | inc hl 26 | ld (hl),d ; msb(data location) 27 | inc hl 28 | ld (hl),c ; lsb(logical file length) 29 | inc hl 30 | ld (hl),b ; msb(logical file length) 31 | inc hl 32 | pop de ; de = address of buffer 33 | ld (hl),e ; lsb(address of buffer) 34 | inc hl 35 | ld (hl),d ; msb(address of buffer) 36 | ld l,a 37 | ;; must preserve flags till here 38 | jr z,zero 39 | inc l ; does not affect carry 40 | zero: 41 | rlc l ; propagates carry 42 | ret 43 | -------------------------------------------------------------------------------- /samples/2dstars_00_bytes/2dstars.s: -------------------------------------------------------------------------------- 1 | .module 2dstars_asm 2 | 3 | .z80 4 | 5 | .globl _star_pos_byte_l 6 | .globl _setborder 7 | 8 | .include "cdtc/cpc_hardware_colors.s" 9 | 10 | _show_stars:: 11 | ;; ld bc,#0xbc0c 12 | ;; out (c),c 13 | ;; ld bc,#0xbd40 14 | ;; out (c),c 15 | 16 | ld a,#00 17 | 18 | next_frame: 19 | ld l,#hardware_color_r0_g0_b0_black 20 | call _setborder 21 | call #0xbd19 22 | ld l,#hardware_color_r0_g0_b2_bright_blue 23 | call _setborder 24 | 25 | ld hl, #(_star_pos_byte_l) 26 | ld b,#0x0 27 | next_star: 28 | ;; read old address 29 | ld e,(hl) 30 | inc h 31 | ld d,(hl) 32 | 33 | ;; erase old star 34 | xor a 35 | ld (de),a 36 | 37 | ;; compute new address 38 | dec de 39 | set 6,d 40 | 41 | ;; store new address 42 | ld (hl),d 43 | dec h 44 | ld (hl),e 45 | 46 | ;; draw new star 47 | ld a,b 48 | ld (de),a 49 | 50 | ;; next star 51 | inc l 52 | 53 | djnz next_star 54 | 55 | jr next_frame 56 | 57 | ;ret 58 | -------------------------------------------------------------------------------- /documentation-for-maintainers/z80_data_transform/generate_names_for_first_byte_of_ops.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # John Adams a.k.a. https://github.com/borilla published 4 | # https://borilla.co.uk/z80.html . Thanks for the data! 5 | 6 | # This script written by Stéphane Gourichon (cpcitor) reads data 7 | # imported from the above page and generates an assembly source file 8 | # containing a symbol list suitable for use in the sdasz80 assembler 9 | # targetting the Z80. 10 | 11 | # The result is in 12 | # cpc-dev-tool-chain/cpclib/cdtc/asminclude/cdtc/z80_syms_for_opcodes_first_byte.s 13 | 14 | while read LINE 15 | do 16 | if [[ "$LINE" =~ ^(.*)$'\t'.*$'\t'([0-9a-f][0-9a-f])\ ?([a-z 0-9]*)$ ]] 17 | then 18 | OP=${BASH_REMATCH[1]} 19 | OPCODEFIRSTBYTE=${BASH_REMATCH[2]} 20 | 21 | [[ "$OPCODEFIRSTBYTE" =~ ^(dd|ed|fd|cb) ]] && continue 22 | 23 | SYMBOLNAME=$(echo ${OP} | sed -E 's/[^a-z0-9]+/_/g' | sed -E 's/_*$//g') 24 | echo "z80_opcode_${SYMBOLNAME} .equ 0x$OPCODEFIRSTBYTE" 25 | echo "z80_opcode_${SYMBOLNAME}_0x$OPCODEFIRSTBYTE .equ 0x$OPCODEFIRSTBYTE" 26 | else 27 | echo "BAD $LINE" 28 | fi 29 | done < <( grep '^\*' z80_Instruction_Set.txt | sed 's/\*//g' ) | column -t | sort 30 | -------------------------------------------------------------------------------- /cpclib/cfwi/generate_c_headers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$#" == "0" ]] 4 | then 5 | echo "WARNING: This is a very hackish script that breaks headers, waiting for you to repair them afterwards." 6 | echo "Do not run without knowing what you do. You have been warned." 7 | exit 1 8 | fi 9 | 10 | 11 | set -eu 12 | 13 | sed > $headername 26 | fi 27 | done 28 | 29 | cd include/cfwi 30 | 31 | { 32 | echo "#ifndef __CFWI_H__" 33 | echo "#define __CFWI_H__" 34 | echo "" 35 | while read HEADER 36 | do 37 | echo "#include \"$HEADER\"" 38 | done < <(ls -1b *.h | grep -v "^cfwi.h$") 39 | echo "" 40 | echo "#endif /* __CFWI_H__ */" 41 | } >>cfwi.h.tmp 42 | mv -vf cfwi.h.tmp cfwi.h 43 | -------------------------------------------------------------------------------- /font/demo-files/demo.css: -------------------------------------------------------------------------------- 1 | body{margin:0px;padding:0px;font-family:Verdana,Arial;font-size:12px} 2 | #wrapper{width:1000px;margin-left:auto;margin-right:auto;border:1px solid #eeeeee;border-top:0} 3 | #title{float:left;width:680px;margin:20px 0 20px 20px;font-size:60px;white-space:nowrap;overflow:hidden} 4 | #logo{float:right;margin:25px 20px 20px 0} 5 | #logo img{border:0} 6 | #menu,#footer{background:#eeeeee} 7 | #menu ul{padding:0;margin:0} 8 | #menu li{list-style-type:none} 9 | #menu li a{padding:5px 20px 5px 20px;float:left;color:black;text-decoration:none;font-weight:bold} 10 | #menu li a:hover{background:#d7d7d7} 11 | #menu li.selected a{background:#002957;color:white} 12 | #content{padding:20px} 13 | #glyphs{float:left;margin-bottom:-20px !important} 14 | #glyphs .g{width:89px;float:left;text-align:center;padding:0 3px 0 3px;border-right:1px solid #eeeeee;white-space:nowrap;overflow:hidden;margin-bottom:20px;min-height:100px} 15 | .noborder{border:0 !important} 16 | #glyphs p{font-size:60px;padding:0;margin:10px 0 0 0} 17 | #footer {padding:5px 20px 5px 20px} 18 | #footer a{color:black} 19 | #copyright{float:left;white-space:nowrap;overflow:hidden;width:730px} 20 | #generated{float:right} 21 | #support{width:1000px;margin-left:auto;margin-right:auto;padding:5px 0 20px 40px;color:#9f9f9f} 22 | .clr{clear:both} 23 | -------------------------------------------------------------------------------- /tool/sdcc/sdcc_configure.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script is intended to be called by make. 4 | # Usage: scriptname buildtree installtree sourcetree 5 | 6 | set -eu 7 | 8 | set -xv 9 | 10 | BUILDTREE="$1" 11 | INSTALLTREE="$2" 12 | SOURCETREE="$3" 13 | 14 | shift 15 | shift 16 | shift 17 | 18 | cd "$SOURCETREE" 19 | SOURCETREE_ABS="$PWD" 20 | cd - 21 | 22 | mkdir -p "${INSTALLTREE}" 23 | cd "${INSTALLTREE}" 24 | INSTALLTREE_ABS="$PWD" 25 | cd - 26 | 27 | mkdir -p "${BUILDTREE}" 28 | cd "${BUILDTREE}" 29 | BUILDTREE_ABS="$PWD" 30 | 31 | $SOURCETREE_ABS/configure --prefix="${INSTALLTREE_ABS}" \ 32 | --enable-floats \ 33 | --disable-mcs51-port \ 34 | --disable-z180-port \ 35 | --disable-r2k-port \ 36 | --disable-r3ka-port \ 37 | --disable-gbz80-port \ 38 | --disable-tlcs90-port \ 39 | --disable-ds390-port \ 40 | --disable-ds400-port \ 41 | --disable-pic14-port \ 42 | --disable-pic16-port \ 43 | --disable-hc08-port \ 44 | --disable-s08-port \ 45 | --disable-stm8-port \ 46 | --disable-ez80_z80-port \ 47 | --disable-pdk13-port \ 48 | --disable-pdk14-port \ 49 | --disable-pdk15-port \ 50 | --disable-ucsim \ 51 | "$@" 52 | 53 | # exit code will tell if we succeeded. 54 | -------------------------------------------------------------------------------- /cpclib/cfwi/include/cfwi/fw_sound.h: -------------------------------------------------------------------------------- 1 | #ifndef __FW_SOUND_H__ 2 | #define __FW_SOUND_H__ 3 | 4 | /** 141: SOUND RESET 5 | #BCA7 6 | Reset the Sound Manager. 7 | Action: 8 | Re-initialize the Sound Manager - shut the sound chip up and clear all queues. 9 | Entry conditions: 10 | No conditions. 11 | Exit conditions: 12 | AF, BC, DE and HL corrupt. 13 | All other registers preserved. 14 | Notes: 15 | The sound queues are cleared. Any current sound is stopped. The sound generator 16 | chip is silenced. 17 | This routine enables interrupts. 18 | Related entries: 19 | SOUND HOLD 20 | */ 21 | void fw_sound_reset(void) __preserves_regs(iyh, iyl); 22 | 23 | /** 147: SOUND CONTINUE 24 | #BCB9 25 | Restart sounds after they have all been held. 26 | Action: 27 | Allows sounds that have been held by calling SOUND HOLD to continue. 28 | Entry conditions: 29 | No conditions. 30 | Exit conditions: 31 | AF, BC, DE and IX corrupt. 32 | All other registers preserved. 33 | Notes: 34 | If no sounds are held then no action is taken. 35 | This routine may enable interrupts. 36 | Related entries: 37 | SOUND HOLD 38 | SOUND RELEASE 39 | */ 40 | void fw_sound_continue(void) __preserves_regs(iyh, iyl); 41 | 42 | #endif /* __FW_SOUND_H__ */ 43 | -------------------------------------------------------------------------------- /cpclib/cdtc/cdtc_screen_parameters.s.example: -------------------------------------------------------------------------------- 1 | ; You can customize values below, to your wishes and context 2 | 3 | _cdtc_screen_basic__table_lh == 0x100 ; if you don't return to BASIC, you can overwrite 0x100-0x2FF 4 | _screen_first_byte_address == 0xC000 5 | _crtc_r1_disp_width_chars == 32 ; 32 chars, 64 bytes, 256-pixel wide screen (standard is 40) 6 | _crtc_r6_disp_height_chars == 32 ; 32 chars, 256-pixel high screen 7 | _crtc_r9_plus_1_disp_lines_per_char_height == 8 ; standard value 8, r9 == 7 8 | 9 | ; Don't change lines below 10 | 11 | _screen_width_in_bytes == _crtc_r1_disp_width_chars * 2 12 | _screen_total_lines == _crtc_r6_disp_height_chars * _crtc_r9_plus_1_disp_lines_per_char_height 13 | 14 | 15 | 16 | ;; Some sanity checks 17 | 18 | .iif gt, (_crtc_r1_disp_width_chars - 63) .mexit ; ERROR CPC only accepts up to 63 characters wide screen 19 | 20 | .iif gt, (_crtc_r6_disp_height_chars - 32) .mexit ; ERROR This routine so far cannot handle screens with more than 256 lines. Please comment, vote or contribue on https://github.com/cpcitor/cpc-dev-tool-chain/issues 21 | 22 | .iif gt, (_crtc_r1_disp_width_chars * _crtc_r6_disp_height_chars - 1024) .mexit ; ERROR screen specifications too big. CPC cannot output more that 1024 characters in MODE 1 without overscan. This routine does not support 32k overscan screens yet. 23 | -------------------------------------------------------------------------------- /cpclib/cfwi/include/cfwi/cfwi.h: -------------------------------------------------------------------------------- 1 | #ifndef __CFWI_H__ 2 | #define __CFWI_H__ 3 | 4 | #ifdef DISTRUST_PRESERVE_REGS 5 | // This can be useful if you encounter a bad behavior and suspect 6 | // registers aren's preserved by the firmware conforming to 7 | // documentation. Such suspicion happened to me, and this allows to 8 | // quickly assert that it was not the problem. 9 | #define __preserves_regs(...) 10 | #endif /* DISTRUST_PRESERVE_REGS */ 11 | 12 | /** 13 | 14 | #### CFWI-specific information: #### 15 | 16 | TL;DR: if a firmware routine has **argument pointer** to RAM, 17 | ensure it is *not* below 0x4000. 18 | 19 | The information is important for all routines that take **a 20 | pointer argument in RAM**. 21 | 22 | Soft968 section 2 23 | 24 | Routines that always access RAM will mention this in the description of the 25 | routine. Other routines may be assumed to be affected by the ROM state. In 26 | particular the various data blocks used by the Kernel must lie in the central 32K of 27 | RAM for the Kernel to be able to use them. 28 | */ 29 | 30 | #include "cfwi_txt.h" 31 | #include "fw_cas.h" 32 | #include "fw_gra.h" 33 | #include "fw_jre.h" 34 | #include "fw_kl.h" 35 | #include "fw_km.h" 36 | #include "fw_mc.h" 37 | #include "fw_scr.h" 38 | #include "fw_sound.h" 39 | #include "fw_txt.h" 40 | 41 | #endif /* __CFWI_H__ */ 42 | -------------------------------------------------------------------------------- /tool/z88dk/z88dk_prerequisites_check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eu 4 | 5 | ERRORS=0 6 | 7 | function log_failure() 8 | { 9 | echo >&2 "$@" 10 | ERRORS=$((ERRORS + 1)) 11 | } 12 | 13 | Z88DK_PERL_SCRIPT=z88dk/src/z80asm/tools/make_init.pl 14 | 15 | if 16 | [[ -e "${Z88DK_PERL_SCRIPT}" ]] 17 | then 18 | if 19 | perl "${Z88DK_PERL_SCRIPT}" 20 | then 21 | : 22 | else 23 | log_failure "error: missing dependency -- building z88dk assembler requires several modules." 24 | { 25 | echo "You need at least (you may have some already):" 26 | grep "^use" "${Z88DK_PERL_SCRIPT}" 27 | } >&2 28 | fi 29 | else 30 | echo "No ${Z88DK_PERL_SCRIPT} no trouble." 31 | fi 32 | 33 | if 34 | echo "use Modern::Perl;" | perl 35 | then 36 | : 37 | else 38 | log_failure "error: missing dependency -- building z88dk assembler requires Modern::Perl." 39 | fi 40 | 41 | # z88Dk 1.10.1 does not yet require bison. Only CVS release does. 42 | # if 43 | # which bison 44 | # then 45 | # : 46 | # else 47 | # log_failure "error: missing dependency -- building z88dk assembler requires bison." 48 | # fi 49 | 50 | echo "End of script. Errors: ${ERRORS}" 51 | 52 | exit "${ERRORS}" 53 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fast_pixel_routine/prepare_screen_table_asm: -------------------------------------------------------------------------------- 1 | __asm 2 | ;; disable interrupts 3 | di 4 | ;; save stack pointer 5 | ld hl,#0 6 | add hl,sp 7 | ld (_tmp0),hl 8 | ld sp,#(_address_of_screen_line + 400) 9 | 10 | ;; compute 11 | 12 | ;; b = 0xC8 = 200 13 | ;; c = 0x40 = because one has to go back 0x40. 14 | ld bc,#0xC840 15 | ;; de = how far to advance (has to be 16bit operation) 16 | ld de,#0x0050 17 | ;; hl = address of current line 18 | ld hl,#0xC000 19 | ;; now loop 20 | 0001$: 21 | ;; write value in table 22 | push hl 23 | ; ld (hl),h 24 | ;; a = high byte of address of current line 25 | ld a,#8 26 | ;; add a,h sets carry 27 | add a,h 28 | ;; ld h,a keeps carry 29 | ld h,a 30 | ;; no carry means simple case 31 | jr nc,0002$ 32 | ;; here overflow we have to go back 33 | sub c 34 | ;; then add alternate (has to be 16 bit add) 35 | ld h,a 36 | add hl,de 37 | 0002$: 38 | ;; Here,a is available for comparison. 39 | ld a,#0xC7 40 | cp h 41 | jr nz, 0001$ 42 | ld a,#0xD0 43 | cp l 44 | jr nz, 0001$ 45 | 46 | ;; restore stack pointer 47 | ld hl,(_tmp0) 48 | ld sp,hl 49 | 50 | ;; re-enable interrupts 51 | ei 52 | 0003$: 53 | __endasm; 54 | -------------------------------------------------------------------------------- /cpclib/cdtc/cdtc_screen_basic_plot.s: -------------------------------------------------------------------------------- 1 | .globl _cdtc_screen_basic__table_hl 2 | 3 | _cdtc_screen_basic__plot:: 4 | ;; H = y, L = x 5 | 6 | ;; Compute mask 7 | 8 | ;; How many times should we bitshift to get the mask? 9 | ld a, #3 10 | and l 11 | ld b,a 12 | inc b ; simpler+faster to inc b and make one loop step than make more jumps. 13 | 14 | ;; compute mask, loop 1 to 4 times. 15 | ld a,#0x11 16 | cdtc_screen_basic__plot_mask_loop: 17 | rrca 18 | djnz cdtc_screen_basic__plot_mask_loop 19 | ;; ok mask is in a 20 | ld b,a 21 | ;; ok mask is in b 22 | 23 | ;; now compute address 24 | ld d, #_cdtc_screen_basic__table_hl >> 8 ; MSB table 25 | ld e, h ; y 26 | ld a,(de) ; read MSB 27 | ld h,a 28 | 29 | inc d ; LSB table 30 | ld a,(de) ; read LSB 31 | 32 | ;; address to add is quarter of x 33 | srl l 34 | srl l 35 | add l ; add x 36 | jr nc, cdtc_screen_basic__plot_no_carry 37 | inc h 38 | cdtc_screen_basic__plot_no_carry: 39 | ld l,a 40 | 41 | ;; ok we have address in hl, now add our pixel 42 | ld a,(hl) 43 | or b 44 | ld (hl),a 45 | ret 46 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_scr/cap32_fortest.cfg: -------------------------------------------------------------------------------- 1 | [control] 2 | kbd_layout=keymap_fr_linux.map 3 | [file] 4 | cart_path=./cart/ 5 | dsk_path=./disk/ 6 | fmt02= 7 | fmt03= 8 | fmt04= 9 | fmt05= 10 | fmt06= 11 | fmt07= 12 | max_track_size=5990 13 | printer_file=output/parallel_port_log.txt 14 | sdump_dir=output 15 | snap_path=./snap/ 16 | tape_path=./tape/ 17 | [rom] 18 | rom_mf2=MF2.rom 19 | rom_path=/org/gourichon/localdata/SG/projects/retrocomputing/code/cpc-dev-tool-chain/tool/caprice32/caprice32/rom 20 | slot00= 21 | slot01= 22 | slot02= 23 | slot03= 24 | slot04= 25 | slot05= 26 | slot06= 27 | slot07=amsdos.rom 28 | slot08= 29 | slot09= 30 | slot10= 31 | slot11= 32 | slot12= 33 | slot13= 34 | slot14= 35 | slot15= 36 | [sound] 37 | bits=1 38 | enabled=1 39 | playback_rate=2 40 | pp_device=0 41 | stereo=1 42 | volume=80 43 | [system] 44 | auto_pause=1 45 | boot_time=42 46 | joystick_emulation=0 47 | joystick_menu_button=9 48 | joystick_vkeyboard_button=10 49 | joysticks=1 50 | jumpers=30 51 | keyboard=0 52 | limit_speed=1 53 | mf2=0 54 | model=2 55 | printer=1 56 | ram_size=128 57 | resources_path=/org/gourichon/localdata/SG/projects/retrocomputing/code/cpc-dev-tool-chain/tool/caprice32/caprice32/resources/ 58 | speed=4 59 | [video] 60 | scr_bpp=32 61 | scr_fps=0 62 | scr_height=600 63 | scr_intensity=10 64 | scr_led=1 65 | scr_oglfilter=1 66 | scr_oglscanlines=30 67 | scr_remanency=0 68 | scr_style=1 69 | scr_tube=0 70 | scr_width=800 71 | scr_window=1 72 | -------------------------------------------------------------------------------- /.github/workflows/static.yml: -------------------------------------------------------------------------------- 1 | # Simple workflow for deploying static content to GitHub Pages 2 | name: Deploy static content to Pages 3 | 4 | on: 5 | # Runs on pushes targeting the default branch 6 | push: 7 | branches: ["master"] 8 | 9 | # Allows you to run this workflow manually from the Actions tab 10 | workflow_dispatch: 11 | 12 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages 13 | permissions: 14 | contents: read 15 | pages: write 16 | id-token: write 17 | 18 | # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. 19 | # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. 20 | concurrency: 21 | group: "pages" 22 | cancel-in-progress: false 23 | 24 | jobs: 25 | # Single deploy job since we're just deploying 26 | deploy: 27 | environment: 28 | name: github-pages 29 | url: ${{ steps.deployment.outputs.page_url }} 30 | runs-on: ubuntu-latest 31 | steps: 32 | - name: Checkout 33 | uses: actions/checkout@v4 34 | - name: Setup Pages 35 | uses: actions/configure-pages@v5 36 | - name: Upload artifact 37 | uses: actions/upload-pages-artifact@v3 38 | with: 39 | # Upload entire repository 40 | path: '.' 41 | - name: Deploy to GitHub Pages 42 | id: deployment 43 | uses: actions/deploy-pages@v4 44 | -------------------------------------------------------------------------------- /cpclib/cpcrslib/cpcrslib_SDCC_build_patch.patch: -------------------------------------------------------------------------------- 1 | diff -urw cpcrslib_SDCC/src/tilemap/cpc_TileMapV.s cpcrslib_SDCC_patched/src/tilemap/cpc_TileMapV.s 2 | --- cpcrslib_SDCC/src/tilemap/cpc_TileMapV.s 2015-09-15 09:03:10.000000000 +0200 3 | +++ cpcrslib_SDCC_patched/src/tilemap/cpc_TileMapV.s 2017-11-05 12:40:13.680202767 +0100 4 | @@ -1,7 +1,7 @@ 5 | .module tilemap 6 | 7 | -.include "tilemap.s" 8 | -.include "tilemapC.h" 9 | +.include "TileMap.s" 10 | +.include "TileMapC.h" 11 | 12 | 13 | ; Define your tile data at the end of this file 14 | diff -urw cpcrslib_SDCC/src/utils/cpc_DisableFirmware.s cpcrslib_SDCC_patched/src/utils/cpc_DisableFirmware.s 15 | --- cpcrslib_SDCC/src/utils/cpc_DisableFirmware.s 2015-08-22 21:22:48.000000000 +0200 16 | +++ cpcrslib_SDCC_patched/src/utils/cpc_DisableFirmware.s 2017-11-05 12:40:38.656371314 +0100 17 | @@ -1,6 +1,6 @@ 18 | .module utils 19 | 20 | -.include "firmware.s" 21 | +.include "Firmware.s" 22 | 23 | .globl _cpc_DisableFirmware 24 | 25 | diff -urw cpcrslib_SDCC/src/utils/cpc_EnableFirmware.s cpcrslib_SDCC_patched/src/utils/cpc_EnableFirmware.s 26 | --- cpcrslib_SDCC/src/utils/cpc_EnableFirmware.s 2015-08-22 21:19:30.000000000 +0200 27 | +++ cpcrslib_SDCC_patched/src/utils/cpc_EnableFirmware.s 2017-11-05 12:40:45.536417728 +0100 28 | @@ -1,6 +1,6 @@ 29 | .module utils 30 | 31 | -.include "firmware.s" 32 | +.include "Firmware.s" 33 | 34 | .globl _cpc_EnableFirmware 35 | 36 | -------------------------------------------------------------------------------- /tests/cdtc_screen_basic_test/printer.c: -------------------------------------------------------------------------------- 1 | #include "printer.h" 2 | #include "cfwi/cfwi.h" 3 | #include "stdint.h" 4 | 5 | #define hexchar( i ) ( ( ( i ) < 10 ) ? ( '0' + ( i ) ) : ( 'A' - 10 + ( i ) ) ) 6 | 7 | void 8 | printer_uint16( uint16_t n ) 9 | { 10 | if ( n / 10 != 0 ) 11 | { 12 | printer_uint16( n / 10 ); 13 | } 14 | 15 | fw_mc_send_printer( ( n % 10 ) + '0' ); 16 | } 17 | 18 | void 19 | printer_uint8_as_hex( uint8_t v ) __z88dk_fastcall 20 | { 21 | fw_mc_send_printer( hexchar( v >> 4 ) ); 22 | fw_mc_send_printer( hexchar( v & 0x0F ) ); 23 | } 24 | 25 | void 26 | printer_uint8_as_hex_with_prefix( uint8_t v ) __z88dk_fastcall 27 | { 28 | fw_mc_send_printer( ' ' ); 29 | fw_mc_send_printer( '0' ); 30 | fw_mc_send_printer( 'x' ); 31 | printer_uint8_as_hex( v ); 32 | } 33 | 34 | void 35 | printer_uint16_as_hex_with_prefix( uint16_t v ) __z88dk_fastcall 36 | { 37 | fw_mc_send_printer( ' ' ); 38 | fw_mc_send_printer( '0' ); 39 | fw_mc_send_printer( 'x' ); 40 | printer_uint8_as_hex( v >> 8 ); 41 | printer_uint8_as_hex( v ); 42 | } 43 | 44 | void 45 | printer_uint32_as_hex_with_prefix( uint32_t v ) __z88dk_fastcall 46 | { 47 | fw_mc_send_printer( ' ' ); 48 | fw_mc_send_printer( '0' ); 49 | fw_mc_send_printer( 'x' ); 50 | printer_uint8_as_hex( v >> 24 ); 51 | printer_uint8_as_hex( v >> 16 ); 52 | printer_uint8_as_hex( v >> 8 ); 53 | printer_uint8_as_hex( v ); 54 | } 55 | -------------------------------------------------------------------------------- /tests/fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128/printer.c: -------------------------------------------------------------------------------- 1 | #include "printer.h" 2 | #include "cfwi/cfwi.h" 3 | #include "stdint.h" 4 | 5 | #define hexchar( i ) ( ( ( i ) < 10 ) ? ( '0' + ( i ) ) : ( 'A' - 10 + ( i ) ) ) 6 | 7 | void 8 | printer_uint16( uint16_t n ) 9 | { 10 | if ( n / 10 != 0 ) 11 | { 12 | printer_uint16( n / 10 ); 13 | } 14 | 15 | fw_mc_send_printer( ( n % 10 ) + '0' ); 16 | } 17 | 18 | void 19 | printer_uint8_as_hex( uint8_t v ) __z88dk_fastcall 20 | { 21 | fw_mc_send_printer( hexchar( v >> 4 ) ); 22 | fw_mc_send_printer( hexchar( v & 0x0F ) ); 23 | } 24 | 25 | void 26 | printer_uint8_as_hex_with_prefix( uint8_t v ) __z88dk_fastcall 27 | { 28 | fw_mc_send_printer( ' ' ); 29 | fw_mc_send_printer( '0' ); 30 | fw_mc_send_printer( 'x' ); 31 | printer_uint8_as_hex( v ); 32 | } 33 | 34 | void 35 | printer_uint16_as_hex_with_prefix( uint16_t v ) __z88dk_fastcall 36 | { 37 | fw_mc_send_printer( ' ' ); 38 | fw_mc_send_printer( '0' ); 39 | fw_mc_send_printer( 'x' ); 40 | printer_uint8_as_hex( v >> 8 ); 41 | printer_uint8_as_hex( v ); 42 | } 43 | 44 | void 45 | printer_uint32_as_hex_with_prefix( uint32_t v ) __z88dk_fastcall 46 | { 47 | fw_mc_send_printer( ' ' ); 48 | fw_mc_send_printer( '0' ); 49 | fw_mc_send_printer( 'x' ); 50 | printer_uint8_as_hex( v >> 24 ); 51 | printer_uint8_as_hex( v >> 16 ); 52 | printer_uint8_as_hex( v >> 8 ); 53 | printer_uint8_as_hex( v ); 54 | } 55 | -------------------------------------------------------------------------------- /tests/multiplication_benchmark_02_fast_constant_time_ab_aplusb_aminusb/printer.c: -------------------------------------------------------------------------------- 1 | #include "printer.h" 2 | #include "cfwi/cfwi.h" 3 | #include "stdint.h" 4 | 5 | #define hexchar( i ) ( ( ( i ) < 10 ) ? ( '0' + ( i ) ) : ( 'A' - 10 + ( i ) ) ) 6 | 7 | void 8 | printer_uint16( uint16_t n ) 9 | { 10 | if ( n / 10 != 0 ) 11 | { 12 | printer_uint16( n / 10 ); 13 | } 14 | 15 | fw_mc_send_printer( ( n % 10 ) + '0' ); 16 | } 17 | 18 | void 19 | printer_uint8_as_hex( uint8_t v ) __z88dk_fastcall 20 | { 21 | fw_mc_send_printer( hexchar( v >> 4 ) ); 22 | fw_mc_send_printer( hexchar( v & 0x0F ) ); 23 | } 24 | 25 | void 26 | printer_uint8_as_hex_with_prefix( uint8_t v ) __z88dk_fastcall 27 | { 28 | fw_mc_send_printer( ' ' ); 29 | fw_mc_send_printer( '0' ); 30 | fw_mc_send_printer( 'x' ); 31 | printer_uint8_as_hex( v ); 32 | } 33 | 34 | void 35 | printer_uint16_as_hex_with_prefix( uint16_t v ) __z88dk_fastcall 36 | { 37 | fw_mc_send_printer( ' ' ); 38 | fw_mc_send_printer( '0' ); 39 | fw_mc_send_printer( 'x' ); 40 | printer_uint8_as_hex( v >> 8 ); 41 | printer_uint8_as_hex( v ); 42 | } 43 | 44 | void 45 | printer_uint32_as_hex_with_prefix( uint32_t v ) __z88dk_fastcall 46 | { 47 | fw_mc_send_printer( ' ' ); 48 | fw_mc_send_printer( '0' ); 49 | fw_mc_send_printer( 'x' ); 50 | printer_uint8_as_hex( v >> 24 ); 51 | printer_uint8_as_hex( v >> 16 ); 52 | printer_uint8_as_hex( v >> 8 ); 53 | printer_uint8_as_hex( v ); 54 | } 55 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # Modified from https://github.com/ColinPitrat/caprice32/blob/fed782e5a05180a90049360f60755f356d79634d/.travis.yml 2 | language: cpp 3 | 4 | # safelist 5 | branches: 6 | only: 7 | - master 8 | - dev 9 | 10 | #To uncomment in case a core occurs: 11 | #sudo: required 12 | addons: 13 | apt: 14 | sources: 15 | - ubuntu-toolchain-r-test 16 | - llvm-toolchain-precise-3.8 17 | packages: 18 | - git 19 | - ca-certificates 20 | - wget 21 | - make 22 | - patch 23 | - gcc 24 | - bzip2 25 | - unzip 26 | - g++ 27 | - texinfo 28 | - bison 29 | - flex 30 | - libboost-dev 31 | - libncurses-dev 32 | - astyle 33 | - zlib1g-dev 34 | #To uncomment in case a core occurs: 35 | # - gdb 36 | before_script: 37 | 38 | # Build and test both in release and debug to ensure both works fine 39 | script: 40 | #To uncomment in case a core occurs: 41 | # - ulimit -c unlimited 42 | # - sudo sysctl kernel.core_pattern=core 43 | - pwd 44 | - ls -al 45 | - make displayhelp 46 | # - make -j2 hello_world_using_z88dk 47 | - make -j2 hello_world_using_sdcc 48 | - make -j2 hello_world_using_sdcc-all 49 | - make -j2 cpcrslib 50 | - make -j2 cpcrslib-all 51 | - make -j2 sdcc-all 52 | - make -j2 test-custom-project 53 | - make -j2 -C maintainer-tools/my_cdct_project all cdt bin dsk voc 54 | #To uncomment in case a core occurs: 55 | # - find ./ -name 'core*' 56 | # - for i in $(find ./ -name 'core*' -print); do gdb ./test/test_runner $i -ex "thread apply all bt" -ex "set pagination 0" -batch; done; 57 | -------------------------------------------------------------------------------- /samples/2dstars_00_bytes/main.c: -------------------------------------------------------------------------------- 1 | #include "cfwi/cfwi.h" 2 | #include "stdint.h" 3 | #include 4 | #include //random 5 | 6 | uint8_t __at( 0x3e00 ) star_pos_byte_l[256]; 7 | uint8_t __at( 0x3f00 ) star_pos_byte_h[256]; 8 | 9 | void show_stars( void ); 10 | 11 | const ink_vector16 palette = { { 12 | /* border */ 13 | hardware_color_r0_g0_b0_black, 14 | /* 16 palette entries */ 15 | hardware_color_r0_g0_b0_black, 16 | hardware_color_r1_g0_b0_red, 17 | hardware_color_r1_g1_b0_yellow, 18 | hardware_color_r1_g1_b1_white, 19 | hardware_color_r0_g1_b1_cyan, 20 | hardware_color_r0_g0_b1_blue, 21 | hardware_color_r2_g0_b0_bright_red, 22 | hardware_color_r2_g1_b0_orange, 23 | hardware_color_r2_g2_b0_bright_yellow, 24 | hardware_color_r2_g2_b1_pastel_yellow, 25 | hardware_color_r2_g2_b2_bright_white, 26 | hardware_color_r1_g2_b2_pastel_cyan, 27 | hardware_color_r1_g1_b2_pastel_blue, 28 | hardware_color_r0_g2_b2_bright_cyan, 29 | hardware_color_r0_g1_b2_sky_blue, 30 | hardware_color_r0_g0_b2_bright_blue, 31 | } }; 32 | 33 | void 34 | main( void ) 35 | { 36 | fw_scr_set_mode( 0 ); 37 | 38 | fw_kl_choke_off__ignore_return_value(); 39 | fw_mc_set_inks__16( &palette ); 40 | 41 | cfwi_txt_str0_output( "Staaars! Reset CPC or exit emulator to stop." ); 42 | 43 | for ( int i = 0; i < 256; i++ ) 44 | { 45 | uint16_t addr = rand(); 46 | 47 | star_pos_byte_l[i] = addr & 0xff; 48 | star_pos_byte_h[i] = 0xc0 | ( ( addr >> 8 ) & 0x3f ); 49 | } 50 | 51 | show_stars(); 52 | } 53 | -------------------------------------------------------------------------------- /tool/caprice32/caprice32_local_adjust.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function guess_keyboard_mapping() 4 | { 5 | type -a xmodmap >/dev/null || { echo >&2 Cannot find xmodmap. Cannot guess keyboard settings for caprice32. ; return 1 ; } 6 | 7 | QUERYKEYBOARD=" xmodmap -pke " 8 | #QUERYKEYBOARD=" cat spanish " 9 | 10 | read KEYCODE N24 EQUALS A1 A2 A3 A4 rest < <( $QUERYKEYBOARD | grep " 24 " ) 11 | read KEYCODE N11 EQUALS T1 T2 T3 T4 rest < <( $QUERYKEYBOARD | grep " 11 " ) 12 | 13 | FINGERPRINT="$A1$A2$A3$A4$T1$T2" 14 | 15 | case "$FINGERPRINT" in 16 | "qQaA2at") 17 | echo keymap_us.map 18 | return 0 19 | ;; 20 | "aAqQeacute2"|"aAaAeacute2") 21 | echo keymap_fr_linux.map 22 | return 23 | ;; 24 | "qQqQ2at") 25 | echo keymap_uk_linux.map 26 | return 27 | ;; 28 | "qQaA2quotedbl") 29 | echo keymap_es_linux.map 30 | return 31 | ;; 32 | *) 33 | echo >&2 "Please report to author with this information: $FINGERPRINT" 34 | exit 1 35 | ;; 36 | esac 37 | return 1 38 | } 39 | 40 | KEYMAPCODE=$(guess_keyboard_mapping) 41 | 42 | if [[ -n "$KEYMAPCODE" ]] 43 | then 44 | echo "Good! Guessed keyboard layout: $KEYMAPCODE" 45 | KEYMAPCODELINE=" -e s+kbd_layout=.*+kbd_layout=${KEYMAPCODE}+ " 46 | else 47 | echo "WARNING: cannot detect keyboard layout, caprice32 will default to us." 48 | KEYMAPCODELINE="" 49 | fi 50 | 51 | sed -e "s|/usr/local/share/caprice32|$PWD/$1|" \ 52 | -e "s|rom_path=.*|rom_path=$PWD/$1/rom|" \ 53 | $KEYMAPCODELINE \ 54 | < "$1/cap32.cfg" \ 55 | > cap32_local.cfg 56 | -------------------------------------------------------------------------------- /cpclib/cfwi/include/cfwi/cfwi_byte_shuffling.h: -------------------------------------------------------------------------------- 1 | #ifndef __CFWI_BYTE_SHUFFLING_H__ 2 | #define __CFWI_BYTE_SHUFFLING_H__ 3 | 4 | /** 5 | Optimization 6 | 7 | * Pass one 16bit or 32bit value instead of several via stack? Indeed it avoids copy. But stuffing the values is cumbersome and voids any benefit. In other words, do it *only* if you already have a struct that makes sense. 8 | 9 | * When a function returns a 16bit value, stuff it into a union *only* if you already have a struct that makes sense. 10 | 11 | * When a function returns a 32bit value, *do* stuff it into a union, because accessing higher bytes of a 32bit int causes inefficient code. 12 | 13 | */ 14 | 15 | /** UINT_SELECT_BYTE_0 is fast. */ 16 | #define UINT_SELECT_BYTE_0(n) ((uint8_t)(n)) 17 | /** UINT_SELECT_BYTE_1 is decently fast. */ 18 | #define UINT_SELECT_BYTE_1(n) ((uint8_t)( (( (uint16_t) (n) ) >> 8) & 0xff) ) 19 | 20 | /** UINT32_SELECT_UINT16 is decently fast. */ 21 | #define UINT32_SELECT_UINT16(n) ((uint16_t) (n) ) 22 | 23 | /** UINT_SELECT_BYTE_2 is slow. SDCC 3.6.0 generates a loop! */ 24 | //#define UINT_SELECT_BYTE_2(n) ((uint8_t)( ((n) >> 16) & 0xff )) 25 | /** UINT_SELECT_BYTE_3 is slow. SDCC 3.6.0 generates a loop! */ 26 | //#define UINT_SELECT_BYTE_3(n) ((uint8_t)( ((n) >> 24) & 0xff )) 27 | 28 | #define UINT_AND_BYTE_0(n) ( (n) & 0x000000ff ) 29 | #define UINT_AND_BYTE_1(n) ( (n) & 0x0000ff00 ) 30 | #define UINT_AND_BYTE_2(n) ( (n) & 0x00ff0000 ) 31 | #define UINT_AND_BYTE_3(n) ( (n) & 0xff000000 ) 32 | 33 | /** Some functions expect or return a byte with only two possible values. */ 34 | enum fw_byte_all_or_nothing 35 | { 36 | fw_byte_all = 0xff, 37 | fw_byte_nothing = 0x00 38 | }; 39 | 40 | 41 | #endif /* __CFWI_BYTE_SHUFFLING_H__ */ 42 | -------------------------------------------------------------------------------- /cpclib/cdtc/include/cdtc/assert.h: -------------------------------------------------------------------------------- 1 | #ifndef __CDTC_ASSERT_H__ 2 | #define __CDTC_ASSERT_H__ 3 | 4 | /** This file defines a platform-independent assert(), while letting 5 | you some leeway as how the runtime will handle messages. It only 6 | uses "puts". 7 | 8 | SDCC environment happens to define puts, but you can divert it via 9 | a #define, e.g. 10 | 11 | #define puts(str) my_text_output(str) 12 | #include "cdtc_assert.h" 13 | 14 | You might also instruct SDCC not to include or link their 15 | implementation. 16 | 17 | By choosing a particular function handling text, you may direct 18 | assertion failure messages to: 19 | 20 | * the screen, via cfwi 21 | * the screen, via your own routines 22 | * the CPC parallel port, via a loop on fw_mc_send_printer(uchar c). This is handy as some emulators just log this into a text file, which is a nice and easy way to get information directly from an emulated CPC. 23 | 24 | */ 25 | 26 | #undef assert 27 | 28 | #ifdef NDEBUG 29 | 30 | /* Debugging disabled -- do not evaluate assertions. */ 31 | #define assert(x) ((void)0) 32 | 33 | #else 34 | 35 | /* [Stringification - The C Preprocessor](https://gcc.gnu.org/onlinedocs/cpp/Stringification.html#Stringification) */ 36 | #define xstr(s) str(s) 37 | #define str(s) #s 38 | 39 | /* Debugging enabled -- verify assertions at run time. */ 40 | 41 | #if ASSERT_CONTINUES == 1 42 | #define assert(x) do { if ((x) == 0) { puts("Assertion failed: " NL #x NL "File: " __FILE__ NL "Line: " xstr(__LINE__) NL); } } while (0) 43 | #else 44 | #define assert(x) do { if ((x) == 0) { puts("Assertion failed: " NL #x NL "File: " __FILE__ NL "Line: " xstr(__LINE__) NL); while (1); } } while (0) 45 | #endif 46 | 47 | #endif 48 | 49 | #endif /* __CDTC_ASSERT_H__ */ 50 | -------------------------------------------------------------------------------- /tests/xmacro/colors.h: -------------------------------------------------------------------------------- 1 | /** The elements and their values are defined in a separate file colors.def. 2 | 3 | Some variante of the XMACRO pattern define another macro inline. 4 | 5 | This has consequences: 6 | 7 | * scalability: using a local macro forces to keep all elements on the same line, 8 | or with backslash continuation. 9 | * convenience: backslash continuation are error-prone 10 | * values are in a code file, which is not practical if values have to be 11 | generated. 12 | 13 | Putting all values in a separate file solves this issue. 14 | 15 | Remember that C's "#include" are of free use. The common include 16 | pattern is just one of many. All are legal. 17 | 18 | */ 19 | 20 | /** Parse the external file to declare an enum with all values. */ 21 | typedef enum color 22 | { 23 | #define _XMACRO_ELEMENT( name ) name, 24 | #include "colors.def" 25 | #undef _XMACRO_ELEMENT 26 | } color; 27 | 28 | /** Parse the external file again to declare an array of names. */ 29 | char *color_name[] = { 30 | #define _XMACRO_ELEMENT( name ) #name, 31 | #include "colors.def" 32 | #undef _XMACRO_ELEMENT 33 | }; 34 | 35 | /** Parse the external file again to count values. */ 36 | #define XMACRO_COUNT_TYPE char 37 | typedef struct 38 | { 39 | #define _XMACRO_ELEMENT( name ) XMACRO_COUNT_TYPE name; 40 | #include "colors.def" 41 | #undef ENTRY 42 | } __dummy_colorname_count_t; 43 | enum 44 | { 45 | color_count = 46 | sizeof( __dummy_colorname_count_t ) / sizeof( XMACRO_COUNT_TYPE ) 47 | }; 48 | 49 | /* When elements have varying sizes, it make sense to repeat the 50 | * struct trick above with a union. They sizeof(the_union) provides 51 | * the size of the largest element. 52 | */ 53 | 54 | /** Now it's easy to provide a conversion function. */ 55 | 56 | char * 57 | color_to_colorname( color color_ ) 58 | { 59 | return color_name[color_]; 60 | } 61 | -------------------------------------------------------------------------------- /tests/cdtc_screen_basic_test/cdtc_screen_basic_test.c: -------------------------------------------------------------------------------- 1 | #include 2 | //#include "print.h" 3 | #include "printer.h" 4 | #include 5 | #include 6 | #include 7 | 8 | uint16_t_as_uint8_t_pair_t coords_screen_basic__plot_test; 9 | 10 | uint8_t 11 | perform_test( void ) 12 | { 13 | uint32_t time_0 = fw_kl_time_please(); 14 | { 15 | do 16 | { 17 | 18 | } while ( ( ++coords_screen_basic__plot_test.as_uint16_t ) != 0 ); 19 | } 20 | uint32_t time_1 = fw_kl_time_please(); 21 | { 22 | do 23 | { 24 | fw_gra_plot_absolute( 25 | coords_screen_basic__plot_test.as_uint8_pair.low, 26 | coords_screen_basic__plot_test.as_uint8_pair.high ); 27 | } while ( ( ++coords_screen_basic__plot_test.as_uint16_t ) != 0 ); 28 | } 29 | uint32_t time_2 = fw_kl_time_please(); 30 | { 31 | cdtc_screen_basic__table_hl__fill(); 32 | do 33 | { 34 | cdtc_screen_basic__plot( 35 | coords_screen_basic__plot_test.as_uint16_t ); 36 | } while ( ( ++coords_screen_basic__plot_test.as_uint16_t ) != 0 ); 37 | } 38 | uint32_t time_3 = fw_kl_time_please(); 39 | 40 | uint32_t neutral = time_1 - time_0; 41 | uint32_t fw = time_2 - time_1 - neutral; 42 | uint32_t cdtc = time_3 - time_2 - neutral; 43 | 44 | printer_uint32_as_hex_with_prefix( neutral ); 45 | printer_uint32_as_hex_with_prefix( fw ); 46 | printer_uint32_as_hex_with_prefix( cdtc ); 47 | 48 | // Results : neutral 0194 49 | // Fw 2DFE 50 | // Cdtc 04B3 51 | // cdtc/fw = 0,1021 52 | // 0x04B3 = 1203 interrupts of 1/300s or 4,01 seconds to draw 65536 pixels. 53 | // Or 16343 pixels / second. 54 | // Or 326 pixels / frame. 55 | return 0; 56 | } 57 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/km_set_expand/test_km_expand.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define NL "\015\012" 4 | 5 | /* 0x80 redefines "f0" function key */ 6 | #define TESTTOKEN 0x80 7 | 8 | // Warning: test code assumes TESTSTRING_LENGTH <= 9 9 | #define TESTSTRING "print 42" 10 | #define NUMBER_OF_ARRAY_ELEMENTS(s) (sizeof(s)/sizeof(s[0])) 11 | 12 | /* -1 to remove NULL terminator */ 13 | #define TESTSTRING_LENGTH (NUMBER_OF_ARRAY_ELEMENTS(TESTSTRING)-1) 14 | 15 | // preprocessor black magic 16 | // https://stackoverflow.com/questions/2653214/stringification-of-a-macro-value 17 | #define xstr(a) str(a) 18 | #define str(a) #a 19 | 20 | void 21 | main() 22 | { 23 | cfwi_txt_str0_output( "Will test" NL "fw_km_set_expand(" 24 | xstr( TESTTOKEN ) ", 0x" ); 25 | fw_txt_wr_char( TESTSTRING_LENGTH + '0' ); 26 | cfwi_txt_str0_output( ", \"" TESTSTRING "\");" NL ); 27 | 28 | fw_txt_wr_char( fw_km_set_expand 29 | ( TESTTOKEN, TESTSTRING_LENGTH, TESTSTRING ) ); 30 | 31 | cfwi_txt_str0_output( NL NL "Will test fw_km_get_expand()" NL ); 32 | { 33 | uint8_t index; 34 | 35 | for ( index = 0; index < ( TESTSTRING_LENGTH + 3 ); index++ ) 36 | { 37 | uint16_t value = fw_km_get_expand( TESTTOKEN, index ); 38 | 39 | fw_txt_wr_char( 'C' ); 40 | fw_txt_wr_char( index + '0' ); 41 | fw_txt_wr_char( ' ' ); 42 | fw_txt_wr_char( value >> 8 ); 43 | fw_txt_wr_char( value & 0xff ); 44 | fw_txt_output( 13 ); 45 | fw_txt_output( 10 ); 46 | } 47 | 48 | } 49 | cfwi_txt_str0_output( "Press any key to exit C." NL ); 50 | fw_km_wait_char(); 51 | } 52 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_km/testfixture.c: -------------------------------------------------------------------------------- 1 | #include "stdint.h" 2 | 3 | #define FW_V11_AND_ABOVE 4 | 5 | #include "cfwi/cfwi.h" 6 | 7 | #define NL "\015\012" 8 | 9 | #define CPC_ARROW_RIGHT "\xf3" 10 | 11 | #define hexchar(i) ( ( (i) < 10 ) ? ( '0' + (i) ) : ( 'A' - 10 + (i) ) ) 12 | 13 | void 14 | print_uint8_as_hex( uint8_t v ) 15 | __z88dk_fastcall 16 | { 17 | fw_txt_wr_char( hexchar( v >> 4 ) ); 18 | fw_txt_wr_char( hexchar( v & 0x0F ) ); 19 | } 20 | 21 | void 22 | print_uint16_as_hex( uint16_t v ) 23 | __z88dk_fastcall 24 | { 25 | print_uint8_as_hex( v >> 8 ); 26 | print_uint8_as_hex( v ); 27 | } 28 | 29 | uint8_t perform_test( void ) 30 | { 31 | int8_t shift_lock; 32 | 33 | cfwi_txt_str0_output( "KM GET STATE and KM SET LOCKS test." NL ); 34 | 35 | for ( shift_lock = 0; shift_lock < 2 ; shift_lock++ ) 36 | { 37 | int8_t caps_lock; 38 | 39 | for ( caps_lock = 0; caps_lock < 2 ; caps_lock++ ) 40 | { 41 | uint16_t locks = ( ( caps_lock ) ? 0xFF00 : 0 ) | ( ( shift_lock ) ? 0xFF : 0 ); 42 | cfwi_txt_str0_output( NL ); 43 | print_uint16_as_hex( locks ); 44 | cfwi_txt_str0_output( " " CPC_ARROW_RIGHT " " ); 45 | fw_km_set_locks( locks ); 46 | 47 | { 48 | uint16_t locks_check = fw_km_get_state(); 49 | print_uint16_as_hex( locks_check ); 50 | 51 | { 52 | bool pass = ( locks_check == locks ); 53 | cfwi_txt_str0_output( " " CPC_ARROW_RIGHT " " ); 54 | cfwi_txt_str0_output( ( pass ) ? "PASS" : "FAIL" ); 55 | } 56 | } 57 | 58 | } 59 | 60 | } 61 | 62 | return 0; 63 | } 64 | -------------------------------------------------------------------------------- /cpclib/cpcrslib/cpcrslib_SDCC_SDCC.Makefile: -------------------------------------------------------------------------------- 1 | VARIABLES_AT_MAKEFILE_START := $(.VARIABLES) 2 | 3 | # This is a machine-readable version of [cpcrslibSDCC - cpcrslib - How to use cpcrslib in SDCC. - CPC libraries for z88dk and SDCC - Google Project Hosting](http://code.google.com/p/cpcrslib/wiki/cpcrslibSDCC) 4 | 5 | # It is intended to be used from SDCC subdirectory extracted from cpcrslib_SDCC_11.03.2012.rar 6 | 7 | VPATH = $(CPCRSLIB_SRCTREE) 8 | 9 | TARGETS=cpcrslib.lib cpcwyzlib.lib 10 | 11 | .PHONY : all 12 | all: $(TARGETS) 13 | 14 | ######################################################################## 15 | # Conjure up compiler 16 | ######################################################################## 17 | 18 | # pseudo-target sdcc is used to say "I need sdcc compiled in PATH." 19 | .PHONY: sdcc 20 | sdcc: $(CDTC_ROOT)/tool/sdcc/build_config.inc 21 | 22 | $(CDTC_ROOT)/tool/sdcc/build_config.inc: 23 | ( export LC_ALL=C ; $(MAKE) -C "$(@D)" build_config.inc ; ) 24 | 25 | ######################################################################## 26 | # Compile 27 | ######################################################################## 28 | 29 | %.rel: %.s sdcc 30 | ( . "$(CDTC_ROOT)"/tool/sdcc/build_config.inc ; set -xv ; sdasz80 -o $@ $< ; ) 31 | 32 | SRSS=$(wildcard $(VPATH)/src/*/cpc_*.s) 33 | RELS=$(patsubst %.s,%.rel,$(SRSS)) 34 | 35 | cpcrslib.lib: $(RELS) sdcc 36 | ( . "$(CDTC_ROOT)"/tool/sdcc/build_config.inc ; set -xv ; sdar rc $@ $(filter %.rel,$^) ; ) 37 | 38 | cpcwyzlib.lib: $(VPATH)/src/cpcwyzlib/Wyz.rel sdcc 39 | ( . "$(CDTC_ROOT)"/tool/sdcc/build_config.inc ; set -xv ; sdar rc $@ $(filter %.rel,$^) ; ) 40 | 41 | clean: 42 | -rm -f $(RELS) 43 | 44 | mrproper: 45 | -rm -f $(RELS) $(TARGETS) 46 | 47 | ######################################################################## 48 | # Debug the makefile 49 | ######################################################################## 50 | $(foreach v, \ 51 | $(filter-out $(VARIABLES_AT_MAKEFILE_START) VARIABLES_AT_MAKEFILE_START,$(.VARIABLES)), \ 52 | $(info $(v) = $($(v)))) 53 | -------------------------------------------------------------------------------- /samples/2dstars_01_differential/main.c: -------------------------------------------------------------------------------- 1 | #include "cfwi/cfwi.h" 2 | #include "stdint.h" 3 | #include 4 | #include //random 5 | 6 | uint8_t __at( 0x1000 ) star_4pixelsperframe_pos_byte_l[256]; 7 | uint8_t __at( 0x1100 ) star_4pixelsperframe_pos_byte_h[256]; 8 | 9 | uint8_t __at( 0x1200 ) star_2pixelsperframe_pos_byte_l[256]; 10 | uint8_t __at( 0x1300 ) star_2pixelsperframe_pos_byte_h[256]; 11 | uint8_t __at( 0x1400 ) star_2pixelsperframe_mask[256]; 12 | 13 | uint8_t __at( 0x1500 ) star_1pixel_perframe_pos_byte_l[256]; 14 | uint8_t __at( 0x1600 ) star_1pixel_perframe_pos_byte_h[256]; 15 | 16 | uint8_t __at( 0x1700 ) star_1pixel_perframe_mask[256]; 17 | 18 | void show_stars( void ); 19 | 20 | const ink_vector4 palette = { { 21 | /* border */ 22 | hardware_color_r0_g0_b0_black, 23 | /* 16 palette entries */ 24 | hardware_color_r0_g0_b0_black, 25 | hardware_color_r1_g1_b0_yellow, 26 | hardware_color_r0_g0_b2_bright_blue, 27 | hardware_color_r2_g2_b2_bright_white, 28 | } }; 29 | 30 | void 31 | main( void ) 32 | { 33 | fw_scr_set_mode( 1 ); 34 | 35 | fw_kl_choke_off__ignore_return_value(); 36 | fw_mc_set_inks__4( &palette ); 37 | 38 | cfwi_txt_str0_output( "Staaars! Reset CPC or exit emulator to stop." ); 39 | 40 | for ( int i4 = 0; i4 < 256; i4++ ) 41 | { 42 | uint16_t addr = rand(); 43 | 44 | star_4pixelsperframe_pos_byte_l[i4] = addr & 0xff; 45 | star_4pixelsperframe_pos_byte_h[i4] = 0xc0 | ( ( addr >> 8 ) & 0x3f ); 46 | } 47 | 48 | uint8_t masks[] = 49 | { 50 | 0x10, 51 | 0x20, 52 | 0x40, 53 | 0x80 54 | }; 55 | 56 | for ( int i1 = 0; i1 < 256; i1++ ) 57 | { 58 | uint16_t pos = rand(); 59 | 60 | star_1pixel_perframe_mask[i1] = masks[pos&0x3]; 61 | star_1pixel_perframe_pos_byte_l[i1] = (pos>>2) & 0xff; 62 | star_1pixel_perframe_pos_byte_h[i1] = 0xc0 | ( ( pos >> 10 ) & 0x7f ); 63 | } 64 | 65 | for ( int i2 = 0; i2 < 256; i2++ ) 66 | { 67 | uint16_t pos = rand(); 68 | 69 | star_2pixelsperframe_mask[i2] = masks[pos&0x3]; 70 | star_2pixelsperframe_pos_byte_l[i2] = (pos>>2) & 0xff; 71 | star_2pixelsperframe_pos_byte_h[i2] = 0xc0 | ( ( pos >> 10 ) & 0x7f ); 72 | } 73 | 74 | show_stars(); 75 | } 76 | -------------------------------------------------------------------------------- /tests/Makefile: -------------------------------------------------------------------------------- 1 | SHELL=/bin/bash -eu 2 | 3 | VARIABLES_AT_MAKEFILE_START := $(.VARIABLES) 4 | 5 | CDTC_ROOT=.. 6 | 7 | .PHONY: run-tests-make run-tests-shell 8 | 9 | all: all-tests summarize 10 | 11 | all-tests: run-tests-make run-tests-shell 12 | 13 | clean-tests: 14 | \rm -rfv */cap32_fortest.cfg */output */test-execution.log */test_verdict.txt */*~ */.build_dependencies_checked 15 | 16 | summarize: 17 | @( set -o pipefail ; grep -h . */test_verdict.txt | sort | uniq -c >$@.tmp && mv -f $@.tmp test-result-summary.txt ; ) 18 | @( set -o pipefail ; echo "########################################################################" ; if grep FAIL test-result-summary.txt ; then echo >&2 "At least one test fails" ; exit 1 ; else echo "ALL TEST PASS" ; exit 0 ; fi ; ) 19 | 20 | 21 | 22 | run-tests-shell: $(CDTC_ENV_FOR_CAPRICE32) 23 | @( set -o pipefail ; shopt -s nullglob ; rm -fv */output/*~ */model/*~ ; for TEST in */test.sh ; do echo "########################################################################" ; echo -ne "Shell TEST: $$TEST\t" ; bash $$TEST >$${MAKE}.log 2>&1 && echo "TEST PASS" || echo "TEST FAIL $$TEST" ; done ; exit 0 ; ) 24 | 25 | run-tests-make: 26 | @( set -o pipefail ; rm -fv */output/*~ */model/*~ ; for MAKE in */local.Makefile ; do echo "########################################################################" ; echo -ne "Make TEST: $$MAKE\t" ; ( cd "$$(dirname $$MAKE)" ; if { $(MAKE) test_verdict.txt ; diff -ur model output ; } >test-execution.log 2>&1 ; then echo "TEST PASS" ; else echo "TEST FAIL, see details in $$(dirname $$MAKE)/test-execution.log" ; fi ; ) ; done ; exit 0 ; ) 27 | 28 | ######################################################################## 29 | # Run emulator 30 | ######################################################################## 31 | 32 | CDTC_ENV_FOR_CAPRICE32=$(CDTC_ROOT)/tool/caprice32/build_config.inc 33 | 34 | $(CDTC_ENV_FOR_CAPRICE32): $(CDTC_ROOT)/tool/caprice32/Makefile 35 | ( export LC_ALL=C ; $(MAKE) -C "$(@D)" build_config.inc ; ) 36 | 37 | debug: 38 | echo $(MAKES) 39 | 40 | ######################################################################## 41 | # Debug the makefile 42 | ######################################################################## 43 | #$(foreach v, \ 44 | # $(filter-out $(VARIABLES_AT_MAKEFILE_START) VARIABLES_AT_MAKEFILE_START,$(.VARIABLES)), \ 45 | # $(info $(v) = $($(v)))) 46 | -------------------------------------------------------------------------------- /tests/fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128/testfixture.c: -------------------------------------------------------------------------------- 1 | #include "cdtc/fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128.h" 2 | #include "cfwi/cfwi.h" 3 | #include "printer.h" 4 | #include "stdint.h" 5 | #include 6 | 7 | uint8_t 8 | perform_test( void ) 9 | { 10 | fw_scr_set_ink( 1, 18, 18 ); 11 | fw_scr_set_ink( 2, 15, 15 ); 12 | fw_scr_set_ink( 3, 6, 6 ); 13 | fw_txt_win_enable( 32, 39, 0, 25 ); 14 | printf( "Filling table..." ); 15 | uint32_t time_0 = fw_kl_time_please(); 16 | fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128_fill_table(); 17 | uint32_t time_1 = fw_kl_time_please(); 18 | printf( "done.\n" ); 19 | printer_uint32_as_hex_with_prefix( time_1 - time_0 ); 20 | fw_mc_send_printer( '\n' ); 21 | 22 | { 23 | uint8_t y = 0; 24 | do 25 | { 26 | printer_uint8_as_hex_with_prefix( 27 | fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128_table[y] ); 28 | y++; 29 | } while ( y != 0 ); 30 | fw_mc_send_printer( '\n' ); 31 | } 32 | 33 | uint8_t y = 0; 34 | 35 | do 36 | { 37 | printf( "%d ", y ); 38 | printer_uint8_as_hex_with_prefix( y ); 39 | fw_mc_send_printer( ' ' ); 40 | uint8_t x = 0; 41 | 42 | do 43 | { 44 | uint16_t tz = x * y; 45 | printer_uint16_as_hex_with_prefix( tz ); 46 | fw_mc_send_printer( '=' ); 47 | 48 | // 4 * x * y = ( x + y )² - ( x - y )² 49 | // x * y = ( x + y )² / 4 - ( x - y )² / 4 50 | // x * y = table( x + y ) - table( x - y ) 51 | uint16_t z = fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_128__xmy_lt_128( 52 | ( x << 8 ) | y ); 53 | printer_uint16_as_hex_with_prefix( z ); 54 | 55 | uint8_t color = 0; 56 | 57 | switch ( tz - z ) 58 | { 59 | case 0: 60 | color = 1; 61 | break; 62 | 63 | case -1: 64 | case 1: 65 | color = 2; 66 | break; 67 | 68 | default: 69 | color = 3; 70 | }; 71 | 72 | fw_gra_set_pen( color ); 73 | 74 | fw_gra_plot_absolute( x << 1, y << 1 ); 75 | x++; 76 | } while ( ( x != 0 ) && ( x < ( 256 - y ) ) ); 77 | 78 | fw_mc_send_printer( '\n' ); 79 | y++; 80 | } while ( y < 128 ); 81 | 82 | return 0; 83 | } 84 | -------------------------------------------------------------------------------- /cpclib/cfwi/test/fw_txt/testfixture.c: -------------------------------------------------------------------------------- 1 | #include "stdint.h" 2 | #include "cfwi/cfwi.h" 3 | 4 | #define hexchar(i) ( ( (i) < 10 ) ? ( '0' + (i) ) : ( 'A' - 10 + (i) ) ) 5 | 6 | enum 7 | { 8 | x_margin = ( 40 - 33 ) / 2 + 2, 9 | y_margin = ( 25 - 16 ) / 2 + 2 10 | }; 11 | 12 | static const char const message[] = "\226\220\232\235 Amstrad CPC character set \227\232\220\234"; 13 | 14 | uint8_t perform_test( void ) 15 | { 16 | fw_scr_initialise(); 17 | fw_scr_set_border( 2, 2 ); 18 | 19 | fw_txt_set_pen( 3 ); 20 | { 21 | uint8_t column = 20 - ( sizeof( message ) - 1 ) / 2; 22 | //( 40 - ( sizeof( message )/sizeof(char) - 1 ) ) >> 1; 23 | fw_txt_set_cursor( 2, column ); 24 | cfwi_txt_str0_output( message ); 25 | } 26 | 27 | fw_txt_set_pen( 2 ); 28 | 29 | { 30 | uint8_t i = 0; 31 | 32 | do 33 | { 34 | uint8_t x = ( ( i & 0x0f ) << 1 ) + x_margin; 35 | unsigned char c = hexchar( i ); 36 | fw_txt_set_cursor( y_margin - 2, x ); 37 | fw_txt_wr_char( c ); 38 | fw_txt_set_cursor( y_margin + 17, x ); 39 | fw_txt_wr_char( c ); 40 | } 41 | while ( ++i != 16 ); 42 | } 43 | 44 | { 45 | uint8_t i = 0; 46 | const uint8_t x1 = x_margin - 2; 47 | const uint8_t x2 = x_margin + 32; 48 | 49 | do 50 | { 51 | uint8_t y = y_margin + i; 52 | unsigned char c = hexchar( i ); 53 | fw_txt_set_cursor( y, x1 ); 54 | fw_txt_wr_char( c ); 55 | fw_txt_set_cursor( y, x2 ); 56 | fw_txt_wr_char( c ); 57 | } 58 | while ( ++i != 16 ); 59 | } 60 | 61 | fw_txt_set_pen( 1 ); 62 | 63 | { 64 | uint8_t i = 0; 65 | 66 | do 67 | { 68 | uint8_t x = ( ( i & 0x0f ) << 1 ) + x_margin; 69 | uint8_t y = ( i >> 4 ) + y_margin; 70 | fw_txt_set_cursor( y, x ); 71 | fw_txt_wr_char( i ); 72 | } 73 | while ( ++i != 0 ); 74 | } 75 | return 0; 76 | } 77 | -------------------------------------------------------------------------------- /cpclib/cdtc/cdtc_screen_basic_configure_crtc.s: -------------------------------------------------------------------------------- 1 | .module cdtc_sqscr_configure_crtc 2 | 3 | .z80 4 | 5 | ;; Parameters. You can set these. 6 | 7 | ; You can customize values below, to your wishes and context 8 | 9 | _screen_first_byte_address == 0xC000 10 | _crtc_r1_disp_width_chars == 32 ; 32 chars, 64 bytes, 256-pixel wide screen (standard is 40) 11 | _crtc_r6_disp_height_chars == 32 ; 32 chars, 256-pixel high screen 12 | _crtc_r9_plus_1_disp_lines_per_char_height == 8 ; standard value 8, r9 == 7 13 | 14 | ; Don't change lines below 15 | 16 | _screen_width_in_bytes == _crtc_r1_disp_width_chars * 2 17 | _screen_total_lines == _crtc_r6_disp_height_chars * _crtc_r9_plus_1_disp_lines_per_char_height 18 | 19 | 20 | 21 | ;; Some sanity checks 22 | 23 | .iif gt, (_crtc_r1_disp_width_chars - 63) .mexit ; ERROR CPC only accepts up to 63 characters wide screen 24 | 25 | .iif gt, (_crtc_r6_disp_height_chars - 32) .mexit ; ERROR This routine so far cannot handle screens with more than 256 lines. Please comment, vote or contribue on https://github.com/cpcitor/cpc-dev-tool-chain/issues 26 | 27 | .iif gt, (_crtc_r1_disp_width_chars * _crtc_r6_disp_height_chars - 1024) .mexit ; ERROR screen specifications too big. CPC cannot output more that 1024 characters in MODE 1 without overscan. This routine does not support 32k overscan screens yet. 28 | 29 | 30 | 31 | .globl _crtc_r1_disp_width_chars 32 | .globl _crtc_r6_disp_height_chars 33 | .globl _screen_first_byte_address 34 | .globl _screen_width_in_bytes 35 | 36 | _cdtc_screen_basic__configure_crtc:: 37 | ld bc, #0xbc01 38 | out (c), c 39 | ld bc, #0xbd00 + _crtc_r1_disp_width_chars 40 | out (c), c 41 | 42 | ;; horizontal centering 43 | ld bc, #0xbc02 44 | out (c), c 45 | ld bc, #0xbd00 + 46 + ((_crtc_r1_disp_width_chars-40)/2) 46 | out (c), c 47 | 48 | ld bc, #0xbc06 49 | out (c), c 50 | ld bc, #0xbd00 + _crtc_r6_disp_height_chars 51 | out (c), c 52 | 53 | ;; vertical centering 54 | ld bc, #0xbc07 55 | out (c), c 56 | ld bc, #0xbd00 + 30 + ((_crtc_r6_disp_height_chars-24)/2) 57 | out (c), c 58 | 59 | ld bc, #0xbc09 60 | out (c), c 61 | ld bc, #0xbd00 + (_crtc_r9_plus_1_disp_lines_per_char_height - 1) 62 | out (c), c 63 | 64 | ld bc, #0xbc09 65 | out (c), c 66 | ld bc, #0xbd00 + (_crtc_r9_plus_1_disp_lines_per_char_height - 1) 67 | out (c), c 68 | 69 | ret 70 | -------------------------------------------------------------------------------- /documentation/why_this_tool.md: -------------------------------------------------------------------------------- 1 | [Back to main documentation](../README.md) 2 | 3 | ### Why would I want to use that? 4 | 5 | * If you know to program in C and want to try that for the CPC without first learning all details of all tools. 6 | * Or if you're an advanced hacker who like an open starting point to build upon (in that case you'll feel at home with the `Makefile`-based internals). 7 | 8 | ### Why would I *not* want to use that? 9 | 10 | * If you don't want to know that virtually all Integrated Development 11 | Environments are indeed graphical front-ends for a toolchain. 12 | * If anything looking like a command line or an open-source style 13 | environment makes you sick. In that case, it might be interesting 14 | for you to read Wikipedia's article about 15 | [Hacker (programmer subculture)](http://en.wikipedia.org/wiki/Hacker_%28programmer_subculture%29) 16 | and ponder whether some kind of structure or common tools helps 17 | every member of a community. 18 | 19 | ### Why have you created this tool ? 20 | 21 | #### Programming in C for the CPC is not very easy and documented 22 | 23 | * There are **two** main **compilers** with different way of doing things. 24 | * **Several tools** have to be installed (compiler, binary converter, disk/tape image manager and more converters). 25 | * There are several **output formats** on CPC side (regular file on disk, cpm replacement boot sector, ROM, tape, cartridge for CPC+). 26 | * Manual setups are possible following several tutorials 27 | * often **specific to a development platform** (Windows only or Linux only) 28 | * asking to **manually install** in specific directories, 29 | * asking to **change system settings** 30 | * To add to the confusion, there are **differing assembler syntaxes**. 31 | * Sometimes people want to help by sharing a few binary files they made, typically for Windows only, but that won't benefit from progress in tools like sdcc. 32 | * When programming or integrating resources (music, graphics), most people **manually re-run** various tools, which is **error-prone**. 33 | * **It's not obvious how to use all those tools.** 34 | 35 | #### A toolchain provides an end-to-end solution 36 | 37 | * When programming or integrating resources (music, graphics), a toolchain knows what tool to run when, with parameters. **Clean builds, no more forgotten step.** 38 | * The development cycle is **simplified**: 39 | * edit (even graphics, music, and other resources etc) 40 | * just build (nothing to think about) 41 | * run. 42 | 43 | Suggested next step: [How to install](how_to_install.md) 44 | 45 | [Back to main documentation](../README.md) 46 | -------------------------------------------------------------------------------- /cpclib/cdtc/fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_256__xmy_lt_256.s: -------------------------------------------------------------------------------- 1 | .module fctdm 2 | 3 | .z80 4 | 5 | ;; Inspired from https://www.msxcomputermagazine.nl/mccw/92/Multiplication/en.html 6 | ;; and adapted for my specific case of unsigned 8bit integers. 7 | 8 | _fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_256__xmy_lt_256_table == 0x3D00 ; 9 | 10 | _fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_256__xmy_lt_256_fill_table:: 11 | ld de,#(_fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_256__xmy_lt_256_table) 12 | ; e = 0 now because table is aligned 13 | ; e will also be the current index. Neat! 14 | ld h,e ; hl = current_square (16bit) 15 | ld l,e 16 | ;; bc is a scratch variable 17 | 1$: 18 | ld c,h 19 | ld a,l ; ca = current_square 20 | 21 | srl c 22 | rr a 23 | srl c 24 | rr a 25 | 26 | ;; Thus, a = LSB(current_square >>2). 27 | 28 | ld (de), a ; write to table 29 | inc d 30 | ld a,c 31 | ld (de), a 32 | dec d 33 | 34 | ;; Compute next square 35 | ;; Basically, that's hl = hl + index + index + 1 36 | ld b,#0 37 | ld c,e ; remember, e is also index 38 | scf 39 | adc hl,bc ; we add index +1 40 | ; carry cleared already because no overflow so adc clears carry 41 | adc hl,bc ; we add index 42 | 43 | inc de ; move pointer to next entry, increment index 44 | ld a,e 45 | and a 46 | jr nz,1$ 47 | ret 48 | 49 | 50 | _fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_256__xmy_lt_256:: 51 | ;; assumes h > l > 0 52 | ld a,h 53 | sub l 54 | jp nc, numbers_in_order 55 | neg 56 | numbers_in_order: 57 | ld d,#(>_fctdm_mul_x8_ll8_y8__x_gte_y__xpy_lt_256__xmy_lt_256_table) 58 | ld e,a ; e=h0-l0 59 | ex de,hl 60 | ld c,(hl) 61 | inc h ; switch to MSB table 62 | ld b,(hl) 63 | ; bc=(h0-l0)^2 64 | 65 | ex de,hl 66 | ld a,h 67 | add l 68 | jp c, sum_of_operands_too_big 69 | 70 | ld e,a 71 | 72 | ex de,hl 73 | ld a,(hl) ; read MSB 74 | dec h ; switch to LSB table 75 | ld l,(hl) ; read LSB 76 | ld h,a 77 | 78 | ; hl=(h0+l0)^2 79 | 80 | ;; let's bet carry = 0. Why ? Because table is not over memory 81 | ;; boundary so inc h set carry to zero. 82 | 83 | sbc hl,bc 84 | ret 85 | sum_of_operands_too_big: 86 | ld hl,#8 87 | ret 88 | -------------------------------------------------------------------------------- /tool/hex2bin/Makefile.havesourcetree: -------------------------------------------------------------------------------- 1 | SHELL=/bin/bash 2 | 3 | VARIABLES_AT_MAKEFILE_START := $(.VARIABLES) 4 | 5 | HEX2BINSOURCETREE:=$(shell cat hex2bin_srctree.ref || echo ERROR) 6 | HEX2BINBUILDTREE:=$(HEX2BINSOURCETREE) 7 | 8 | ifdef PREFIX_BIN 9 | HEX2BININSTALLTREE:=$(PREFIX_BIN) 10 | else 11 | HEX2BININSTALLTREE:=$(HEX2BINSOURCETREE).installtree/bin 12 | $(warning PREFIX not set, will install to local tree) 13 | endif 14 | 15 | TARGETS=build_config.inc 16 | 17 | default: $(TARGETS) 18 | 19 | test: 20 | @echo -e "HEX2BINSOURCETREE=\\t$(HEX2BINSOURCETREE)" 21 | @echo -e "HEX2BINBUILDTREE=\\t$(HEX2BINBUILDTREE)" 22 | @echo -e "HEX2BININSTALLTREE=\\t$(HEX2BININSTALLTREE)" 23 | 24 | $(HEX2BINBUILDTREE)/.built: hex2bin_srctree.ref 25 | @echo "************************************************************************" 26 | @echo "**************** Building in : $$(cat $<)" 27 | @echo "************************************************************************" 28 | $(MAKE) -C $$(cat "$<") 29 | touch $@ 30 | @echo "************************************************************************" 31 | @echo "**************** Build success in : $$(cat $<)" 32 | @echo "************************************************************************" 33 | 34 | .PHONY: install 35 | 36 | install: $(HEX2BINBUILDTREE)/.built 37 | @echo "************************************************************************" 38 | @echo "**************** Installing in : $($@ ; ) 52 | 53 | clean: 54 | -rm -f *~ 55 | -$(MAKE) -C $(HEX2BINBUILDTREE) clean 56 | -rm -f $(HEX2BINBUILDTREE)/.built 57 | 58 | mrproper: clean 59 | -rm -f build_config.inc 60 | -rm -rf $(HEX2BINSOURCETREE) $(HEX2BINBUILDTREE) $(HEX2BININSTALLTREE) *.ref 61 | 62 | distclean: mrproper 63 | # we do nothing more but our caller does 64 | 65 | ######################################################################## 66 | # Debug the makefile 67 | ######################################################################## 68 | $(foreach v, \ 69 | $(sort $(filter-out $(VARIABLES_AT_MAKEFILE_START) VARIABLES_AT_MAKEFILE_START,$(.VARIABLES))), \ 70 | $(info $(v) = $($(v)))) 71 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | name: "CodeQL" 7 | 8 | on: 9 | push: 10 | branches: [master] 11 | pull_request: 12 | # The branches below must be a subset of the branches above 13 | branches: [master] 14 | schedule: 15 | - cron: '0 15 * * 4' 16 | 17 | jobs: 18 | analyze: 19 | name: Analyze 20 | runs-on: ubuntu-latest 21 | 22 | strategy: 23 | fail-fast: false 24 | matrix: 25 | # Override automatic language detection by changing the below list 26 | # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] 27 | language: ['cpp'] 28 | # Learn more... 29 | # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection 30 | 31 | steps: 32 | - name: Checkout repository 33 | uses: actions/checkout@v2 34 | with: 35 | # We must fetch at least the immediate parents so that if this is 36 | # a pull request then we can checkout the head. 37 | fetch-depth: 2 38 | 39 | # If this run was triggered by a pull request event, then checkout 40 | # the head of the pull request instead of the merge commit. 41 | #- run: git checkout HEAD^2 42 | # if: ${{ github.event_name == 'pull_request' }} 43 | 44 | # Initializes the CodeQL tools for scanning. 45 | - name: Initialize CodeQL 46 | uses: github/codeql-action/init@v1 47 | with: 48 | languages: ${{ matrix.language }} 49 | # If you wish to specify custom queries, you can do so here or in a config file. 50 | # By default, queries listed here will override any specified in a config file. 51 | # Prefix the list here with "+" to use these queries and those in the config file. 52 | # queries: ./path/to/local/query, your-org/your-repo/queries@main 53 | 54 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). 55 | # If this step fails, then you should remove it and run the build manually (see below) 56 | #- name: Autobuild 57 | # uses: github/codeql-action/autobuild@v1 58 | 59 | # ℹ️ Command-line programs to run using the OS shell. 60 | # 📚 https://git.io/JvXDl 61 | 62 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines 63 | # and modify them (or add more) to build your code if your project 64 | # uses a compiled language 65 | 66 | - run: | 67 | make sdcc-all 68 | 69 | - name: Perform CodeQL Analysis 70 | uses: github/codeql-action/analyze@v1 71 | -------------------------------------------------------------------------------- /tests/multiplication_benchmark_02_fast_constant_time_ab_aplusb_aminusb/testfixture.c: -------------------------------------------------------------------------------- 1 | #include "cfwi/cfwi.h" 2 | #include "printer.h" 3 | #include "stdint.h" 4 | #include 5 | 6 | uint16_t mult_u8_u8_squares_table[256]; 7 | 8 | void 9 | fill_table( void ) 10 | { 11 | uint16_t *p = &( mult_u8_u8_squares_table[0] ); 12 | uint16_t s = 0; 13 | uint8_t i = 0; 14 | 15 | do 16 | { 17 | // s = i * i ; 18 | *( p++ ) = s >> 2; 19 | // (x+1)² = x² + 2*x + 1 20 | s += ( i << 1 ) + 1; 21 | } while ( ++i != 0 ); 22 | fw_mc_send_printer( '\n' ); 23 | } 24 | 25 | uint8_t 26 | perform_test( void ) 27 | { 28 | fw_scr_set_ink( 1, 18, 18 ); 29 | fw_scr_set_ink( 2, 15, 15 ); 30 | fw_scr_set_ink( 3, 6, 6 ); 31 | fw_txt_win_enable( 32, 39, 0, 25 ); 32 | printf( "Filling table..." ); 33 | uint32_t time_0 = fw_kl_time_please(); 34 | fill_table(); 35 | uint32_t time_1 = fw_kl_time_please(); 36 | printf( "done.\n" ); 37 | printer_uint32_as_hex_with_prefix( time_1 - time_0 ); 38 | fw_mc_send_printer( '\n' ); 39 | 40 | { 41 | uint8_t y = 0; 42 | do 43 | { 44 | printer_uint8_as_hex_with_prefix( mult_u8_u8_squares_table[y] ); 45 | y++; 46 | } while ( y != 0 ); 47 | fw_mc_send_printer( '\n' ); 48 | } 49 | 50 | uint8_t y = 0; 51 | 52 | do 53 | { 54 | printf( "%d ", y ); 55 | printer_uint8_as_hex_with_prefix( y ); 56 | fw_mc_send_printer( ' ' ); 57 | uint8_t x = y; 58 | 59 | do 60 | { 61 | uint16_t tz = x * y; 62 | printer_uint16_as_hex_with_prefix( tz ); 63 | fw_mc_send_printer( '=' ); 64 | 65 | // 4 * x * y = ( x + y )² - ( x - y )² 66 | // x * y = ( x + y )² / 4 - ( x - y )² / 4 67 | // x * y = table( x + y ) - table( x - y ) 68 | uint16_t z = mult_u8_u8_squares_table[x + y] - 69 | mult_u8_u8_squares_table[x - y]; 70 | printer_uint16_as_hex_with_prefix( z ); 71 | 72 | uint8_t color = 0; 73 | 74 | switch ( tz - z ) 75 | { 76 | case 0: 77 | color = 1; 78 | break; 79 | 80 | case -1: 81 | case 1: 82 | color = 2; 83 | break; 84 | 85 | default: 86 | color = 3; 87 | }; 88 | 89 | fw_gra_set_pen( color ); 90 | 91 | fw_gra_plot_absolute( x << 1, y << 1 ); 92 | x++; 93 | } while ( ( x != 0 ) && ( x < ( 256 - y ) ) ); 94 | 95 | fw_mc_send_printer( '\n' ); 96 | y++; 97 | } while ( y < 128 ); 98 | 99 | return 0; 100 | } 101 | -------------------------------------------------------------------------------- /documentation/quick_cygwin_install/README.md: -------------------------------------------------------------------------------- 1 | * [Next: install instructions -> After system preparation](../how_to_install.md#after-system-preparation) 2 | * [Back to main documentation](../../README.md) 3 | 4 | ### How to quickly get all prerequisites on Cygwin 5 | 6 | Download [setup-x86.exe from cygwin.com](https://cygwin.com/setup-x86.exe) and store in any location (Windows suggests your desktop folder). 7 | 8 | (Optional: store it or move it after download to some folder of your choice, e.g. a new empty folder. The installer will keep a cache of downloaded files, by default next to the installer. This might help if for any reason you'd like to start over without downloading again.) 9 | 10 | ![Download setup-x86.exe from cygwin.com](img/08h50m42s_838688034.png) 11 | 12 | Run installer. 13 | 14 | ![Run installer.](img/08h50m57s_742258801.png) 15 | 16 | Installer will ask to select root install directory. Default is fine. 17 | 18 | `cpc-dev-tool-chain` doesn't need administrator permissions, so if you're running from a non-privileged account, cygwin will automatically select the "Just Me" option. 19 | 20 | ![Select root install directory](img/08h51m01s_575552534.png) 21 | 22 | Optional at step below: select any package you may need for your own use of Cygwin. Else just press "Next". 23 | 24 | ![Just press 'next'](img/08h52m00s_844526293.png) 25 | 26 | Now a base cygwin system is installed. We'll run a command line to install packages needed by `cpc-dev-tool-chain`. 27 | In start menu choose "Run..." 28 | 29 | ![Choose "Run..."](img/09h17m55s_048931610.png) 30 | 31 | Type "cmd". 32 | 33 | ![Type "cmd"](img/09h17m55s_451573309.png) 34 | 35 | Drag-n-drop the `setup-x86` icon onto the window. This will automatically type the correct path. 36 | 37 | ![Drag-n-drop](img/09h18m45s_599936216.png) 38 | 39 | After drag-n-drop you'll see the path: 40 | 41 | ![After drag-n-drop.](img/09h18m55s_191953264.png) 42 | 43 | Now select the text below and use right click, key shortcut, whatever, to copy it to your clipboard. 44 | 45 |
46 | #Don't select the current line for copying, only the line below starting with -q...
47 |      -q -P git,make,patch,gcc,gcc-core,gcc-g++,wget,bison,flex,libboost-devel,unzip,libncurses-devel,ioperm,texinfo,zlib-devel
48 | 
49 | 
50 | 51 | Right click in terminal then select "paste". 52 | 53 | ![Paste in terminal](img/09h19m25s_916488745.png) 54 | 55 | The result will be a complete command line, like below. 56 | 57 | ![Complete command line](img/09h19m41s_894913094.png) 58 | 59 | Press Enter. The needed packages will automatically download and install. 60 | 61 | ![Everything gets installed quickly.](img/09h23m23s_869659126.png) 62 | 63 | Congratulations, your Windows is ready to host `cpc-dev-tool-chain`. 64 | 65 | ### Next 66 | 67 | * [Next: install instructions -> After system preparation](../how_to_install.md#after-system-preparation) 68 | * [Back to main documentation](../../README.md) 69 | -------------------------------------------------------------------------------- /tool/hex2bin/Makefile: -------------------------------------------------------------------------------- 1 | SHELL=/bin/bash 2 | 3 | VARIABLES_AT_MAKEFILE_START := $(.VARIABLES) 4 | 5 | TARGETS=build_config.inc 6 | 7 | .PHONY: all 8 | 9 | all: $(TARGETS) 10 | 11 | ######################################################################## 12 | # Variables to adjust at each new integrated project 13 | ######################################################################## 14 | 15 | # Tested release 16 | PRODUCT_NAME=hex2bin 17 | URL_RELEASE=http://sourceforge.net/projects/hex2bin/files/hex2bin/Hex2bin-1.0.10.tar.bz2/download 18 | 19 | URL_DOWNLOAD=$(URL_RELEASE) 20 | 21 | $(PRODUCT_NAME).downloadlog.txt: 22 | set -o pipefail ; wget -c -S $(URL_RELEASE) -O $@.downloadeddata -o $@.tmp 23 | mv -vf $@.tmp $@ 24 | 25 | $(PRODUCT_NAME)_tarball.ref: $(PRODUCT_NAME).downloadlog.txt 26 | grep -i -o '$(PRODUCT_NAME)-[^:/]*.tar.bz2' $< | uniq >$@.tmp 27 | mv -vf $@.tmp $@ 28 | mv -vf $<.downloadeddata $$(cat $@) || echo "Assuming downloaded data is already in place." 29 | @echo "************************************************************************" 30 | @echo "**************** Source archive was downloaded to : $$(cat $@)" 31 | @echo "************************************************************************" 32 | 33 | $(PRODUCT_NAME)_srctree.ref: $(PRODUCT_NAME)_tarball.ref 34 | @echo "************************************************************************" 35 | @echo "**************** Extracting source from : $$(cat $<)" 36 | @echo "************************************************************************" 37 | ( set -o pipefail ; tar jxvf "$$( cat $< )" | grep -o '^[^/]*' | uniq >$@.tmp ; ) 38 | if [[ $$( cat $@.tmp | wc -l ) != 1 ]] ; then echo "Error figuring out name of extracted directory. Found:" ; cat $@.tmp ; exit 1 ; fi 39 | mv -vf "$$(cat $@.tmp)/hex2bin" "$$(cat $@.tmp)/hex2bin.x86-elf-linux" || echo "Could not move away Linux-x86-only precompiled binaries. Hope that's ok." 40 | mv -vf "$$(cat $@.tmp)/mot2bin" "$$(cat $@.tmp)/mot2bin.x86-elf-linux" || echo "Could not move away Linux-x86-only precompiled binaries. Hope that's ok." 41 | mv -vf $@.tmp $@ 42 | @echo "************************************************************************" 43 | @echo "**************** Source extracted to : $$(cat $@)" 44 | @echo "************************************************************************" 45 | 46 | distclean: 47 | if [[ -f $(PRODUCT_NAME)_srctree.ref ]] ; then $(MAKE) -f Makefile.havesourcetree $(MAKECMDGOALS) ; fi 48 | rm -rf *.ref 49 | 50 | default test build_config.inc clean mrproper install: $(PRODUCT_NAME)_srctree.ref 51 | $(MAKE) -f Makefile.havesourcetree $(MAKECMDGOALS) 52 | 53 | ######################################################################## 54 | # Debug the makefile 55 | ######################################################################## 56 | $(foreach v, \ 57 | $(sort $(filter-out $(VARIABLES_AT_MAKEFILE_START) VARIABLES_AT_MAKEFILE_START,$(.VARIABLES))), \ 58 | $(info $(v) = $($(v)))) 59 | -------------------------------------------------------------------------------- /tool/sdcc/Makefile: -------------------------------------------------------------------------------- 1 | SHELL=/bin/bash 2 | 3 | VARIABLES_AT_MAKEFILE_START := $(.VARIABLES) 4 | 5 | TARGETS=build_config.inc 6 | 7 | .PHONY: all 8 | 9 | all: $(TARGETS) 10 | 11 | ######################################################################## 12 | # Variables to adjust at each new integrated project 13 | ######################################################################## 14 | 15 | # Tested release 16 | PRODUCT_NAME=sdcc 17 | URL_RELEASE=http://sourceforge.net/projects/sdcc/files/sdcc/3.9.0/sdcc-src-3.9.0.tar.bz2/download 18 | 19 | URL_DOWNLOAD=$(URL_RELEASE) 20 | 21 | $(PRODUCT_NAME).downloadlog.txt: 22 | set -o pipefail ; wget -c -S $(URL_RELEASE) -O $@.downloadeddata -o $@.tmp 23 | mv -vf $@.tmp $@ 24 | 25 | $(PRODUCT_NAME)_tarball.ref: $(PRODUCT_NAME).downloadlog.txt 26 | grep -i -o '$(PRODUCT_NAME)-[^:/]*.tar.bz2' $< | uniq >$@.tmp 27 | mv -vf $@.tmp $@ 28 | mv -vf $<.downloadeddata $$(cat $@) || echo "Assuming downloaded data is already in place." 29 | @echo "************************************************************************" 30 | @echo "**************** Source archive was downloaded to : $$(cat $@)" 31 | @echo "************************************************************************" 32 | 33 | $(PRODUCT_NAME)_srctree.ref: $(PRODUCT_NAME)_tarball.ref 34 | @echo "************************************************************************" 35 | @echo "**************** Extracting source from : $$(cat $<)" 36 | @echo "************************************************************************" 37 | ( set -o pipefail ; tar jxvf "$$( cat $< )" | grep -o '^[^/]*' | uniq >$@.tmp ; ) 38 | if [[ $$( cat $@.tmp | wc -l ) != 1 ]] ; then echo "Error figuring out name of extracted directory. Found:" ; cat $@.tmp ; exit 1 ; fi 39 | mv -vf $@.tmp $@ 40 | @echo "************************************************************************" 41 | @echo "**************** Source extracted to : $$(cat $@)" 42 | @echo "************************************************************************" 43 | 44 | distclean: 45 | if [[ -f $(PRODUCT_NAME)_srctree.ref ]] ; then $(MAKE) -f Makefile.havesourcetree $(MAKECMDGOALS) ; fi 46 | rm -rf *.ref 47 | 48 | # https://stackoverflow.com/questions/2527496/how-can-i-write-a-makefile-to-auto-detect-and-parallelize-the-build-with-gnu-mak#answer-2527627 49 | NPROCS:=1 50 | OS:=$(shell uname -s) 51 | 52 | ifeq ($(OS),Linux) 53 | NPROCS:=$(shell grep -c ^processor /proc/cpuinfo) 54 | endif 55 | ifeq ($(OS),Darwin) # Assume Mac OS X 56 | NPROCS:=$(shell system_profiler | awk '/Number Of CPUs/{print $4}{next;}') 57 | endif 58 | 59 | default test build_config.inc clean mrproper install: $(PRODUCT_NAME)_srctree.ref 60 | $(MAKE) -j$(NPROCS) -f Makefile.havesourcetree $(MAKECMDGOALS) 61 | 62 | ######################################################################## 63 | # Debug the makefile 64 | ######################################################################## 65 | $(foreach v, \ 66 | $(sort $(filter-out $(VARIABLES_AT_MAKEFILE_START) VARIABLES_AT_MAKEFILE_START,$(.VARIABLES))), \ 67 | $(info $(v) = $($(v)))) 68 | -------------------------------------------------------------------------------- /tool/gfx2crtc/Makefile: -------------------------------------------------------------------------------- 1 | SHELL=/bin/bash 2 | 3 | VARIABLES_AT_MAKEFILE_START := $(.VARIABLES) 4 | 5 | TARGETS=build_config.inc 6 | 7 | .PHONY: all 8 | 9 | all: $(TARGETS) 10 | 11 | ######################################################################## 12 | # Variables to adjust at each new integrated project 13 | ######################################################################## 14 | 15 | PRODUCT_NAME=gfx2crtc 16 | 17 | # You must set EXTRACT_DIR_NAME to match archive content. 18 | EXTRACT_DIR_NAME=$(PRODUCT_NAME) 19 | 20 | # If only one generated executable file, set BUILD_TARGET_FILE to path to it. 21 | # It several generated executable files, do not set BUILD_TARGET_FILE. 22 | BUILD_DIR=$(EXTRACT_DIR_NAME) 23 | BUILD_TARGET_FILE=$(EXTRACT_DIR_NAME)/cap32 24 | 25 | ROM_PROVIDER_LOCATION=../rom 26 | ROM_LOCATION=$(ROM_PROVIDER_LOCATION)/roms 27 | 28 | .PHONY: all roms 29 | 30 | rom: $(ROM_LOCATION)/.extracted 31 | 32 | $(ROM_LOCATION)/.extracted: 33 | $(MAKE) -C $(ROM_PROVIDER_LOCATION) 34 | 35 | $(EXTRACT_DIR_NAME)/.unpacked: 36 | @echo "************************************************************************" 37 | @echo "**************** Extracting source from: $^" 38 | @echo "************************************************************************" 39 | git submodule update --init $(EXTRACT_DIR_NAME) 40 | touch $@ 41 | @echo "************************************************************************" 42 | @echo "**************** Source extracted to: $(@D)" 43 | @echo "************************************************************************" 44 | 45 | BUILD_TARGET_FILE?=$(EXTRACT_DIR_NAME)/gfx2crtc 46 | 47 | $(BUILD_TARGET_FILE): $(EXTRACT_DIR_NAME)/.unpacked 48 | @echo "************************************************************************" 49 | @echo "**************** Configuring and build in: $^" 50 | @echo "************************************************************************" 51 | $(MAKE) -C "$(BUILD_DIR)" --print-directory 52 | touch "$@" 53 | @echo "************************************************************************" 54 | @echo "**************** Configured and built in: $(@D)" 55 | @echo "************************************************************************" 56 | 57 | build_config.inc: $(BUILD_TARGET_FILE) Makefile 58 | (set -eu ; \ 59 | { \ 60 | echo "# with bash do \"source\" this file." ; \ 61 | cd "$($@ ; ) 64 | 65 | run: build_config.inc roms 66 | ( . build_config.inc ; cap32_once ) 67 | 68 | clean: 69 | -$(MAKE) -C "$(BUILD_DIR)" clean 70 | -rm -f $(BUILD_TARGET_FILE) 71 | 72 | mrproper: 73 | -rm -f $(BUILD_TARGET_FILE) 74 | -rm -f $(TARGETS) 75 | -rm -rf $(EXTRACT_DIR_NAME) ._$(EXTRACT_DIR_NAME) *~ 76 | -rm -f $(PRODUCT_NAME) 77 | 78 | distclean: mrproper 79 | -rm -f $(ARCHIVE_NAME) 80 | 81 | ######################################################################## 82 | # Debug the makefile 83 | ######################################################################## 84 | $(foreach v, \ 85 | $(filter-out $(VARIABLES_AT_MAKEFILE_START) VARIABLES_AT_MAKEFILE_START,$(.VARIABLES)), \ 86 | $(info $(v) = $($(v)))) 87 | -------------------------------------------------------------------------------- /cpclib/cfwi/src/fw_nowrapperneeded.s: -------------------------------------------------------------------------------- 1 | ;; This file gathers calls for which no actual wrapper (no additional code) is needed. 2 | ;; This is because the firmware behavior already matches what SDCC expects. Just defining a symbol is enough. 3 | 4 | ;; Most have the simplest prototype: void function(void) 5 | ;; But not all. For example, fw_km_get_state 6 | 7 | _fw_km_initialise == 0xBB00 8 | _fw_km_reset == 0xBB03 9 | 10 | _fw_km_get_state == 0xBB21 11 | _fw_km_get_joystick == 0xBB24 12 | 13 | _fw_km_get_delay == 0xBB42 14 | 15 | _fw_km_disarm_break == 0xBB48 16 | _fw_km_break_event == 0xBB4B 17 | _fw_km_set_locks == 0xBD3A 18 | 19 | _fw_gra_initialise == 0xBBBA 20 | _fw_gra_reset == 0xBBBD 21 | _fw_gra_move_absolute__fastcall == 0xBBC0 22 | _fw_gra_move_relative__fastcall == 0xBBC3 23 | _fw_gra_ask_cursor == 0xBBC6 24 | _fw_gra_set_origin__fastcall == 0xBBC9 25 | _fw_gra_get_origin == 0xBBCC 26 | 27 | _fw_gra_win_width__fastcall == 0xBBCF 28 | _fw_gra_win_height__fastcall == 0xBBD2 29 | _fw_gra_get_w_width == 0xBBD5 30 | _fw_gra_get_w_height == 0xBBD8 31 | _fw_gra_clear_window == 0xBBDB 32 | 33 | _fw_gra_plot_absolute__fastcall == 0xBBEA 34 | _fw_gra_plot_relative__fastcall == 0xBBED 35 | _fw_gra_test_absolute__fastcall == 0xBBF0 36 | _fw_gra_test_relative__fastcall == 0xBBF3 37 | _fw_gra_line_absolute__fastcall == 0xBBF6 38 | _fw_gra_line_relative__fastcall == 0xBBF9 39 | 40 | _fw_cas_initialise == 0xBC65 41 | _fw_cas_in_abandon == 0xBC7D 42 | _fw_cas_return == 0xBC86 43 | _fw_cas_out_abandon == 0xBC92 44 | 45 | _fw_kl_choke_off__ignore_return_value == 0xBCC8 46 | _fw_kl_rom_walk == 0xBCCB 47 | 48 | ;; _fw_kl_scan_needed == 0xB92A 49 | 50 | _fw_txt_initialise == 0xBB4E 51 | _fw_txt_reset == 0xBB51 52 | _fw_txt_vdu_enable == 0xBB54 53 | _fw_txt_vdu_disable == 0xBB57 54 | 55 | _fw_txt_win_enable__fastcall == 0xBB66 56 | _fw_txt_get_window == 0xBB69 57 | _fw_txt_set_cursor__fastcall == 0xBB75 58 | 59 | _fw_txt_cur_enable == 0xBB7B 60 | _fw_txt_cur_disable == 0xBB7E 61 | _fw_txt_cur_on == 0xBB81 62 | _fw_txt_cur_off == 0xBB84 63 | _fw_txt_place_cursor == 0xBB8A 64 | _fw_txt_remove_cursor == 0xBB8D 65 | 66 | _fw_txt_clear_window == 0xBB6C 67 | 68 | _fw_txt_inverse == 0xBB9C 69 | 70 | _fw_txt_get_matrix__ignore_rom_indication == 0xBBA5 71 | 72 | _fw_txt_get_controls == 0xBBB1 73 | 74 | _fw_mc_boot_program == 0xBD13 75 | _fw_mc_wait_flyback == 0xBD19 76 | _fw_mc_reset_printer == 0xBD28 77 | 78 | _fw_jre_jump_restore == 0xBD37 79 | 80 | _fw_scr_initialise == 0xBBFF 81 | _fw_scr_reset == 0xBC02 82 | _fw_scr_set_offset == 0xBC05 83 | _fw_scr_clear == 0xBC14 84 | 85 | ;; 664 and 6128 only 86 | _fw_km_flush == 0xBD3D 87 | _fw_gra_default == 0xBD43 88 | 89 | ;; The firmware indirections: NOT C-callable functions! 90 | ;; _fw_txt_draw_cursor == 0xBDCD 91 | ;; _fw_txt_undraw_cursor == 0xBDD0 92 | ;; _fw_scr_mode_clear == 0xBDEB 93 | 94 | _fw_kl_sync_reset == 0xBCF5 95 | _fw_kl_event_disable == 0xBD04 96 | _fw_kl_event_enable == 0xBD07 97 | _fw_sound_reset == 0xBCA7 98 | _fw_sound_continue == 0xBCB9 99 | 100 | ;; long int function (void); 101 | 102 | _fw_kl_time_please == 0xBD0D 103 | --------------------------------------------------------------------------------