X-Git-Url: http://cloudbase.mooo.com/gitweb/avrcpm.git/blobdiff_plain/02d57479e7411595d7b8b9507e63034d81091ad1..12a27f27734b18ba4dea8d411095cf53c3870ef2:/avr/dsk_mgr.asm diff --git a/avr/dsk_mgr.asm b/avr/dsk_mgr.asm index c9ff9e0..ba88cfe 100644 --- a/avr/dsk_mgr.asm +++ b/avr/dsk_mgr.asm @@ -2,6 +2,7 @@ ; systems ; ; Copyright (C) 2010 Frank Zoll +; Copyright (C) 2013 Leo C. ; ; This file is part of avrcpm. ; @@ -22,24 +23,6 @@ ; -; -------------------------- Defines for the disk management Structures - -; Partition Table Structures - -#define PART_TYPE 4 -#define PART_START 8 -#define PART_SIZE 12 - -/* - * Partition table id - * (see http://www.win.tue.nl/~aeb/partitions/partition_types-1.html) - */ -#define PARTID1_FAT16 0x0E -#define PARTID2_FAT16 0x06 -#define PARTID_CPM 0x52 - - -; ------------------------------------------------ Start of Code Segment .cseg ; ==================================================================== @@ -47,7 +30,7 @@ ; ==================================================================== ; Parameters ; -------------------------------------------------------------------- -; +; ; Registers : [w] temp Number of disk images (raw and fat16) found. ; + 0x80 if sd card changes. (not used, doesn't work) ; SREG : Z according to temp @@ -60,7 +43,7 @@ ; on the Disk will be used for a detailed analyses. If there ; are any Files like "cpm_x.img" are found, these Files will be ; used as Disks by the CP/M- System. ( x must be in the Range A to D ) -; ==================================================================== +; ==================================================================== mgr_init_partitions: sts ndisks,_0 ; Set Number of Disks to 0 @@ -77,7 +60,7 @@ mgr_picl: lcall mmcInit andi temp,MMCST_NOINIT | MMCST_NODISK brne mgr_pierr - + ;Load first sector from MMC (boot sector) ldiw y,0 ; Sector 0 movw x,y @@ -98,7 +81,7 @@ mgr_check_bootsektor: ;Test, if it has a valid MBR lds temp,hostbuf+510 ;MBR signature (0xAA55) at and of sector? - cpi temp,0x55 + cpi temp,0x55 lds temp,hostbuf+510+1 ldi temp2,0xAA cpc temp,temp2 @@ -131,7 +114,7 @@ mgr_search: #if CPMDSK_SUPPORT -; Search for valid Partitions and ImageFiles +; Search for valid Partitions and ImageFiles ldiw z,hostbuf+510-64 ;Point to first byte of partition table mgr_ploop: @@ -142,14 +125,14 @@ mgr_ploop: ; Test for CP/M Partition cpi temp,PARTID_CPM brne mgr_nextp - - rcall cpm_add_partition + + lcall cpm_add_partition inc temp3 sts ndisks,temp3 adiw y,PARTENTRY_SIZE cpi temp3,MAXDISKS breq mgr_pend - + mgr_nextp: adiw z,16 cpi zl,low(hostbuf+510) ;End of partition table reached? @@ -277,7 +260,7 @@ mgr_prtb_nofat: rcall mgr_prnt_diskname rcall mgr_prnt_table_ram rjmp mgr_prnt_size -mgr_prnt_noramdisk: +mgr_prnt_noramdisk: #endif #endif @@ -297,7 +280,7 @@ mgr_prnt_size: lcall print_ultoa printstring "KB." -mgr_goto_next_part: +mgr_goto_next_part: adiw z,PARTENTRY_SIZE inc xh dec yl @@ -307,7 +290,7 @@ mgr_pppre: pop r14 pop r15 ret - + mgr_prnt_diskname: push temp @@ -348,5 +331,3 @@ mgr_prnt_table_ram: mgr_prnt_table_err: printstring "Unknown Entry at: " ret - -