mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 05:32:47 +00:00
- compile with size optimizations, reduces inst cache pressure
- removed most of lodepng's optional features - lodepng now uses the already existing CRC32 code instead of using its own copy - fixed GIC interrupt priority
This commit is contained in:
parent
cadc7e6982
commit
2f64a8046a
2
Makefile
2
Makefile
@ -30,7 +30,7 @@ export INCLUDE := -I"$(shell pwd)/common"
|
||||
|
||||
export ASFLAGS := -g -x assembler-with-cpp $(INCLUDE)
|
||||
export CFLAGS := -DDBUILTS="\"$(DBUILTS)\"" -DDBUILTL="\"$(DBUILTL)\"" -DVERSION="\"$(VERSION)\"" -DFLAVOR="\"$(FLAVOR)\"" \
|
||||
-g -O2 -Wall -Wextra -Wpedantic -Wcast-align -Wformat=2 -Wno-main \
|
||||
-g -Os -Wall -Wextra -Wpedantic -Wcast-align -Wformat=2 -Wno-main \
|
||||
-fomit-frame-pointer -ffast-math -std=gnu11 -MMD -MP \
|
||||
-Wno-unused-function -Wno-format-truncation $(INCLUDE) -ffunction-sections -fdata-sections
|
||||
export LDFLAGS := -Tlink.ld -nostartfiles -Wl,--gc-sections,-z,max-page-size=512
|
||||
|
@ -151,12 +151,13 @@ void PXI_RX_Handler(u32 __attribute__((unused)) irqn)
|
||||
void __attribute__((noreturn)) MainLoop(void)
|
||||
{
|
||||
// enable PXI RX interrupt
|
||||
GIC_Enable(PXI_RX_INTERRUPT, BIT(0), GIC_HIGHEST_PRIO, PXI_RX_Handler);
|
||||
GIC_Enable(PXI_RX_INTERRUPT, BIT(0), GIC_HIGHEST_PRIO + 2, PXI_RX_Handler);
|
||||
|
||||
// enable MCU interrupts
|
||||
GIC_Enable(MCU_INTERRUPT, BIT(0), GIC_HIGHEST_PRIO + 1, MCU_HandleInterrupts);
|
||||
|
||||
GIC_Enable(VBLANK_INTERRUPT, BIT(0), GIC_HIGHEST_PRIO + 2, VBlank_Handler);
|
||||
// set up VBlank interrupt to always have the highest priority
|
||||
GIC_Enable(VBLANK_INTERRUPT, BIT(0), GIC_HIGHEST_PRIO, VBlank_Handler);
|
||||
|
||||
// ARM9 won't try anything funny until this point
|
||||
PXI_Barrier(ARM11_READY_BARRIER);
|
||||
|
@ -2,8 +2,9 @@
|
||||
// https://github.com/eai04191/beat/blob/master/nall/crc32.hpp
|
||||
// Ported by Hyarion for use with VirtualFatFS
|
||||
|
||||
#include "crc32.h"
|
||||
#include "common.h"
|
||||
#include "crc32.h"
|
||||
#include "vff.h"
|
||||
|
||||
u32 crc32_adjust(u32 crc32, u8 input) {
|
||||
static const u32 crc32_table[256] = {
|
||||
|
@ -3,7 +3,8 @@
|
||||
// Ported by Hyarion for use with VirtualFatFS
|
||||
|
||||
#pragma once
|
||||
#include "vff.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
u32 crc32_adjust(u32 crc32, u8 input);
|
||||
u32 crc32_calculate(u32 crc32, const u8* data, u32 length);
|
||||
|
@ -215,7 +215,7 @@ void slideByte(sCompressInfo* a_pInfo, const u8* a_pSrc) {
|
||||
}
|
||||
}
|
||||
|
||||
inline void slide(sCompressInfo* a_pInfo, const u8* a_pSrc, int a_nSize) {
|
||||
static inline void slide(sCompressInfo* a_pInfo, const u8* a_pSrc, int a_nSize) {
|
||||
for (int i = 0; i < a_nSize; i++) {
|
||||
slideByte(a_pInfo, a_pSrc--);
|
||||
}
|
||||
|
@ -36,13 +36,6 @@ static u32 A0_Response = 0xFFFFFFFFu;
|
||||
static u32 rand1 = 0;
|
||||
static u32 rand2 = 0;
|
||||
|
||||
u32 BSWAP32(u32 val) {
|
||||
return (((val >> 24) & 0xFF)) |
|
||||
(((val >> 16) & 0xFF) << 8) |
|
||||
(((val >> 8) & 0xFF) << 16) |
|
||||
((val & 0xFF) << 24);
|
||||
}
|
||||
|
||||
// updated function by profi200
|
||||
static void ResetCardSlot(void)
|
||||
{
|
||||
|
@ -12,8 +12,8 @@
|
||||
|
||||
|
||||
#define LATENCY 0x822Cu
|
||||
#define BSWAP32(n) __builtin_bswap32(n)
|
||||
|
||||
u32 BSWAP32(u32 val);
|
||||
|
||||
void Cart_Init(void);
|
||||
int Cart_IsInserted(void);
|
||||
|
@ -39,6 +39,18 @@ compiler command to disable them without modifying this header, e.g.
|
||||
In addition to those below, you can also define LODEPNG_NO_COMPILE_CRC to
|
||||
allow implementing a custom lodepng_crc32.
|
||||
*/
|
||||
|
||||
#define LODEPNG_NO_COMPILE_CRC
|
||||
#define LODEPNG_NO_COMPILE_DISK
|
||||
#define LODEPNG_NO_COMPILE_ANCILLARY_CHUNKS
|
||||
#define LODEPNG_NO_COMPILE_ERROR_TEXT
|
||||
|
||||
#include "crc32.h"
|
||||
static inline unsigned lodepng_crc32(const unsigned char *data, size_t length)
|
||||
{
|
||||
return crc32_calculate(0, data, length);
|
||||
}
|
||||
|
||||
/*deflate & zlib. If disabled, you must specify alternative zlib functions in
|
||||
the custom_zlib field of the compress and decompress settings*/
|
||||
#ifndef LODEPNG_NO_COMPILE_ZLIB
|
||||
|
@ -18,6 +18,7 @@
|
||||
#define SR_NOINT (SR_NOFIQ | SR_NOIRQ)
|
||||
|
||||
#ifdef ARM9
|
||||
#define CPU_FREQ (134055928)
|
||||
#define CR_MPU BIT(0)
|
||||
#define CR_DCACHE BIT(2)
|
||||
#define CR_ICACHE BIT(12)
|
||||
@ -38,6 +39,7 @@
|
||||
#define MAX_IRQ (32)
|
||||
#define MAX_CPU (1)
|
||||
#else // ARM11
|
||||
#define CPU_FREQ (268111856)
|
||||
#define CR_MMU BIT(0)
|
||||
#define CR_ALIGN BIT(1)
|
||||
#define CR_DCACHE BIT(2)
|
||||
|
Loading…
x
Reference in New Issue
Block a user