다마고치 연구소 한국어판 소스 공개
This commit is contained in:
commit
db23855630
661 files changed
+503597
No files matched your search
@@ -0,0 +1,106 @@
|
||||
/**
|
||||
* Doom Port to the nRF52840 by Nicola Wrachien (next-hack in the comments)
|
||||
*
|
||||
* This port is based on the excellent doomhack's GBA Doom Port,
|
||||
* with Kippykip additions.
|
||||
*
|
||||
* Several data structures and functions have been optimized
|
||||
* to fit in only 256kB RAM of nRF52840 (GBA has 384 kB RAM).
|
||||
* Z-Depth Light has been restored with almost no RAM consumption!
|
||||
* Tons of speed optimizations have been done, and the game now
|
||||
* runs extremely fast, despite the much higher 3D resolution with
|
||||
* respect to GBA.
|
||||
*
|
||||
* PrBoom: a Doom port merged with LxDoom and LSDLDoom
|
||||
* based on BOOM, a modified and improved DOOM engine
|
||||
* Copyright (C) 1999 by
|
||||
* id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman
|
||||
* Copyright (C) 1999-2000 by
|
||||
* Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze
|
||||
* Copyright 2005, 2006 by
|
||||
* Florian Schulze, Colin Phipps, Neil Stevens, Andrey Budko
|
||||
* Copyright (C) 2021 Nicola Wrachien (next-hack in the comments)
|
||||
* on nRF52840 port.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* Startup and quit functions. Handles signals, inits the
|
||||
* memory management, then calls D_DoomMain. Also contains
|
||||
* I_Init which does other system-related startup stuff.
|
||||
*
|
||||
* next-hack: put sound init and time functions
|
||||
*
|
||||
*-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "doomdef.h"
|
||||
#include "d_main.h"
|
||||
#include "m_fixed.h"
|
||||
#include "i_system.h"
|
||||
#include "i_video.h"
|
||||
#include "z_zone.h"
|
||||
#include "lprintf.h"
|
||||
#include "m_random.h"
|
||||
#include "doomstat.h"
|
||||
#include "g_game.h"
|
||||
#include "m_misc.h"
|
||||
#include "i_sound.h"
|
||||
#include "i_main.h"
|
||||
#include "lprintf.h"
|
||||
#include "global_data.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "nrf.h"
|
||||
unsigned int plat_micros(void);
|
||||
unsigned int I_GetTimeMicrosecs()
|
||||
{
|
||||
return plat_micros();
|
||||
}
|
||||
|
||||
unsigned int I_GetTime(void)
|
||||
{
|
||||
uint32_t time = I_GetTimeMicrosecs();
|
||||
if (!_g->basetime)
|
||||
{
|
||||
_g->basetime = time;
|
||||
return 0;
|
||||
}
|
||||
uint32_t diff = time - _g->basetime;
|
||||
#define SPEED10X 0
|
||||
#if SPEED10X
|
||||
#warning speed10x
|
||||
diff = diff / (100000 / TICRATE);
|
||||
|
||||
#else
|
||||
diff = diff / (1000000 / TICRATE);
|
||||
#endif
|
||||
return diff;
|
||||
}
|
||||
|
||||
void I_Init(void)
|
||||
{
|
||||
if (!(nomusicparm && nosfxparm))
|
||||
I_InitSound();
|
||||
}
|
||||
Reference in new issue
Block a user