ORG &4000 DUMP &8000 ;Report "command": ;10 versions (0-8, 0 does all other 8) ;(c)1991 Simon Cooke ;Poke 16385 with report wanted. ;0 - Print full system report (but not Systems Variables) ;1 - Display ROM version number ;2 - Display DOS version and type (SAMDOS or MASTERDOS) ;3 - Report size of internal memory present ;4 - Report number of external drives (1 or 2) ;5 - Display number of pages reserved for BASIC and highest poss. CLEAR ; address. ;6 - Display number of utility pages reserved and number of free pages. ;7 - Print open screen list -- page of each screen and its BASIC address. ;8 - Print ROM startup message. ;9 - Display REPORTER version number and copyright ;10- Print systems variables report. reporter: LD A,10 CALL report RET report: OR A JP NZ,notallreps allreports: LD A,1 CALL &014E LD A,8 CALL report LD A,13 RST 16 LD A,1 CALL report LD A,2 CALL report LD A,13 RST 16 LD A,4 CALL report LD A,13 RST 16 LD A,3 CALL report LD A,13 RST 16 LD A,5 CALL report LD A,13 RST 16 LD A,6 CALL report LD A,13 RST 16 LD A,7 CALL report LD A,13 RST 16 repversion: LD DE,mess LD BC,endmess-mess CALL &0013 RET mess: DEFM "REPORT utility v1.0" DEFB 13 DEFM " 1991 Simon Cooke and FRED magaz" DEFM "ine" DEFB 13 endmess: EQU endmess notallreps: PUSH AF LD A,&FE ;set stream to point to upper screen CALL &0112 POP AF CP 2 JP Z,repdos CP 3 JP Z,repkpresent CP 4 JP Z,repdrives CP 5 JP Z,repbasic CP 6 JP Z,repfree CP 7 JP Z,repscreens CP 8 JP Z,repinfo CP 9 JR Z,repversion CP 10 JP Z,repsysvars reprom: LD A,(&000F) ;calculate ROM version number and LD B,A ;print it onscreen. RST 40 DEFB &23,&EC,&05,&33 CALL &017E PUSH DE PUSH BC LD DE,rommess LD BC,endromm-rommess CALL &0013 POP BC POP DE CALL &0013 LD A,13 RST 16 RET rommess: DEFM "SAM Coupe ROM v" endromm: EQU endromm repdos: RST 40 DEFB &21,&07,&23,&49 DEFB &47,&25,&26,30,&12,&33 CALL &0121 OR A JR Z,masterdos samdos: RST 40 DEFB &EC,&05,&33 CALL &017E PUSH DE PUSH BC LD DE,samdosm LD BC,endsamd-samdosm CALL &0013 POP BC POP DE CALL &0013 LD A,13 RST 16 RET samdosm: DEFM "SAMDOS v" endsamd: EQU endsamd masterdos: RST 40 DEFB &26,20 DEFB &03,&EC,&05,&33 CALL &017E PUSH DE PUSH BC LD DE,masdosm LD BC,endmasm-masdosm CALL &0013 POP BC POP DE CALL &0013 LD A,13 RST 16 RET masdosm: DEFM "MasterDOS v" endmasm: EQU endmasm repkpresent: LD A,(&5CB4) INC A LD B,A RST 40 DEFB &23,&26,&10,&00,&33 CALL &017E PUSH DE PUSH BC LD DE,repkm LD BC,endrepk-repkm CALL &0013 POP BC POP DE CALL &0013 LD DE,repk2m LD BC,endrpk2-repk2m CALL &0013 LD A,(&5CB4) INC A LD B,A RST 40 DEFB &23,&33 CALL &017E CALL &0013 LD DE,repk3m LD BC,endrpk3-repk3m CALL &0013 LD A,13 RST 16 RET repkm: DEFM "Memory visible to BASIC: " endrepk: EQU $ repk2m: DEFM "k (" endrpk2: EQU $ repk3m: DEFM " pages overall)" endrpk3: EQU $ repk4m: DEFM "Mb external memory" repdrives: CALL checknodrive LD B,A PUSH AF RST 40 DEFB &23,&33 CALL &017E CALL &0013 POP AF CP 1 JR Z,dr1 LD DE,drmes1 LD BC,enddrm1-drmes1 JR putdmess dr1: LD DE,drmes2 LD BC,enddrm2-drmes2 putdmess: CALL &0013 RET drmes1: DEFM " disc drives fitted" DEFB 13 enddrm1: EQU $ drmes2: DEFM " disc drive fitted" DEFB 13 enddrm2: EQU $ checknodrive: XOR A checkloop: LD BC,247 OUT (C),A LD B,10 lo: DJNZ lo LD D,A LD BC,247 IN A,(C) CP D JR NZ,only1drive LD A,D INC A JR NZ,checkloop LD A,2 RET only1drive: LD A,1 RET repbasic: LD A,(&5CB0) INC A LD B,A PUSH AF RST 40 DEFB &23,&33 CALL &017E CALL &0013 LD DE,basm LD BC,endbasm-basm CALL &0013 POP AF INC A LD B,A RST 40 DEFB &23,&26,14,&32,&00,&E9,&03,&33 CALL &017E CALL &0013 LD A,13 RST 16 RET basm: DEFM " pages open to BASIC" DEFB 13 DEFM "Highest possible CLEAR address: " endbasm: EQU $ repfree: LD HL,&5100 LD B,32 LD C,0 pfreel: LD A,(HL) INC HL OR A JR NZ,notfreep INC C notfreep: DJNZ pfreel LD B,C RST 40 DEFB &23,&33 CALL &017E CALL &0013 LD DE,frpm LD BC,endfrpm-frpm CALL &0013 LD HL,&5100 LD B,32 LD C,0 upagel: LD A,(HL) INC HL CP &20 JR NZ,notupage INC C notupage: DJNZ upagel LD B,C RST 40 DEFB &23,&33 CALL &017E CALL &0013 LD DE,upm LD BC,endupm-upm CALL &0013 RET upm: DEFM " utility pages reserved" DEFB 13 endupm: EQU $ frpm: DEFM " pages unallocated (free)" DEFB 13 endfrpm: EQU $ repscreens: LD HL,(&5C9D) LD A,(HL) AND 31 LD C,A LD A,(&5A40) RRCA RRCA RRCA OR C LD (HL),A LD DE,scrm1 LD BC,endscrm1-scrm1 CALL &0013 LD HL,&5CA0 LD B,16 scrloop: LD A,(HL) INC HL CP 255 JR Z,scrclosed PUSH BC PUSH HL PUSH AF LD DE,&5C9F SBC HL,DE LD B,L RST 40 DEFB &23,&33 CALL &017E CALL &0013 LD DE,scrm2 LD BC,endscrm2-scrm2 CALL &0013 POP AF PUSH AF AND 96 RLCA RLCA RLCA INC A LD B,A RST 40 DEFB &23,&33 CALL &017E CALL &0013 LD DE,scrm3 LD BC,endscrm3-scrm3 CALL &0013 POP AF AND 31 PUSH AF LD B,A RST 40 DEFB &23,&33 CALL &017E CALL &0013 LD DE,scrm4 LD BC,endscrm4-scrm4 CALL &0013 POP AF INC A LD B,A RST 40 DEFB &23,&26,14,&32,&00,&33 CALL &017E CALL &0013 LD A,13 RST 16 POP HL POP BC scrclosed: DJNZ scrloop RET scrm1: DEFM "Open screen list:" DEFB 13 endscrm1: EQU $ scrm2: DEFM ": Mode " endscrm2: EQU $ scrm3: DEFM ", page " endscrm3: EQU $ scrm4: DEFM ", address " endscrm4: EQU $ repinfo: IN A,(250) PUSH AF OR 64 OUT (250),A LD DE,62941 XOR A CALL &0115 POP AF OUT (250),A LD A,"e" RST 16 LD A,13 RST 16 RET sv1m: DEFM "Current line cursor: " lncur: DEFB ">" DEFB 13 DEFM "Caps lock off cursor: " lccur: DEFB 128 DEFB 13 DEFM "Caps lock on cursor: " uccur: DEFB 129 DEFB 13 DEFM "Caps lock is: " endsv1m: EQU $ sv2m: DEFB 13 DEFM "Character used by BIN$ as 1: " bin1dig: DEFB "1" DEFB 13 DEFM "Character used by BIN$ as 0: " bin0dig: DEFB "0" DEFB 13 DEFM "Character used by INSTR as " DEFB 34 DEFM "match anything" DEFB 34 DEFM ": " insthash: DEFB "#" DEFB 13 DEFM "Delay for flashing colours: " endsv2m: EQU $ sv3m: DEFM " (50ths sec)" DEFB 13 DEFM "Screen black out after 22 mins: " endsv3m: EQU $ sv4m: DEFB 13 DEFM "ESCape key recognition is: " endsv4m: EQU $ sv5m: DEFB 13 DEFM "Function keys act as: " endsv5m: EQU $ fkeym1: DEFM "macro generators" DEFB 13 endfkeym1: EQU $ fkeym2: DEFM "numerical keypad" DEFB 13 endfkeym2: EQU $ onm: DEFM "on" endonm: EQU $ offm: DEFM "off" endoffm: EQU $ sv8m: DEFM "Keyboard repeat rate: " endsv8m: EQU $ repsysvars: LD A,1 CALL &014E LD A,8 CALL report LD A,13 RST 16 LD B,6 LD IX,svartab svarloop: LD L,(IX+0) LD H,(IX+1) LD E,(IX+2) LD D,(IX+3) INC IX INC IX INC IX INC IX LD A,(HL) LD (DE),A DJNZ svarloop LD DE,sv1m LD BC,endsv1m-sv1m CALL &0013 LD A,(&5C6A) OR A JR NZ,capson capsoff: LD DE,offm LD BC,endoffm-offm CALL &0013 JR svar2 capson: LD DE,onm LD BC,endonm-onm CALL &0013 svar2: LD DE,sv2m LD BC,endsv2m-sv2m CALL &0013 LD A,(&5A08) LD B,A RST 40 DEFB &23,&33 CALL &017E CALL &0013 LD DE,sv3m LD BC,endsv3m-sv3m CALL &0013 LD A,(&5A32) OR A JR Z,scroffon LD DE,offm LD BC,endoffm-offm CALL &0013 JR svar4 scroffon: LD DE,onm LD BC,endonm-onm CALL &0013 svar4: LD DE,sv4m LD BC,endsv4m-sv4m CALL &0013 LD A,(&5B41) OR A JR Z,escon LD DE,offm LD BC,endoffm-offm CALL &0013 JR svar5 escon: LD DE,onm LD BC,endonm-onm CALL &0013 svar5: LD DE,sv5m LD BC,endsv5m-sv5m CALL &0013 LD A,(&5C67) RR A JR NC,function keypad: LD DE,fkeym2 LD BC,endfkeym2-fkeym2 CALL &0013 JR svar7 function: LD DE,fkeym1 LD BC,endfkeym1-fkeym1 CALL &0013 svar7: LD DE,sv8m LD BC,endsv8m-sv8m CALL &0013 LD A,(&5C0A) LD B,A RST 40 DEFB &23,&33 CALL &017E CALL &0013 LD A,13 RST 16 LD DE,sv9m LD BC,endsv9m-sv9m CALL &0013 LD A,(&5C09) LD B,A RST 40 DEFB &23,&33 CALL &017E CALL &0013 LD A,13 RST 16 LD A,13 RST 16 JP repversion sv9m: DEFM "Keyboard repeat delay: " endsv9m: EQU $ RET svartab: DEFW &5A00,lncur,&5A01,lccur DEFW &5A02,uccur,&5A03,bin1dig DEFW &5A04,bin0dig,&5A05,insthash