Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Program Name: Memory Checker
- ; Author: David Gomes
- ; Version: 1.0
- ; Written for Doors CS 7.0 and higher
- .nolist
- #include "ti83plus.inc"
- #include "dcs7.inc"
- .list
- .org progstart
- .db $BB,$6D
- Init:
- B_CALL (_ClrLCDFull)
- set textWrite,(IY + sGrFlags)
- set fracDrawLFont,(IY + fontFlags)
- ld a,1
- ld (penCol), a
- ld (penRow), a
- ld hl,Title
- B_CALL (_VPutS)
- ld a,17
- ld (penRow),a
- ld a,1
- ld (penCol),a
- ld hl,RAMText
- B_CALL (_VPutS)
- ld a,41
- ld (penRow),a
- ld a,1
- ld (penCol),a
- ld hl,ARCText
- B_CALL (_VPutS)
- ld h,0
- ld l,9
- ld d,95
- ld e,9
- ld a,1
- call fastline
- res fracDrawLFont,(IY + fontFlags)
- ld a,10
- ld (penRow),a
- ld a,20
- ld (penCol),a
- B_CALL (_memchk)
- call VDispHL
- ld a,17
- ld (penRow),a
- ld a,20
- ld (penCol),a
- ld hl,OutOf
- B_CALL (_VPutS)
- ld a,24
- ld (penRow),a
- ld a,20
- ld (penCol),a
- ld hl,24756
- call VDispHL
- call GetFreeArc
- ld a,35
- ld (penRow),a
- ld a,20
- ld (penCol),a
- B_CALL (_VPutS)
- ld a,41
- ld (penRow),a
- ld a,20
- ld (penCol),a
- ld hl,OutOf
- B_CALL (_VPutS)
- call GetTotalArc
- ld a,47
- ld (penRow),a
- ld a,20
- ld (penCol),a
- B_CALL (_VPutS)
- call iFastCopy
- B_CALL (_GetKey)
- res textWrite,(IY + sGrFlags)
- ret
- RAMText:
- .db "RAM",0
- ARCText:
- .db "ARC",0
- Title:
- .db "Memory Checker",0
- OutOf:
- .db "out of",0
- ;The following code was made by Runer112
- GetTotalArc:
- ;——————————————————————————————————————————————;
- ;—> Returns the total amount of user archive as a 7-character decimal string
- ;INPUTS: none
- ;OUTPUTS: hl=pointer to string (OP3)
- ;DESTROYS: af bc de ix
- ;——————————————————————————————————————————————;
- B_CALL($80BA)
- add a,a
- add a,a
- ld d,0
- ld e,a
- ld hl,GetTotalArc_HWValues
- add hl,de
- jr ConvArc
- GetTotalArc_HWValues:
- .db (10*$4000)>>24&$FF,(10*$4000)>>16&$FF,(10*$4000)>>8&$FF,(10*$4000)&$FF
- .db (94*$4000)>>24&$FF,(94*$4000)>>16&$FF,(94*$4000)>>8&$FF,(94*$4000)&$FF
- .db (30*$4000)>>24&$FF,(30*$4000)>>16&$FF,(30*$4000)>>8&$FF,(30*$4000)&$FF
- .db (94*$4000)>>24&$FF,(94*$4000)>>16&$FF,(94*$4000)>>8&$FF,(94*$4000)&$FF
- GetFreeArc:
- ;——————————————————————————————————————————————;
- ;—> Returns the amount of free archive as a 7-character decimal string
- ;INPUTS: none
- ;OUTPUTS: hl=pointer to string (OP3)
- ;DESTROYS: af bc de ix
- ;——————————————————————————————————————————————;
- B_CALL($5014) ;ArcChk
- ex de,hl
- inc hl
- ConvArc:
- ;——————————————————————————————————————————————;
- ;—> Converts a 32-bit integer into a 7-character decimal string
- ;INPUTS: hl=pointer to 32-bit integer (big-endian)
- ;OUTPUTS: hl=pointer to string (OP3)
- ;DESTROYS: af bc de ix
- ;——————————————————————————————————————————————;
- rst 20h
- ld hl,OP3+7
- ld de,10
- ld (hl),d
- ld b,7
- ConvArc_Loop1:
- push bc
- push hl
- B_CALL($80B1) ;Div32By16
- pop hl
- pop bc
- ld a,(OP2+3)
- add a,'0'
- dec hl
- ld (hl),a
- djnz ConvArc_Loop1
- ld d,h
- ld e,l
- ld bc,6<<8+'0'
- ConvArc_Loop2:
- ld a,(de)
- cp c
- ret nz
- ld a,' '
- ld (de),a
- inc de
- djnz ConvArc_Loop2
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement