Skip to content

Commit d04a586

Browse files
authored
Merge pull request #905 from israpps/acram
add acram module with 128mb support
2 parents 77411d7 + 19cd757 commit d04a586

4 files changed

Lines changed: 39 additions & 2 deletions

File tree

iop/arcade/acram/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
# Licenced under Academic Free License version 2.0
77
# Review ps2sdk README & LICENSE files for further details.
88

9+
ACRAM_128MB ?= 0
10+
911
IOP_IMPORT_INCS += \
1012
arcade/accore \
1113
system/intrman \
@@ -21,6 +23,10 @@ IOP_OBJS = \
2123
imports.o \
2224
exports.o
2325

26+
ifeq ($(ACRAM_128MB),1)
27+
IOP_CFLAGS += -DALLOW_128MB_ACRAM
28+
endif
29+
2430
include $(PS2SDKSRC)/Defs.make
2531
include $(PS2SDKSRC)/iop/Rules.bin.make
2632
include $(PS2SDKSRC)/iop/Rules.make

iop/arcade/acram/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ There are multiple configurations of this library, allowing the choice of
1616
balancing between size, speed, and features.
1717

1818
* `acram` -> The recommended version.
19+
* `acram_extended` -> Supports up to 128mb of ACRAM, only on system246 Rack A
1920

2021
## How to use this module in your program
2122

iop/arcade/acram/src/ram.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,20 @@ static int ram_dma_xfer(acDmaT dma, int intr, acDmaOp op);
1414
static void ram_dma_done(acDmaT dma);
1515
static void ram_dma_error(acDmaT dma, int intr, acDmaState state, int result);
1616

17-
static acUint32 Ram_limits[] = {0x2000000, 0x4000000, 0x4000000};
17+
static acUint32 Ram_limits[] = {
18+
#ifdef ALLOW_128MB_ACRAM
19+
#define MAX_BANK 4
20+
0x2000000,
21+
0x4000000,
22+
0x6000000,
23+
0x8000000,
24+
#else
25+
#define MAX_BANK 3
26+
0x2000000,
27+
0x4000000,
28+
0x4000000
29+
#endif
30+
};
1831
static const acDmaOpsData ops_22 = {&ram_dma_xfer, &ram_dma_done, &ram_dma_error};
1932
static struct ram_softc Ramc;
2033

@@ -44,7 +57,7 @@ static int ram_dma_xfer(acDmaT dma, int intr, acDmaOp op)
4457
if ( dmatmp->addr < Ram_limits[v5] )
4558
break;
4659
v5 = ++i;
47-
if ( (unsigned int)i >= 3 )
60+
if ( (unsigned int)i > MAX_BANK )
4861
{
4962
bank = -14;
5063
break;

iop/arcade/acram_extended/Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# _____ ___ ____ ___ ____
2+
# ____| | ____| | | |____|
3+
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
4+
#-----------------------------------------------------------------------
5+
# Copyright 2001-2024, ps2dev - http://www.ps2dev.org
6+
# Licenced under Academic Free License version 2.0
7+
# Review ps2sdk README & LICENSE files for further details.
8+
9+
IOP_PARENT_DIR = $(PS2SDKSRC)/iop/arcade/acram
10+
IOP_SRC_DIR = $(IOP_PARENT_DIR)/src/
11+
IOP_INC_DIR = $(IOP_PARENT_DIR)/include/
12+
13+
ACRAM_128MB = 1
14+
15+
IOP_BIN ?= acram_extended.irx
16+
17+
include $(IOP_PARENT_DIR)/Makefile

0 commit comments

Comments
 (0)