#define FAT16_BSO_NUMFATCP 0x10 ; Offset to Ammount of FAT Copys
#define FAT16_BSO_NUMDIRENT 0x11 ; Offset to Max. Root Dir. Entrys
#define FAT16_FIRST_IMAGENAME 'A' ; First letter of filename to search
+#define FAT16_LAST_IMAGENAME 'Z' ; Last letter of filename to
+/*
#define FAT16_LAST_IMAGENAME 'A'+MAXDISKS-1 ; Last letter of filename to
; search
+*/
; ############################################################################
; Start of Data Segment
; Found a valid image
.if FAT16_DEBUG > 1
- printstring "Found a valid Image ! Z="
+ printstring "Found a valid Image! Z="
mov temp ,zl
mov temp2,zh
rcall printhexw
.endif
ldiw y,hostparttbl
- lds temp,ndisks
+ lds temp3,ndisks
fat_look_store_loop:
- cp temp,_0
+ tst temp3
breq fat_look_store
adiw y,PARTENTRY_SIZE
- dec temp
+ dec temp3
rjmp fat_look_store_loop
fat_look_store:
; Convert Filesize to ammount of sectors
; (calc with 512byte/sector)
+ ldd _tmp0,z+0x1C
ldd xl,z+0x1D
ldd xh,z+0x1E
ldd zl,z+0x1F
; mov zh,_0
+ cpse _tmp0,_0 ;round up
+ adiw x,1
+ adc zl,_0
+
lsr zl
ror xh
ror xl
+ adc xl,_0
+ adc xh,_0
+ adc zl,_0
+
; store ammount of sectors in partitiontable
tst zl ;file size larger than 65535 sectors?
fat_hostlend:
lds temp ,hostlba
lds temp2,hostlba+1
- lds temp3,hostlba+2
+; lds temp3,hostlba+2
ldd xl,z+5 ; get size of disk in sectors
#endif
+; vim:set ts=8 noet nowrap
+