if (!(conf_handle = fopen(PATH_CONFIG, "w")))
abort("Failed to open config for write?\n");
- config.options[OPTION_RECONFIGURED] = 0; // This should not persist to disk.
+ config.options[OPTION_RECONFIGURED] = 0; // This should not persist to disk.
fwrite(&config, 1, sizeof(config), conf_handle);
fclose(conf_handle);
- config.options[OPTION_RECONFIGURED] = 1; // Save caches on boot.
+ config.options[OPTION_RECONFIGURED] = 1; // Save caches on boot.
}
@waitcycles ( u32 us )
waitcycles:
- PUSH {R0-R2,LR}
- STR R0, [SP,#4]
- waitcycles_loop:
- LDR R3, [SP,#4]
- SUBS R2, R3, #1
- STR R2, [SP,#4]
- CMP R3, #0
- BNE waitcycles_loop
- POP {R0-R2,PC}
+ PUSH {R0-R2,LR}
+ STR R0, [SP,#4]
+ waitcycles_loop:
+ LDR R3, [SP,#4]
+ SUBS R2, R3, #1
+ STR R2, [SP,#4]
+ CMP R3, #0
+ BNE waitcycles_loop
+ POP {R0-R2,PC}
/ an RTC function or valid timestamp is not needed, set _FS_NORTC to 1 to disable
/ the timestamp feature. All objects modified by FatFs will have a fixed timestamp
/ defined by _NORTC_MON, _NORTC_MDAY and _NORTC_YEAR.
-/ When timestamp feature is enabled (_FS_NORTC == 0), get_fattime() function need
+/ When timestamp feature is enabled (_FS_NORTC == 0), get_fattime() function need
/ to be added to the project to read current time form RTC. _NORTC_MON,
/ _NORTC_MDAY and _NORTC_YEAR have no effect.
/ These options have no effect at read-only configuration (_FS_READONLY == 1). */
sdmmc_write16(REG_SDSTATUS0, 0);
sdmmc_write16(REG_SDSTATUS1, 0);
#ifdef DATA32_SUPPORT
-// if(readdata)sdmmc_mask16(REG_DATACTL32, 0x1000, 0x800);
-// if(writedata)sdmmc_mask16(REG_DATACTL32, 0x800, 0x1000);
-// sdmmc_mask16(REG_DATACTL32,0x1800,2);
+// if(readdata)sdmmc_mask16(REG_DATACTL32, 0x1000, 0x800);
+// if(writedata)sdmmc_mask16(REG_DATACTL32, 0x800, 0x1000);
+// sdmmc_mask16(REG_DATACTL32,0x1800,2);
#else
sdmmc_mask16(REG_DATACTL32, 0x1800, 0);
#endif
} while ((handelSD.ret[0] & 0x80000000) == 0);
// do
//{
- // sdmmc_send_command(&handelSD,0x10437,handelSD.initarg << 0x10);
- // sdmmc_send_command(&handelSD,0x10769,0x00FF8000 | temp);
+ // sdmmc_send_command(&handelSD,0x10437,handelSD.initarg << 0x10);
+ // sdmmc_send_command(&handelSD,0x10769,0x00FF8000 | temp);
//
- // DEBUGPRINT(topScreen, "sd error ", handelSD.error, 10, 20 + 17*8, RGB(40, 40, 40), RGB(208, 208, 208));
- // DEBUGPRINT(topScreen, "sd ret: ", handelSD.ret[0], 10, 20 + 18*8, RGB(40, 40, 40), RGB(208, 208, 208));
- // DEBUGPRINT(topScreen, "count: ", count++, 10, 20 + 19*8, RGB(40, 40, 40), RGB(208, 208, 208));
+ // DEBUGPRINT(topScreen, "sd error ", handelSD.error, 10, 20 + 17*8, RGB(40, 40, 40), RGB(208, 208, 208));
+ // DEBUGPRINT(topScreen, "sd ret: ", handelSD.ret[0], 10, 20 + 18*8, RGB(40, 40, 40), RGB(208, 208, 208));
+ // DEBUGPRINT(topScreen, "count: ", count++, 10, 20 + 19*8, RGB(40, 40, 40), RGB(208, 208, 208));
//}
// while(!(handelSD.ret[0] & 0x80000000));
fclose(data);
- // memcpy(svc_tab_open, svcbackdoor, sizeof(svcbackdoor));
+ // memcpy(svc_tab_open, svcbackdoor, sizeof(svcbackdoor));
svcTable[0x7B] = 0xFFFF0000 + ((uint8_t *)svc_tab_open - (uint8_t *)exceptionsPage);
svc_tab_open += size;
unsigned int c_font_w = (font_w / 8) + (font_w % 8 ? 1 : 0);
- for (unsigned int yy = 0; yy < font_h; yy++) {
- int xDisplacement = (x * SCREEN_DEPTH * height);
- int yDisplacement = ((height - (y + yy) - 1) * SCREEN_DEPTH);
- unsigned int pos = xDisplacement + yDisplacement;
+ for (unsigned int yy = 0; yy < font_h; yy++) {
+ int xDisplacement = (x * SCREEN_DEPTH * height);
+ int yDisplacement = ((height - (y + yy) - 1) * SCREEN_DEPTH);
+ unsigned int pos = xDisplacement + yDisplacement;
unsigned char char_dat = ((char*)FCRAM_FONT_LOC)[(character - ' ') * (c_font_w * font_h) + yy];
for(unsigned int i=0; i < font_w + font_kern; i++) {
if (color_bg == 0) {
screen[pos + 2] = color_bg;
}
- if (char_dat & 0x80) {
+ if (char_dat & 0x80) {
if (color_fg == 0) {
screen[pos] = buffer_bg[pos];
screen[pos + 1] = buffer_bg[pos + 1];
screen[pos + 1] = color_fg >> 8;
screen[pos + 2] = color_fg;
}
- }
+ }
char_dat <<= 1;
- pos += SCREEN_DEPTH * height;
+ pos += SCREEN_DEPTH * height;
}
- }
+ }
}
unsigned char color_top = 0xf0;
cursor_x[0] = 0;
cursor_y[0] = 0;
-/* uint32_t col = SCREEN_TOP_HEIGHT * SCREEN_DEPTH;
+/* uint32_t col = SCREEN_TOP_HEIGHT * SCREEN_DEPTH;
uint32_t one_c = 8 * SCREEN_DEPTH;
for (unsigned int x = 0; x < width * 8; x++) {
memmove(&screen[x * col + one_c], &screen[x * col + one_c], col - one_c);
uint8_t *destc = (uint8_t *)dest;
const uint8_t *srcc = (const uint8_t *)src;
- for(size_t i=0; i < size; i++) {
+ for(size_t i=0; i < size; i++) {
destc[i] = srcc[i];
}
}
const uint8_t *srcc = (const uint8_t *)src;
// Finish by copying the leftovers
- for(size_t i=size; i > 0; i--) {
+ for(size_t i=size; i > 0; i--) {
destc[i-1] = srcc[i-1];
}
}
char *destc = (char *)dest;
// Finish
- for(size_t i = 0; i < size; i++) {
+ for(size_t i = 0; i < size; i++) {
destc[i] = filler;
}
}