0 Members and 2 Guests are viewing this topic.
Available flash is a different story.
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) ;GetHWVer add a,a add a,a ld d,0 ld e,a ld hl,GetTotalArc_HWValues add hl,de jr ConvArcGetTotalArc_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)&$FFGetFreeArc:;——————————————————————————————————————————————;;—> 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 hlConvArc:;——————————————————————————————————————————————;;—> 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,7ConvArc_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
Runer112, that was really helpful, thanks.SirCmpwn told me about a BCall that returns Free Archive, _ChkFreeArc.However, yours is more precise as it returns the same free archive listed in MEMORY, and the BCall is not so accurate.
Code: [Select] B_CALL($5014) ;ArcChk
B_CALL($5014) ;ArcChk