-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a21f99
commit 3213075
Showing
14 changed files
with
199 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,4 @@ hardware/bin/**/*.doc | |
|
||
apps/bin/ | ||
releases/ | ||
.vscode |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
SHELL := /bin/sh | ||
.ONESHELL: | ||
MAKEFLAGS += --warn-undefined-variables | ||
MAKEFLAGS += --no-builtin-rules | ||
|
||
all: LINE.COM | ||
|
||
.PHONY: LINE.COM | ||
LINE.COM: | ||
@ez80-cc --optimise speed --output-dir ../bin LINE.COM line.c ../common/config_request.c ../common/v9958.asm ../common/v9958.c random.asm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/usr/bin/env bash | ||
|
||
source ~/.ez80-clang | ||
|
||
SCRIPT_DIR=$(dirname "$0") | ||
SCRIPT_DIR=$(cd "${SCRIPT_DIR}/" && pwd)/../../clang-tool-chain/ | ||
|
||
# export EZ80_CLANG_SYSTEM_INCLUDE_PATH=${SCRIPT_DIR}/include | ||
# export EZ80_CLANG_LIB_PATH=${SCRIPT_DIR}/lib/ | ||
# export EZ80_CLANG_LS_PATH=${SCRIPT_DIR}/linker-scripts/ | ||
|
||
# export INCLUDE_PATHS="-isystem ${SCRIPT_DIR}/include -isystem ${SCRIPT_DIR}/working/llvm-project/build/lib/clang/15.0.0/include/" | ||
# PATH="${SCRIPT_DIR}working/llvm-project/build/bin:${SCRIPT_DIR}working/opt/ez80-none-elf/bin/:${PATH}" | ||
|
||
# shopt -s expand_aliases | ||
# alias ez80-clang="clang -nostdinc" | ||
# alias ez80-as="ez80-none-elf-as" | ||
# alias ez80-ld="ez80-none-elf-ld" | ||
|
||
|
||
set -e | ||
|
||
echo "Compiling line.c -> line.s" | ||
ez80-clang ${INCLUDE_PATHS} -nostdinc -ffunction-sections -fdata-sections -Oz -Wall -Wextra -Wunreachable-code -Werror -mllvm -z80-print-zero-offset -S line.c -c -o line.s | ||
|
||
# echo "Compiling line.s -> line.o" | ||
# ez80-as -march=ez80+full -a=./line.lst ./line.s -o ./line.o | ||
|
||
pushd ../common | ||
echo "Compiling config_request.c -> config_request.s" | ||
ez80-clang ${INCLUDE_PATHS} -nostdinc -ffunction-sections -fdata-sections -Oz -Wall -Wextra -Wunreachable-code -Werror -mllvm -z80-print-zero-offset -S config_request.c -c -o config_request.s | ||
|
||
# echo "Compiling config_request.s -> config_request.o" | ||
# ez80-as -march=ez80+full -a=./config_request.lst ./config_request.s -o ./config_request.o | ||
|
||
echo "Compiling v9958.c -> v9958.s" | ||
ez80-clang ${INCLUDE_PATHS} -nostdinc -ffunction-sections -fdata-sections -O3 -Wall -Wextra -Wunreachable-code -Werror -mllvm -z80-print-zero-offset -S v9958.c -c -o v9958.s | ||
|
||
popd | ||
|
||
# echo "Compiling v9958.asm -> v9958.o" | ||
# ez80-as -march=ez80+full -a=./v9958.asm.lst ./v9958.asm -o ./v9958.o | ||
|
||
# echo "Compiling nanoprintf.c -> nanoprintf.s" | ||
# ez80-clang ${INCLUDE_PATHS} -nostdinc -ffunction-sections -fdata-sections -Oz -Wall -Wextra -Wunreachable-code -Werror -mllvm -z80-print-zero-offset -S nanoprintf.c -c -o nanoprintf.s | ||
|
||
# echo "Compiling nanoprintf.s -> nanoprintf.o" | ||
# ez80-as -march=ez80+full -a=./nanoprintf.lst ./nanoprintf.s -o ./nanoprintf.o | ||
|
||
|
||
# echo "Linking libcrt.a main.o -> main.com" | ||
# ez80-ld -T ${EZ80_CLANG_LS_PATH}cpm-64k.ld --relax -O1 --gc-sections --strip-discarded --orphan-handling=error --print-map-discarded -Map=main.map -L${EZ80_CLANG_LIB_PATH} -lcrt ./mbrot.o ./config_request.o v9958.o -lclib -lcrt --oformat binary -o main.com | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#include "../common/config_request.h" | ||
#include "../common/v9958.h" | ||
#include <cpm.h> | ||
#include <math.h> | ||
#include <stdio.h> | ||
// | ||
extern uint8_t get_random_seed(void); | ||
|
||
RGB palette[16] = { | ||
{0, 0, 0}, {1, 0, 0}, {4, 0, 0}, {4, 1, 1}, {15, 0, 0}, {0, 1, 0}, {0, 4, 0}, {1, 4, 1}, | ||
{1, 8, 1}, {0, 0, 1}, {0, 0, 4}, {1, 1, 4}, {1, 1, 8}, {10, 0, 10}, {0, 15, 15}, {15, 15, 15}, | ||
}; | ||
|
||
int main(void) { | ||
const uint8_t mode = getVideoMode(); | ||
const uint8_t lines = getLineCount(); | ||
|
||
srand(get_random_seed()); | ||
setMode6(lines, mode); | ||
setPalette(palette); | ||
clearScreenBank0(4); | ||
// uint8_t c = rand() & 15; | ||
unsigned int i = 0; | ||
|
||
printf("Press any key to abort\r\n"); | ||
|
||
// for (unsigned int i = 0; i < 4000; i++) { | ||
while (true) { | ||
if (cpm_rawio() != 0) | ||
return 0; | ||
drawLine(rand() % 512, i % lines, rand() % 512, i % lines, rand() & 15, CMD_LOGIC_IMP); | ||
i++; | ||
} | ||
|
||
// return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
.assume adl = 1 | ||
|
||
section .text,"ax",@progbits | ||
|
||
.global _get_random_seed | ||
|
||
_get_random_seed: | ||
LD A, R | ||
LD L, A | ||
RET |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.