jakenastysnake
New member
Love the effect and think it gives some good depth to screens. Would anyone with some basic examples of how they pulled off the technique be willing to share? I would greatly appreciate the knowledge!
chronicleroflegends said:Parallax is really difficult effect to pull off on the NES, because you do not really have different 'layers' for your background tiles.
The only person I have seen make a similar effect/may be able to help is Kasumi. But it's likely going to involve some heavy custom scripting.
Mugi said:mapper 30 makes parallaxing slightly complicated since the mapper doesnt have scanline counter, which basically gives one easy option out.
you can use sprite0 to do a screensplit for a single parallaxing effect on screen but that also means that you will lose the ability to use the tile hud, as the parallax would reserve the sprite0 for it's own purpose (sprite0 is only usable once per frame)
i considered doing this since im not using the tile hud so my game currently doesnt use sprite0 for anything, but it's not really high on the priority list at the moment.
i will make a write up about that assuming i actually do it (would be neat for parallaxing a title screen logo or something simple like that.)
Header.asm change (accomplishes 1):Itemized changes (plain English)
1. Change mapper number to 4 from 30.
2. Change the name of the RESET label
3. Add a snippet before the vector includes called RESET that jmps to the new name of the old RESET
4. Add three bytes somewhere in RAM (nmisafeprg0, nmisafeprg1, and nmibanktoset)
5. Replace BankSwitch.asm with the 616 byte one below.
6. After the php left for context in the NMI, add the snippet from below.
7. Before the plp left for conext in the NMI, add the snippet from below.
8. Maybe initialize CHR banks too, I don't know if it's required. I only have an MMC3 CHR ROM cart.
.db "NES",$1a ;iNES identifier
.db $20 ;number of PRG-ROM blocks
;;32 prg rom blocks
.db $00 ;number of CHR-ROM blocks
;;0 chr rom blocks, using chr ram
.db %01000011
;; ||||
;MAP 3 2 1 0
.db %00000000 ;ROM control bytes: Horizontal mirroring, no SRAM or trainer, Mapper #0
;; ||||
; MAP - 7 6 5 4
.db $00,$00,$00,$00,$00,$00,$00,$00 ;filler
you could change RESET: in reset.ASM to RESETPOSTMAPPER: then add this directly below the include for the vectors in MainASM.asm:
;The below routine is 21 bytes.
;Vectors.ASM .orgs to $FFF0
.org $FFF0-21;So put this code 21 bytes before it
RESET:
sei;Disable IRQs
ldx #$00
stx $E000;Disable mapper IRQs
stx $A000;Set up mirroring
stx $2000; Disable NMI
stx $2001; Disable Rendering
stx $8000;Ensures $8000-$BFFF is swappable
JMP RESETPOSTMAPPER
NMI:
;first push whatever is in the accumulator to the stack
PHA
LDA doNMI
BEQ dontSkipNMI
JMP skipWholeNMI
dontSkipNMI:
LDA #$01
STA doNMI
TXA
PHA
TYA
PHA
PHP;This line and above are unchanged, here for context
lda nmibanktoset;Pushing nmibanktoset to the stack just to preserve it since we're still using
pha;the generic bank switch routines which change it
lda nmisafeprg0
pha
lda nmisafeprg1
pha
LDA temp;this line and below are unchanged, here for context
PHA ;STA NMItemp
LDA temp1
LDA #$00
STA doNMI;This line and above are unchanged, here for context
lda #7
sta $8000
pla
sta nmisafeprg1
sta $8001
lda #6
sta $8000
pla
sta nmisafeprg0
sta $8001
pla
sta nmibanktoset
sta $8000
PLP;This line and below are unchanged, here for context
PLA
TAY
PLA
TAX
skipWholeNMI:
PLA
RTI
There's a better way to do most of that, because NES Maker doesn't ever swap 8KB banks (it can't, and Indivisible does), but I leave it as an exercise to the reader if they really want the byte(s) of RAM
It's definitely possible to do 4, 5, 6, and 7 with fewer changes (because NES Maker will always swap two 8KB banks), but paradoxically I'd have to think harder about them. I know what Indivisible does works. 2 and 3 (and 8?) are lightly annoying, if only mappers initialized to a more known state they wouldn't be needed at all.
Edit: Hang on, reset is slightly wrong, I'll fix.Not super tested, but I'd anticipate problems would not be hard to fix