Skip to content

Commit 5bc2b0e

Browse files
authored
nes/supervision: Add weak attribute to early and late init (#393)
1 parent d7b4c70 commit 5bc2b0e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mos-platform/nes/crt0.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ asm(".section .init.50,\"ax\",@progbits\n"
1313
" txs\n"
1414
" jsr __early_init\n");
1515

16-
void __early_init(void) {
16+
__attribute__((weak)) void __early_init(void) {
1717
// Disable NMI generation.
1818
PPU.control = 0;
1919
// Disable rendering.
@@ -36,7 +36,7 @@ void __early_init(void) {
3636
asm(".section .init.250,\"ax\",@progbits\n"
3737
" jsr __late_init\n");
3838

39-
void __late_init(void) {
39+
__attribute__((weak)) void __late_init(void) {
4040
// Wait for cycle 57165 at the earliest. This is late enough for the PPU to be
4141
// fully functional and for the main program to begin.
4242
ppu_wait_vblank();

mos-platform/supervision/crt0.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ asm(".section .init.50,\"ax\",@progbits\n"
77
" txs\n"
88
" jsr __early_init\n");
99

10-
void __early_init(void) {
10+
__attribute__((weak)) void __early_init(void) {
1111
// Disable NMI, LCD, configure default bank.
1212
sv_sys_control_set(SV_SYS_BANK(0) |
1313
SV_SYS_NMI_DISABLE |

0 commit comments

Comments
 (0)