wram analysis
This commit is contained in:
26
snes/wram/pad.c
Normal file
26
snes/wram/pad.c
Normal file
@@ -0,0 +1,26 @@
|
||||
#include "data.h";
|
||||
#include "pad.h";
|
||||
#include "debug.h";
|
||||
|
||||
void enablePad(void)
|
||||
{
|
||||
// Enable pad reading and NMI
|
||||
*(byte *) 0x4200 = 0x01;
|
||||
}
|
||||
|
||||
void disablePad(void)
|
||||
{
|
||||
// Enable pad reading and NMI
|
||||
*(byte *) 0x4200 = 0x00;
|
||||
}
|
||||
|
||||
padStatus readPad(byte padNumber)
|
||||
{
|
||||
word test;
|
||||
padStatus *status;
|
||||
padNumber = padNumber << 1;
|
||||
test = (word) * (byte *) 0x4218 + padNumber << 8;
|
||||
test |= (word) * (byte *) 0x4219 + padNumber;
|
||||
status = (padStatus *) & test;
|
||||
return *status;
|
||||
}
|
||||
Reference in New Issue
Block a user