mirror of
https://github.com/rvtr/ctr_firmware.git
synced 2025-10-31 07:51:08 -04:00
alarmデモ追加。
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_firmware@171 b871894f-2f95-9b40-918c-086798483c85
This commit is contained in:
parent
60d22bb588
commit
e86d91a0be
@ -24,6 +24,7 @@ SUBDIRS = \
|
|||||||
jtag-only \
|
jtag-only \
|
||||||
vfp \
|
vfp \
|
||||||
thread \
|
thread \
|
||||||
|
alarm \
|
||||||
teg-dev \
|
teg-dev \
|
||||||
ctr_bootrom \
|
ctr_bootrom \
|
||||||
|
|
||||||
|
|||||||
48
trunk/bootrom/build/bootrom/alarm/ARM11/Makefile
Normal file
48
trunk/bootrom/build/bootrom/alarm/ARM11/Makefile
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
#! make -f
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
# Project: CtrBrom - bootrom - alarm
|
||||||
|
# File: Makefile
|
||||||
|
#
|
||||||
|
# Copyright 2008 Nintendo. All rights reserved.
|
||||||
|
#
|
||||||
|
# These coded instructions, statements, and computer programs contain
|
||||||
|
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||||
|
# Company Ltd., and are protected by Federal copyright law. They may
|
||||||
|
# not be disclosed to third parties or copied or duplicated in any form,
|
||||||
|
# in whole or in part, without the prior written consent of Nintendo.
|
||||||
|
#
|
||||||
|
# $Date:: $
|
||||||
|
# $Rev$
|
||||||
|
# $Author$
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
#BROM_DEF_LINK_SCATLD = TRUE
|
||||||
|
|
||||||
|
SUBDIRS =
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
TARGET_BIN = alarm11.padbin
|
||||||
|
|
||||||
|
SRCS = \
|
||||||
|
main.c \
|
||||||
|
|
||||||
|
#SRCDIR = # using default
|
||||||
|
#LCFILE = # using default
|
||||||
|
|
||||||
|
include $(CTRBROM_ROOT)/build/buildtools/commondefs
|
||||||
|
|
||||||
|
INSTALL_DIR = ..
|
||||||
|
INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN_BASENAME).axf
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
do-build: $(TARGETS)
|
||||||
|
|
||||||
|
|
||||||
|
include $(CTRBROM_ROOT)/build/buildtools/modulerules
|
||||||
|
|
||||||
|
|
||||||
|
#===== End of Makefile =====
|
||||||
57
trunk/bootrom/build/bootrom/alarm/ARM11/main.c
Normal file
57
trunk/bootrom/build/bootrom/alarm/ARM11/main.c
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
Project: TwlBrom - alarm
|
||||||
|
File: main.c
|
||||||
|
|
||||||
|
Copyright 2008 Nintendo. All rights reserved.
|
||||||
|
|
||||||
|
These coded instructions, statements, and computer programs contain
|
||||||
|
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||||
|
Company Ltd., and are protected by Federal copyright law. They may
|
||||||
|
not be disclosed to third parties or copied or duplicated in any form,
|
||||||
|
in whole or in part, without the prior written consent of Nintendo.
|
||||||
|
|
||||||
|
$Date:: $
|
||||||
|
$Rev$
|
||||||
|
$Author$
|
||||||
|
*---------------------------------------------------------------------------*/
|
||||||
|
#include <brom.h>
|
||||||
|
|
||||||
|
static void handler(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void BromMain( void )
|
||||||
|
{
|
||||||
|
osInitException();
|
||||||
|
osInitBROM();
|
||||||
|
|
||||||
|
osPrintf( "ARM11: start\n" );
|
||||||
|
|
||||||
|
//---- Init Alarm
|
||||||
|
osInitAlarm();
|
||||||
|
{
|
||||||
|
static OSAlarm alarm;
|
||||||
|
OSTick interval = OS_MSEC_TO_TICK(1000);
|
||||||
|
osCreateAlarm( &alarm );
|
||||||
|
osSetPeriodicAlarm(&alarm, osGetTick()+interval, interval, (OSAlarmHandler)handler, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
OSTick tick = osGetTick();
|
||||||
|
u32 mon[OS_MONITOR_NUM];
|
||||||
|
mon[0] = osGetPerfMonitor( OS_MONITOR_0 );
|
||||||
|
mon[1] = osGetPerfMonitor( OS_MONITOR_1 );
|
||||||
|
mon[2] = osGetPerfMonitor( OS_MONITOR_2 );
|
||||||
|
osWaitInterruptID( TRUE, OSi_ALARM_IE_TIMER_ID );
|
||||||
|
mon[0] = osGetPerfMonitor( OS_MONITOR_0 ) - mon[0];
|
||||||
|
mon[1] = osGetPerfMonitor( OS_MONITOR_1 ) - mon[1];
|
||||||
|
mon[2] = osGetPerfMonitor( OS_MONITOR_2 ) - mon[2];
|
||||||
|
tick = osGetTick() - tick;
|
||||||
|
osTPrintf( "wait mon0 = %llu msec\n", OS_TICK_TO_MSEC(mon[0]) ); // MG20ではパフォーマンスモニタのクロックが違う
|
||||||
|
osTPrintf( "wait mon1 = %llu msec\n", OS_TICK_TO_MSEC(mon[1]) );
|
||||||
|
osTPrintf( "wait mon2 = %llu msec\n", OS_TICK_TO_MSEC(mon[2]) );
|
||||||
|
osTPrintf( "wait tick = %llu msec\n", OS_TICK_TO_MSEC(tick) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
50
trunk/bootrom/build/bootrom/alarm/ARM9/Makefile
Normal file
50
trunk/bootrom/build/bootrom/alarm/ARM9/Makefile
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
#! make -f
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
# Project: CtrBrom - bootrom - alarm
|
||||||
|
# File: Makefile
|
||||||
|
#
|
||||||
|
# Copyright 2008 Nintendo. All rights reserved.
|
||||||
|
#
|
||||||
|
# These coded instructions, statements, and computer programs contain
|
||||||
|
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||||
|
# Company Ltd., and are protected by Federal copyright law. They may
|
||||||
|
# not be disclosed to third parties or copied or duplicated in any form,
|
||||||
|
# in whole or in part, without the prior written consent of Nintendo.
|
||||||
|
#
|
||||||
|
# $Date:: $
|
||||||
|
# $Rev$
|
||||||
|
# $Author$
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
#BROM_DEF_LINK_SCATLD = TRUE
|
||||||
|
|
||||||
|
BROM_PROC = ARM9
|
||||||
|
|
||||||
|
SUBDIRS =
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
TARGET_BIN = alarm9.padbin
|
||||||
|
|
||||||
|
SRCS = \
|
||||||
|
main.c \
|
||||||
|
|
||||||
|
#SRCDIR = # using default
|
||||||
|
#LCFILE = # using default
|
||||||
|
|
||||||
|
include $(CTRBROM_ROOT)/build/buildtools/commondefs
|
||||||
|
|
||||||
|
INSTALL_DIR = ..
|
||||||
|
INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN_BASENAME).axf
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
do-build: $(TARGETS)
|
||||||
|
|
||||||
|
|
||||||
|
include $(CTRBROM_ROOT)/build/buildtools/modulerules
|
||||||
|
|
||||||
|
|
||||||
|
#===== End of Makefile =====
|
||||||
47
trunk/bootrom/build/bootrom/alarm/ARM9/main.c
Normal file
47
trunk/bootrom/build/bootrom/alarm/ARM9/main.c
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
Project: TwlBrom - alarm
|
||||||
|
File: main.c
|
||||||
|
|
||||||
|
Copyright 2008 Nintendo. All rights reserved.
|
||||||
|
|
||||||
|
These coded instructions, statements, and computer programs contain
|
||||||
|
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||||
|
Company Ltd., and are protected by Federal copyright law. They may
|
||||||
|
not be disclosed to third parties or copied or duplicated in any form,
|
||||||
|
in whole or in part, without the prior written consent of Nintendo.
|
||||||
|
|
||||||
|
$Date:: $
|
||||||
|
$Rev$
|
||||||
|
$Author$
|
||||||
|
*---------------------------------------------------------------------------*/
|
||||||
|
#include <brom.h>
|
||||||
|
|
||||||
|
static void handler(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void BromSpMain( void )
|
||||||
|
{
|
||||||
|
osInitException();
|
||||||
|
osInitBROM();
|
||||||
|
|
||||||
|
osPrintf( "ARM9: start\n" );
|
||||||
|
|
||||||
|
//---- Init Alarm
|
||||||
|
osInitAlarm();
|
||||||
|
{
|
||||||
|
static OSAlarm alarm;
|
||||||
|
OSTick interval = OS_MSEC_TO_TICK(1000);
|
||||||
|
osCreateAlarm( &alarm );
|
||||||
|
osSetPeriodicAlarm(&alarm, osGetTick()+interval, interval, (OSAlarmHandler)handler, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
OSTick tick = osGetTick();
|
||||||
|
osWaitInterruptID( TRUE, OSi_ALARM_IE_TIMER_ID );
|
||||||
|
tick = osGetTick() - tick;
|
||||||
|
osTPrintf( "wait tick = %llu msec\n", OS_TICK_TO_MSEC(tick) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
34
trunk/bootrom/build/bootrom/alarm/Makefile
Normal file
34
trunk/bootrom/build/bootrom/alarm/Makefile
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
#! make -f
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
# Project: CtrBrom - build
|
||||||
|
# File: Makefile
|
||||||
|
#
|
||||||
|
# Copyright 2008 Nintendo. All rights reserved.
|
||||||
|
#
|
||||||
|
# These coded instructions, statements, and computer programs contain
|
||||||
|
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||||
|
# Company Ltd., and are protected by Federal copyright law. They may
|
||||||
|
# not be disclosed to third parties or copied or duplicated in any form,
|
||||||
|
# in whole or in part, without the prior written consent of Nintendo.
|
||||||
|
#
|
||||||
|
# $Date:: $
|
||||||
|
# $Rev$
|
||||||
|
# $Author$
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
include $(CTRBROM_ROOT)/build/buildtools/commondefs
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
SUBDIRS = \
|
||||||
|
ARM11 \
|
||||||
|
ARM9 \
|
||||||
|
rom \
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
include $(CTRBROM_ROOT)/build/buildtools/modulerules
|
||||||
|
|
||||||
|
|
||||||
|
#===== End of Makefile =====
|
||||||
62
trunk/bootrom/build/bootrom/alarm/rom/Makefile
Normal file
62
trunk/bootrom/build/bootrom/alarm/rom/Makefile
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
#! make -f
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
# Project: CtrBrom - bootrom - alarm
|
||||||
|
# File: Makefile
|
||||||
|
#
|
||||||
|
# Copyright 2008 Nintendo. All rights reserved.
|
||||||
|
#
|
||||||
|
# These coded instructions, statements, and computer programs contain
|
||||||
|
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||||
|
# Company Ltd., and are protected by Federal copyright law. They may
|
||||||
|
# not be disclosed to third parties or copied or duplicated in any form,
|
||||||
|
# in whole or in part, without the prior written consent of Nintendo.
|
||||||
|
#
|
||||||
|
# $Date:: $
|
||||||
|
# $Rev$
|
||||||
|
# $Author$
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
BROM_PROMGEN = TRUE
|
||||||
|
|
||||||
|
SUBDIRS =
|
||||||
|
|
||||||
|
LINCLUDES = ../include
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
TARGET_BIN = twl_bootrom.exo
|
||||||
|
|
||||||
|
CRT0_O =
|
||||||
|
|
||||||
|
SRCS = \
|
||||||
|
crt0.c \
|
||||||
|
|
||||||
|
#SRCDIR = # using default
|
||||||
|
#LCFILE = # using default
|
||||||
|
|
||||||
|
BROM_PADBIN_ARM11 = ../ARM11/bin/$(BROM_BUILDTYPE_ARM11)/alarm11.padbin
|
||||||
|
BROM_PADBIN_ARM9 = ../ARM9/bin/$(BROM_BUILDTYPE_ARM9)/alarm9.padbin
|
||||||
|
BROM_DEPENDS = $(BROM_PADBIN_ARM11) $(BROM_PADBIN_ARM9)
|
||||||
|
|
||||||
|
MACRO_FLAGS += -DBROM_PADBIN_ARM11=$(BROM_PADBIN_ARM11) \
|
||||||
|
-DBROM_PADBIN_ARM9=$(BROM_PADBIN_ARM9) \
|
||||||
|
|
||||||
|
|
||||||
|
include $(CTRBROM_ROOT)/build/buildtools/commondefs
|
||||||
|
|
||||||
|
INSTALL_TARGETS = $(TARGETS)
|
||||||
|
INSTALL_DIR = $(BROM_INSTALL_PROMDIR)
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
do-build: $(TARGETS)
|
||||||
|
|
||||||
|
|
||||||
|
include $(CTRBROM_ROOT)/build/buildtools/modulerules
|
||||||
|
|
||||||
|
|
||||||
|
crt0.c : $(BROM_DEPENDS)
|
||||||
|
touch crt0.c
|
||||||
|
|
||||||
|
|
||||||
|
#===== End of Makefile =====
|
||||||
41
trunk/bootrom/build/bootrom/alarm/rom/crt0.c
Normal file
41
trunk/bootrom/build/bootrom/alarm/rom/crt0.c
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
Project: CtrBrom - bootrom - init
|
||||||
|
File: crt0.c
|
||||||
|
|
||||||
|
Copyright 2008 Nintendo. All rights reserved.
|
||||||
|
|
||||||
|
These coded instructions, statements, and computer programs contain
|
||||||
|
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||||
|
Company Ltd., and are protected by Federal copyright law. They may
|
||||||
|
not be disclosed to third parties or copied or duplicated in any form,
|
||||||
|
in whole or in part, without the prior written consent of Nintendo.
|
||||||
|
|
||||||
|
$Date:: $
|
||||||
|
$Rev$
|
||||||
|
$Author$
|
||||||
|
*---------------------------------------------------------------------------*/
|
||||||
|
#include <brom/code32.h>
|
||||||
|
#include <brom/types.h>
|
||||||
|
#include <brom/hw/common/mmap_prom.h>
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
Name: _start
|
||||||
|
|
||||||
|
Description: Start up
|
||||||
|
|
||||||
|
Arguments: None
|
||||||
|
|
||||||
|
Returns: None.
|
||||||
|
*---------------------------------------------------------------------------*/
|
||||||
|
asm void _start( void )
|
||||||
|
{
|
||||||
|
PRESERVE8
|
||||||
|
|
||||||
|
EXPORT CTR_BROM_ARM11
|
||||||
|
EXPORT CTR_BROM_ARM9
|
||||||
|
|
||||||
|
CTR_BROM_ARM11
|
||||||
|
INCBIN BROM_PADBIN_ARM11
|
||||||
|
CTR_BROM_ARM9
|
||||||
|
INCBIN BROM_PADBIN_ARM9
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user