Added verify

This commit is contained in:
Dreaded_X 2020-01-22 20:41:39 +01:00
parent 2bdc9a5581
commit 1d0f621243
3 changed files with 21 additions and 9 deletions

View File

@ -1,3 +1,2 @@
set makeprg=./tools/build.sh set makeprg=./build.sh
map <silent> <F10> :Start ./tools/upload_stm32.sh<cr> map <silent> <F10> :Start python.exe rootfs$(pwd)/upload.py rootfs$(pwd)/.build/fib.bin<cr>
map <silent> <F20> :Start python.exe rootfs$(pwd)/tools/upload_z80.py rootfs$(pwd)/build/fib.z80<cr>

View File

@ -1,11 +1,10 @@
.org $0000 .org $0000
main: main:
init: init:
ld hl, out+7 ld hl, out
ld a, (amount) ld a, (amount)
ld d, a ld d, a
dec d
ld a, (y) ld a, (y)
ld b, a ld b, a
@ -25,6 +24,19 @@ loop:
dec d dec d
jp nz, loop jp nz, loop
verify_init:
ld hl, out
ld a, (amount)
ld d, a
verify:
ld a, (hl)
inc hl
dec d
jp nz, verify
done: done:
halt halt
@ -35,4 +47,5 @@ x:
.db 0 .db 0
y: y:
.db 1 .db 1
out:
out .equ $1000

View File

@ -16,8 +16,8 @@ def progressbar(it, prefix="", size=60, file=sys.stdout):
file.flush() file.flush()
def main(): def main():
if len(sys.argv) == 3: if len(sys.argv) == 2:
ser = serial.Serial(sys.argv[1], timeout=1, write_timeout=1) ser = serial.Serial("COM3", timeout=1, write_timeout=1)
if ser.is_open: if ser.is_open:
# Clear out any existing input # Clear out any existing input
ser.write(b'\n') ser.write(b'\n')
@ -27,7 +27,7 @@ def main():
ser.write(b'#u\n') ser.write(b'#u\n')
print(ser.readline()) print(ser.readline())
path = sys.argv[2] path = sys.argv[1]
size = os.path.getsize(path) size = os.path.getsize(path)
ser.write([size]) ser.write([size])
i = 0 i = 0