You are not logged in.
I`m Thinking this will fix Final Fantasy 2 and EB0 take a look
ntsc_pal_reset
;---NTSC/PAL
stmfd sp!,{globalptr,lr}
ldr globalptr,=GLOBAL_PTR_BASE
ldr r0,emuflags
tst r0,#PALTIMING
ldreq r1,=256*CYCLE ;NTSC (113+2/3)*3
ldrne r1,=240*CYCLE ;PAL (106+9/16)*3
str r1,cyclesperscanline1
ldreq r1,=85*CYCLE ;NTSC (113+2/3)*3
ldrne r1,=80*CYCLE ;PAL (106+9/16)*3
str r1,cyclesperscanline2
ldreq r1,=261 ;NTSC
ldrne r1,=311 ;PAL
Specifically this:
[b]
str r1,lastscanline
ldreq r1,cyclesperscanline1_modify_ntsc
ldrne r1,cyclesperscanline1_modify_pal
ldr r0,=cyclesperscanline1_modify
str r1,[r0]
ldreq r1,cyclesperscanline2_modify_ntsc
ldrne r1,cyclesperscanline2_modify_pal
ldr r0,=cyclesperscanline2_modify
str r1,[r0]
ldreq r1,scroll_threshhold_mod_ntsc
ldrne r1,scroll_threshhold_mod_pal
ldr r0,=scroll_threshhold_mod
str r1,[r0]
mov r0,#0
strb r0,PAL60
ldrb r0,mapper_number
cmp r0,#69
IMPORT mapper69_ntsc_pal_reset
bl mapper69_ntsc_pal_reset
ldmfd sp!,{globalptr,lr}
bx lr
cyclesperscanline1_modify_ntsc add cycles,cycles,#256*CYCLE
cyclesperscanline1_modify_pal add cycles,cycles,#240*CYCLE
cyclesperscanline2_modify_ntsc add cycles,cycles,#85*CYCLE
cyclesperscanline2_modify_pal add cycles,cycles,#80*CYCLE
scroll_threshhold_mod_ntsc cmp r1,#(251-3*3)*CYCLE
scroll_threshhold_mod_pal cmp r1,#227*CYCLE
[/b]
if you could elaborate what this fixes.
Offline
That code selects whether we're using NTSC or PAL timing. It has nothing to do with NTSC only games like FF2 and EB0.
"We are merely sprites that dance at the beck and call of our button pressing overlord."
Offline
Hmm must be the way you set up the dirty tile system and that new bg renderer than.
Iv'e used all your mappers along with half of 6502 in nesds but these games still dont work.
Kinda thought it was the threshhold mod ect. anyways just studying this project has taught me so much about coding without reading my C for dummies book LOL.
Thanks
Offline
"Scroll Threshold" has to do with vertical scrolling.
At a certain PPU pixel (#251), the Y scroll gets incremented. So if a game writes to Y scroll at certain times during the scanline, it will shake status bars up and down if the emulator doesn't get the timing right.
So the code there makes it so that a write beginning at 242 (should be 239), which would finish past 251, would not have the Y position increment after the write.
In PAL mode (European NES), the CPU is slower relative to the PPU, so it uses a different threshold.
"We are merely sprites that dance at the beck and call of our button pressing overlord."
Offline
Got it cool. One more question so what might i add to stop the bad graphic jumps in final fanatasy 2 then.
Offline
This is a problem i believe you fixed in your pocknes versions.
Offline
Are you talking about things related to scrolling? Vertical scrolling used to be broken for a while, since it did not follow the way the NES does it. Clash at Demonhead is a notable example (Pause the game and watch it flicker like crazy)
"We are merely sprites that dance at the beck and call of our button pressing overlord."
Offline
So which parts of vertical scrolling did you make the code for to follow properly could you lead me to the examples? that would be great.
Basically what i would add in Nesds i already got your mappers and the top half of the 6502 file compiling.
Last edited by morbid27 (2009-09-26 10:49:56 am)
Offline