#
# z180-stamp command script
#
#
# Set environment to 'factory' defaults
defaultenv
# show/trace command execution
setenv cli xtrace
#setenv cli verbose,xtrace
# enable commands for debugging
#cmd=debug
#
setenv cpm3_file 1:/cpm3_0.6.8-23.sys
setenv bootcmd 'pin ${pins}; reset; run attach_drives; loadc; go ${startaddress}'
#
setenv d0 1:/cpm3_a.dsk
setenv d1 1:/cpm3_b.dsk
setenv d2 0:/cpm3_c.dsk
setenv d3 1:/z180-stamp-cpm3-bios.dsk
setenv d4 1:/z180.dsk
setenv attach_drives 'at -da; at dsk0 ${d0};at dsk1 ${d1};at dsk2 ${d2};at dsk3 ${d3};at dsk4 ${d4}' #;at dsk5 ${d5};at dsk6 ${d6};at dsk7 ${d7}
#
# Einstellungen und Pinbezeichnungen für die Basiskarte
setenv singlestep 1
# Nr. Pin  Alias  Zustand
# 0  (PG5) CSTART Pullup High						; Monitor
# 1  (PG4) SD1_CS Output High						; CS SD1 auf ECB
# 2  (PB4) PB4    Output Low						; N.c.
# 3  (PB5) OC1A   Clock, divide by 2 (9216000Hz)	; OC1A Counter
# 4  (PB6) V24_EN Pullup High						; Disable RS232 Treiber
# 5  (PB7) PB7    Pullup High 						; N.c.
# 6  (PG3) SD1_CD Pullup Low						; CD SD1 auf ECB
# 7  (PG2) WAIT   Pullup High						; Wait Z180
# 8  (PG1) RUN    Output Low						; RUN/STEP Logic auf ECB
# 9  (PG0) STEP   Output High						; RUN/STEP Logic auf ECB
# 10 (PE7) CLKO   Pullup High						; AVR Clock
setenv pin_alias 0:CSTART,1:SD1_CS,2:PB4,3:OC1A,4:V24_EN,5:PB7,6:SD1_CD,7:WAIT,8:RUN,9:STEP,10:CLKO
setenv pins 2,8 low 9 high 3 2
setenv esc_char '0x40'
#
#some test and debug commands
setenv test_fat_0 'fatstat 0:; fatls 0:'
setenv test_fat_1 'fatstat 1:; fatls 1:'
setenv test_sd_0 'sd status 0; sd init 0; sd info 0'
setenv test_sd_1 'sd status 1; sd init 1; sd info 1'
setenv ddtz 'pin 3 2; loadf; mw 3 0; g 0; con'
setenv debug-dsk 'at -o reattach,debug dsk0;at -o reattach,debug dsk1;at -o reattach,debug dsk2'
#
setenv cli
echo Env setup completed successfully.
echo 'Enter "saveenv" to make changes permanent.'
