match some of fraser/cuyler files.

This commit is contained in:
Prakxo
2022-12-21 00:00:29 +01:00
parent a25019b474
commit 26186c33ee
15 changed files with 183 additions and 3 deletions
@@ -0,0 +1,5 @@
#include "random_field.h"
int mRF_GetRandomStepMode(void) {
return mRF_GetRandom(100) < 15;
}
+10
View File
@@ -0,0 +1,10 @@
#include "random_field.h"
int mRF_MakePerfectBit(void) {
int perfect_bit = 0;
int i;
for (i = 0; i < mRF_PERFECT_BIT; i++) {
perfect_bit |= 1 << i;
}
return perfect_bit;
}
+17
View File
@@ -0,0 +1,17 @@
#include "roomtype.h"
#define FTR_NO_2_FTR_IDX(f) ((f) >> 2)
#define NUM_FTR_IN_TYPE (FTR_NO_2_FTR_IDX(0x1000))
#define IS_FTR(f) ((f) == FG_FTR0_TYPE || (f) == FG_FTR1_TYPE)
extern int mRmTp_FtrItemNo2FtrIdx(u16 ftr_no) {
int type = GET_FG_TYPE(ftr_no);
if (IS_FTR(type)) {
if (type == FG_FTR0_TYPE) {
return FTR_NO_2_FTR_IDX(ftr_no - FTR0_NO_START);
}
return FTR_NO_2_FTR_IDX(ftr_no - FTR1_NO_START) + NUM_FTR_IN_TYPE;
}
return NULL_NO;
}