Skip to content

Commit

Permalink
Add more changes by @nibbles27
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketRobz committed Oct 12, 2023
1 parent 4c3605b commit 634baae
Show file tree
Hide file tree
Showing 11 changed files with 226 additions and 148 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export LIBFAT := $(DEVKITARM)/libfat
export LIBFILESYSTEM := $(DEVKITARM)/libfilesystem

export GAME_TITLE := nesDS
export GAME_SUBTITLE1 := Version 1.3c+
export GAME_SUBTITLE1 := Version 1.3d+
export GAME_SUBTITLE2 := Enjoy yourself!
export GAME_ICON := $(CURDIR)/icon.bmp
export TARGET := nesDS
Expand Down
17 changes: 15 additions & 2 deletions README.TXT
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
nesDS1.3c [NTR], using toolchain devkitARM r43 (/release folder NesDS.nds binary was compiled with it).
master branch is the one and only branch that uses fully libnds sources. (for TGDS support I won't add support as of now, too busy right now)
nesDS1.3d+ [NTR], using toolchain devkitARM latest.

We spent a few weeks to port the original nesDS project to the GCC toolchain. Then we made a new EX Edition, and made it possible to emulate the the NES/FC games that the origianl nesDS didn't work well.
Since the 0.40 version, I ported the code of EX Edtion to the original nesDS, now it is the best nes-emulator~!

If you found any bug on nesDS, just tell me. Maybe I could fix it.

09-30-2023
nibbles27:

- Also updated to include map 159 for DBZ 2 and 3 translations, please set from 16 to 159 for these two titles with iNES Header Editor - https://www.romhacking.net/utilities/1352/

09-15-2023
nibbles27:
- Restored Debug menu so as to not break Mapper 4 games to a crash (like Dragon Warrior 1)
- Restored bad Punch Out hack from PNES-9.98

08-01-2023
nibbles27:
- Added Screen selection presets, 14 different Palettes, and Restored Gamma selection (5 levels)

08-14-2018
coto:
- nifi, sound, touchscreen works in NTR mode as of devkitARM r43.
Expand Down
2 changes: 1 addition & 1 deletion arm9/source/arm9main.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void do_romebd()
void showversion()
{
memset((void *)(SUB_BG),0,64*3);
consoletext(64*2-32," nesDS 1.3c ________________________________",0);
consoletext(64*2-32," nesDS 1.3d+________________________________",0);
}

/*****************************
Expand Down
8 changes: 7 additions & 1 deletion arm9/source/cart.s
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ mappertbl:
.word 33,mapper33init
.word 34,mapper34init
.word 40,mapper40init
.word 42,mapper42init
.word 64,mapper64init
.word 65,mapper65init
.word 66,mapper66init
Expand Down Expand Up @@ -74,10 +75,14 @@ mappertbl:
.word 99,mapper99init
.word 105,mapper105init
.word 118,mapper118init
.word 119,mapper4init
.word 119,mapper119init
.word 140,mapper66init
.word 151,mapper151init
.word 152,mapper152init
.word 153,mapper16init
.word 157,mapper16init
.word 158,mapper64init
.word 159,mapper159init
.word 163,mapper163init
.word 180,mapper180init
.word 184,mapper184init
Expand All @@ -95,6 +100,7 @@ mappertbl:
.word 240,mapper240init
.word 245,mapper245init
.word 246,mapper246init
.word 249,mapper249init
.word 252,mapper252init
.word 253,mapper253init
.word 255,mapper255init
Expand Down
67 changes: 67 additions & 0 deletions arm9/source/mappers/map159.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
@---------------------------------------------------------------------------------
.section .text,"ax"
@---------------------------------------------------------------------------------
#include "equates.h"
#include "6502mac.h"
@---------------------------------------------------------------------------------
.global mapper159init

counter = mapperdata+0
latch = mapperdata+4
enable = mapperdata+8
@----------------------------------------------------------------------------
mapper159init:@ Bandai
@----------------------------------------------------------------------------
.word write0,write0,write0,write0

ldrb_ r1,cartflags @get cartflags
bic r1,r1,#SRAM @don't use SRAM on this mapper
strb_ r1,cartflags @set cartflags
ldr r1,mapper159init
str_ r1,writemem_tbl+12

ldr r0,=hook
str_ r0,scanlinehook

mov pc,lr
@-------------------------------------------------------
write0:
@-------------------------------------------------------
and addy,addy,#0x0f
tst addy,#0x08
ldreq r1,=writeCHRTBL
adrne r1,tbl-8*4
ldr pc,[r1,addy,lsl#2]
wA: @---------------------------
and r0,r0,#1
strb_ r0,enable
ldr_ r0,latch
str_ r0,counter
mov pc,lr
wB: @---------------------------
strb_ r0,latch
asdf: mov r1,#0
strb_ r1,latch+2
strb_ r1,latch+3
mov pc,lr
wC: @---------------------------
strb_ r0,latch+1
b asdf

tbl: .word map89AB_,mirrorKonami_,wA,wB,wC,void,void,void
@-------------------------------------------------------
hook:
@------------------------------------------------------
ldrb_ r0,enable
cmp r0,#0
beq h1

ldr_ r0,counter
subs r0,r0,#113
str_ r0,counter
@ bcc irq6502
bcc CheckI
h1:
fetch 0
@-------------------------------------------------------
@.end
5 changes: 4 additions & 1 deletion arm9/source/mappers/map4.s
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
#define MMC3_IRQ_ROCKMAN3 5
@---------------------------------------------------------------------------------
.global mapper4init

.global mapper119init
.global mapper249init
reg0 = mapperdata
reg1 = mapperdata+1
reg2 = mapperdata+2
Expand Down Expand Up @@ -44,6 +45,8 @@

@---------------------------------------------------------------------------------
mapper4init:
mapper119init:
mapper249init:
@---------------------------------------------------------------------------------
.word write0, write1, write2, write3
stmfd sp!, {lr}
Expand Down
59 changes: 59 additions & 0 deletions arm9/source/mappers/map42.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
@---------------------------------------------------------------------------------
.section .text,"ax"
@---------------------------------------------------------------------------------
#include "equates.h"
#include "6502mac.h"

.global mapper42init

countdown = mapperdata+0
rombank = mapperdata+1

@----------------------------------------------------------------------------
mapper42init:
@----------------------------------------------------------------------------
.word chr01234567_,void,void,write3
mov addy,lr

ldr r1,=rom_R60 @Swap in ROM at $6000-$7FFF.
str_ r1,readmem_tbl+12
ldr r1,=empty_W @ROM.
str_ r1,writemem_tbl+12

mov r0,#-1
bl map89ABCDEF_

@ ldr r0,=MMC3_IRQ_Hook
@ str r0,scanlinehook

mov r0,#0
bl map67_IRQ_Hook

mov pc,addy

@----------------------------------------------------------------------------
write0: @$8000-8001
@----------------------------------------------------------------------------
@ tst addy,#3
@ movne pc,lr
b chr01234567_
@----------------------------------------------------------------------------
write3: @E000-E003
@----------------------------------------------------------------------------
and r1,addy,#3
ldr pc,[pc,r1,lsl#2]
nothing:
mov pc,lr
@----------------------------------------------------------------------------
commandlist: .word map67_,cmd1,nothing,nothing
cmd0:
@ strb r1,rombank
@ and r0,r0,#0xF
b map67_IRQ_Hook
cmd1:
tst r0,#0x08
beq mirror2H_
b mirror2V_
cmd2:
cmd3:
@.end
1 change: 1 addition & 0 deletions arm9/source/mappers/map67.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "6502mac.h"
@---------------------------------------------------------------------------------
.global mapper67init
.global map67_IRQ_Hook
countdown = mapperdata+0
irqen = mapperdata+4
suntoggle = mapperdata+5
Expand Down
Loading

0 comments on commit 634baae

Please sign in to comment.