www.pudn.com > bak22.rar > Index2.asm, change:2006-05-30,size:3377b


GetInsPlayIndex: 
         R1=0 
         [_FileOk]=R1 
GetInsPlayIndex0: 
         R1=[_InsertFileIndex] 
         CMP R1,[_InsertFileNumber] 
         JB GetInsPlayIndex_ 
         PC=GetInsPlayIndexFinish 
GetInsPlayIndex_: 
         R2=R1 LSL 1 
         R1+=R2 
         R3=[_InsertPlayAddr] 
         R4=[_InsertPlayBank] 
         CALL NandAddrAdd 
         R5=3 
         R2=_NandBuf 
         CALL ReadNandByteBuf 
         R1=[_NandBuf+0] 
         [FileFlag]=R1 
         R1=[_NandBuf+1] 
         [FileSeriousL]=R1 
         R1=[_NandBuf+2] 
         [FileSeriousH]=R1 
         R1=R1 LSL 4 
         R1=R1 LSL 4 
         R1|=[FileSeriousL] 
         [FileSerious]=R1 
         R1=[FileFlag] 
         TEST R1, Bit7 
         JNE GetInsPlayIndexSpecial 
GetInsPlayIndexNormal: 
         R1=[_FileOk] 
         CMP R1, 0 
         JNE GetInsPlayIndexWithSound 
 
         R1=[_InsertFileIndex] 
         R1+=1 
         [_InsertFileIndex]=R1 
 
         R1=[FileFlag] 
         TEST R1,0x0f 
         JE GetInsPlayIndexNormal_ 
         R1&=0x0f 
         CMP R1,[_PlayMode] 
         JNE GetInsPlayIndexNormalCir 
GetInsPlayIndexNormal_: 
         R1=1 
         [_FileOk]=R1 
         R1=[FileSerious] 
         [_Index]=R1 
GetInsPlayIndexNormalCir: 
         PC=GetInsPlayIndex0 
 
GetInsPlayIndexFinish: 
         R1=0 
         [_InsMode]=R1 
GetInsPlayIndexOk: 
         R1=[_FileOk] 
         CMP R1, 0 
         JNE GetInsPlayIndexWithSound 
GetInsPlayIndexNoSound: 
         DATAOUT 
         R1=0 
         RETF 
GetInsPlayIndexWithSound: 
         R1=[_PrevDelayTime] 
         JE GetInsPlayIndexWithDirectSound 
         R1=[_SysFlagA]                    // sound with delay 
         R1|=PlayIndexBit 
         [_SysFlagA]=R1 
         DATAOUT 
         R1=0 
         RETF 
GetInsPlayIndexWithDirectSound: 
         DATAOUT 
         R1=1                              // sound for direct play 
         RETF 
 
GetInsPlayIndexSpecial: 
         R3=[_InsertFileIndex] 
         R3+=1 
         [_InsertFileIndex]=R3 
         CMP R1, dInsFSUnitOff 
         JNE GetInsPlayIndexSpecial1 
         JMP InsFSUnitOff 
GetInsPlayIndexSpecial1: 
         CMP R1, dInsFSStop 
         JNE GetInsPlayIndexSpecial2 
         JMP InsFSStop 
GetInsPlayIndexSpecial2: 
         CMP R1, dInsFSPrevDelay 
         JNE GetInsPlayIndexSpecial3 
         JMP InsFSPrevDelay 
GetInsPlayIndexSpecial3: 
         CMP R1, dInsFSContinue 
         JNE GetInsPlayIndexSpecial4 
         JMP InsFSPrevContinue 
GetInsPlayIndexSpecial4: 
         PC=GetInsPlayIndex0 
//=============================================== 
InsFSUnitOff: 
         R1=[_FileOk] 
         CMP R1, 0 
         JNE InsFSUnitOff_ 
         PC=FSTurnOffUnit 
InsFSUnitOff_: 
         R3=[_InsertFileIndex] 
         R3-=1 
         [_InsertFileIndex]=R3 
         PC=GetInsPlayIndexWithSound 
//=============================================== 
InsFSStop: 
         R1=[_FileOk] 
         CMP R1, 0 
         JE InsFSStop_ 
         R3=[_InsertFileIndex] 
         R3-=1 
         [_InsertFileIndex]=R3 
InsFSStop_: 
         CALL SoundAllStop 
         R1=0 
         RETF 
 
InsFSPrevDelay: 
         CMP R4,0 
         JE InsFSPrevDelayEnd 
         R1=[FileSeriousL] 
         [_PrevDelayTime]=R1 
InsFSPrevDelayEnd: 
         PC=GetInsPlayIndex0 
 
InsFSPrevContinue: 
         PC=GetInsPlayIndex0