Skip to content

Commit

Permalink
Support null destination in cardPolledTransfer (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
d3m3vilurr authored and WinterMute committed Oct 25, 2017
1 parent b448ff8 commit 9dcc1bd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/common/card.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "nds/memory.h"
#include "nds/bios.h"

#include <stdio.h>

//---------------------------------------------------------------------------------
void cardWriteCommand(const u8 *command) {
Expand All @@ -54,9 +55,8 @@ void cardPolledTransfer(u32 flags, u32 *destination, u32 length, const u8 *comma
// Read data if available
if (REG_ROMCTRL & CARD_DATA_READY) {
data=REG_CARD_DATA_RD;
if (destination < target)
*destination = data;
destination++;
if (NULL != destination && destination < target)
*destination++ = data;
}
} while (REG_ROMCTRL & CARD_BUSY);
}
Expand Down

0 comments on commit 9dcc1bd

Please sign in to comment.