PVSnesLib  4.6.0
Documentation to code in C or ASM for the Nintendo SNES
Loading...
Searching...
No Matches
console.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------------------
2
3 Generic console functions.
4
5 Copyright (C) 2012-2017
6 Alekmaul
7
8 This software is provided 'as-is', without any express or implied
9 warranty. In no event will the authors be held liable for any
10 damages arising from the use of this software.
11
12 Permission is granted to anyone to use this software for any
13 purpose, including commercial applications, and to alter it and
14 redistribute it freely, subject to the following restrictions:
15
16 1. The origin of this software must not be misrepresented; you
17 must not claim that you wrote the original software. If you use
18 this software in a product, an acknowledgment in the product
19 documentation would be appreciated but is not required.
20 2. Altered source versions must be plainly marked as such, and
21 must not be misrepresented as being the original software.
22 3. This notice may not be removed or altered from any source
23 distribution.
24
25
26---------------------------------------------------------------------------------*/
27
32#ifndef CONSOLE_H
33#define CONSOLE_H
34
35#include <snes/snestypes.h>
36
37#include <snes/background.h>
38#include <snes/dma.h>
39#include <snes/input.h>
40#include <snes/interrupt.h>
41#include <snes/sprite.h>
42#include <snes/sound.h>
43#include <snes/video.h>
44
45extern u16 snes_vblank_count;
46extern u8 snes_50hz;
47extern u8 snes_fps;
49#define RAND_MAX 65535
55void srand(u16 seed);
56
61u16 rand(void);
62
69void consoleInit(void);
70
74void consoleNocashMessage(char *fmt, ...);
75
79
84void consoleCopySram(u8 *source, u16 size);
85
90void consoleLoadSram(u8 *dest, u16 size);
91
97void consoleCopySramWithOffset(u8 *source, u16 size, u16 offset);
98
104void consoleLoadSramWithOffset(u8 *dest, u16 size, u16 offset);
105
113
114int sprintf(char *buf, const char *fmt, ...);
115
116#endif
snes background defines and functionality.
u16 rand(void)
return a randomized number
u8 snes_fps
50 if PAL console (50 Hz) or 60 if NTSC console (60Hz)
void consoleNocashMessage(char *fmt,...)
Send a message to the no$sns debug window.
void consoleCopySramWithOffset(u8 *source, u16 size, u16 offset)
Send data to SRAM with offset.
u16 snes_vblank_count
Number of VBL since consoleInit called (16 bits longs so reset each 18 minutes in NTSC)
void consoleInit(void)
Initialize console.
void srand(u16 seed)
initialize the seed for random numbers
void consoleLoadSram(u8 *dest, u16 size)
Load data from SRAM.
void consoleCopySram(u8 *source, u16 size)
Send data to SRAM.
u16 consoleRegionIsOK(void)
Check compatibility between console (NTSC/PAL) and cartridge (country)
void consoleLoadSramWithOffset(u8 *dest, u16 size, u16 offset)
Load data from SRAM with offset.
void consoleMesenBreakpoint(void)
Execute the special WDM opcode which Mesen can break on.
u8 snes_50hz
1 if on a PAL/50Hz SNES
Wrapper functions for direct memory access hardware.
input support.
snes interrupt support.
Custom types used by libsnes.
snes sound support.
snes sprites functionality.
contains the basic definitions for controlling the video hardware.