david 660767c464 o add snes fatfs dummy
o add fatfs custom chip to bsnes
o finishes fatfs linux backend smaple
2009-05-26 17:07:39 +02:00

97 lines
1.6 KiB
C

#include "data.h";
#include "pad.h";
#include "event.h";
extern padStatus pad1;
extern word scrollValue;
char fadeOut(word counter) {
static byte fadeOutValue;
if(counter == 0) {
// init fade value
fadeOutValue = 0x0f;
} else {
fadeOutValue--;
}
*(byte*) 0x2100 = fadeOutValue;
if(fadeOutValue == 0x00) {
return EVENT_STOP;
} else {
return EVENT_CONTINUE;
}
}
char fadeIn(word counter) {
static byte fadeInValue;
if(counter == 0) {
// init fade value
fadeInValue = 0x00;
} else {
fadeInValue++;
}
*(byte*) 0x2100 = fadeInValue;
if(fadeInValue >= 0x0f) {
return EVENT_STOP;
} else {
return EVENT_CONTINUE;
}
}
char mosaicOut(word counter) {
static byte mosaicOutValue;
if(counter == 0) {
// init fade value
mosaicOutValue = 0xff;
} else {
mosaicOutValue -= 0x10;
}
*(byte*) 0x2106 = mosaicOutValue;
if(mosaicOutValue == 0x0f) {
return EVENT_STOP;
} else {
return EVENT_CONTINUE;
}
}
char mosaicIn(word counter) {
static byte mosaicInValue;
if(counter == 0) {
// init fade value
mosaicInValue = 0x0f;
} else {
mosaicInValue += 0x10;
}
*(byte*) 0x2106 = mosaicInValue;
if(mosaicInValue == 0xff) {
return EVENT_STOP;
} else {
return EVENT_CONTINUE;
}
}
char NMIReadPad(word counter) {
pad1 = readPad((byte) 0);
return EVENT_CONTINUE;
}
char scrollLeft(word counter) {
scrollValue++;
*(byte*) 0x210d = (byte) scrollValue;
*(byte*) 0x210d = (byte) (scrollValue>>8);
return EVENT_CONTINUE;
}