sdk-world
v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Toggle main menu visibility
Loading...
Searching...
No Matches
dmaSpr.c
1
// ____ ___ | / _____ _____
2
// | __ | |___/ | |
3
// |___| ___| | \ __|__ | gsKit Open Source Project.
4
// ----------------------------------------------------------------------
5
// Copyright 2004 - Chris "Neovanglist" Gilbert <Neovanglist@LainOS.org>
6
// Licenced under Academic Free License version 2.0
7
// Review gsKit README & LICENSE files for further details.
8
//
9
// dmaSpr.c - Interface to scratchpad.
10
// Parts taken from emoon's BreakPoint Demo Library
11
//
12
13
#include "
dmaKit.h
"
14
#include "kernel.h"
15
#include "
dmaArrays.h
"
16
#include <stdio.h>
17
18
void
*
dmaKit_spr_begin
(
void
)
19
{
20
#ifdef GSKIT_DEBUG
21
printf(
"Begining Scratchpad Chain\n"
);
22
#endif
23
return
(
void
*)
dmaKit_spr_alloc
(100 * 16);
24
}
25
26
int
dmaKit_spr_end
(
void
*data,
void
*StorePtr)
27
{
28
int
q_size;
29
#ifdef GSKIT_DEBUG
30
printf(
"Ending Scratchpad Chain\n"
);
31
#endif
32
q_size = (u32)data - (u32)StorePtr;
33
return
q_size >> 4;
34
}
35
36
void
*
dmaKit_spr_alloc
(
int
size)
37
{
38
void
*p_spr = DMA_SPR;
39
#ifdef GSKIT_DEBUG
40
printf(
"Allocating Scratchpad Memory\n"
);
41
#endif
42
if
( (u32)DMA_SPR + size >= 0x70004000)
43
DMA_SPR = (
void
*)SPR_START;
44
45
p_spr = DMA_SPR;
46
DMA_SPR += size;
47
48
#ifdef GSKIT_DEBUG
49
printf(
"Scratchpad Memory Allocated\n"
);
50
#endif
51
return
p_spr;
52
}
53
dmaArrays.h
dmaKit.h
dmaKit_spr_end
int dmaKit_spr_end(void *data, void *StorePtr)
DMA Scratchpad Chain End.
Definition
dmaSpr.c:26
dmaKit_spr_begin
void * dmaKit_spr_begin(void)
DMA Scratchpad Chain Begin.
Definition
dmaSpr.c:18
dmaKit_spr_alloc
void * dmaKit_spr_alloc(int size)
DMA Scratchpad Allocation.
Definition
dmaSpr.c:36
dmakit
src
dmaSpr.c
Generated by
1.18.0