Paganitzu NES

A place where you can keep others updated about your NES-related projects through screenshots, videos or information in general.

Moderator: Moderators

Post Reply
User avatar
Kiro
Posts: 7
Joined: Tue Apr 30, 2019 3:01 am

Paganitzu NES

Post by Kiro »

Here's something I've been working on for quite a while now. I've been (slowly) porting Paganitzu Part 1 to the NES. One of my favourite games from childhood, I don't know why but a spent a lot of time playing this when I was a kid.

It's currently using an NROM map and I've fit about as much as I can into it. There are 8 fully playable levels and they are all completable. I could probably refactor a bit more of my code and fit maybe 2 more levels into it but I think I might just bite the bullet here and move it to a UNROM since i just need more ROM and the ability to swap out CHR for more tiles.

I plan to finish porting of the levels so it will be everything from the shareware part 1 of the game along with the title and intro screens etc.

UPDATE: I've sorted out 99% of the NTSC rendering issues and converted it to UOROM and also added an extra room (Room 9). There's couple of little bugs still to iron out in Room 9, the water animations are still pretty heavy even after a few refactors so I need to re-visit that again until I'm happy with it.
I also updated the vblank routines to do DMA as close to the start as I can without breaking existing player movement and animations. I have also tested it on my hardware now with an Everdrive and while it works there is a weird hard crash bug that happens sometimes in different places I need to track down, but in an emulator it seems to work fine. Anyway, more to be done as I re-organise the animation code and add the extra levels.

New download attached below.
paganitzu_250720240531_000.png
paganitzu_250720240531_000.png (5.56 KiB) Viewed 1989 times
paganitzu_250720240531_001.png
paganitzu_250720240531_001.png (10.86 KiB) Viewed 1989 times
paganitzu_beta_03.zip
(24.17 KiB) Downloaded 29 times
Last edited by Kiro on Mon Jul 08, 2024 3:24 pm, edited 2 times in total.
User avatar
Quietust
Posts: 1935
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Re: Paganitzu NES

Post by Quietust »

Very neat - I remember playing this game as well, and I've still got the floppy disks for it (all 3 episodes) as well as installed copies in DosBox.

Your version seems to play a bit more slowly than the original - the timer seems to be in seconds (whereas in the original it was faster, kind of like in Super Mario Bros), and player movement is also noticeably slower (but smoother).

Also, is there a particular reason why you went with PAL? Did NTSC not give you enough VRAM bandwidth for updating the status bar and such?
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.
Pokun
Posts: 2807
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Paganitzu NES

Post by Pokun »

It's fun! The Sokoban-style puzzles reminds me a lot of the Eggerland/Lolo games which I played a lot as a kid.
User avatar
Kiro
Posts: 7
Joined: Tue Apr 30, 2019 3:01 am

Re: Paganitzu NES

Post by Kiro »

Quietust wrote: Fri May 31, 2024 8:17 am Your version seems to play a bit more slowly than the original - the timer seems to be in seconds (whereas in the original it was faster, kind of like in Super Mario Bros), and player movement is also noticeably slower (but smoother).

Also, is there a particular reason why you went with PAL? Did NTSC not give you enough VRAM bandwidth for updating the status bar and such?
Thanks for the feedback, i'll see what I can do to tighten up the timing a bit and do some more comparisons to the DOS version.

As for PAL, i'm from a PAL region, my console is PAL, all the things are PAL etc. Interesting you mentioned the NTSC vblank timing though, I did have to refactor a bunch of stuff at one point because i was just using too much vblank (learning) and less time would have made it even harder back then.
User avatar
Quietust
Posts: 1935
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Re: Paganitzu NES

Post by Quietust »

Kiro wrote: Fri May 31, 2024 2:21 pm Interesting you mentioned the NTSC vblank timing though, I did have to refactor a bunch of stuff at one point because i was just using too much vblank (learning) and less time would have made it even harder back then.
I actually tried running the ROM in NTSC mode, but it glitches very badly - the levels have corrupted attributes, and the "level complete" animation is completely broken.

Looking closer, your "level end" sequence is zeroing out $0200-$02FF before performing Sprite DMA, and I'm pretty sure that will fail on a real PAL system - writing to sprite memory is only possible during the first 20 scanlines of VBLANK, since the PAL PPU starts refreshing the memory early (which blocks writes) in order to prevent it from decaying before the frame starts. In general, your NMI routine should perform Sprite DMA and any VRAM writes before anything else, because VBLANK time is precious and you can't afford to waste any of it.
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.
User avatar
Kiro
Posts: 7
Joined: Tue Apr 30, 2019 3:01 am

Re: Paganitzu NES

Post by Kiro »

Quietust wrote: Fri May 31, 2024 6:08 pm I actually tried running the ROM in NTSC mode, but it glitches very badly - the levels have corrupted attributes, and the "level complete" animation is completely broken.
You're right it's a mess, i'll add that to my list and get a working NTSC version at some point.
Quietust wrote: Fri May 31, 2024 6:08 pm Looking closer, your "level end" sequence is zeroing out $0200-$02FF before performing Sprite DMA, and I'm pretty sure that will fail on a real PAL system - writing to sprite memory is only possible during the first 20 scanlines of VBLANK, since the PAL PPU starts refreshing the memory early (which blocks writes) in order to prevent it from decaying before the frame starts.
Thanks for the tip, i'll make sure i take that into account when I redo the NMI routine. I haven't been able to test it on my hardware yet as I'm still waiting for my Everdrive to arrive, once that gets here I'm sure i'll find lots of bugs to fix :)
Pokun
Posts: 2807
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Paganitzu NES

Post by Pokun »

Once you sort out the rendering problems it will most likely work on both PAL and NTSC without any extra effort, it's not like the game requires the extra PAL vblank time or anything. Only things like movement speed may change as it will run a bit faster on NTSC. Many PAL games runs too slow because of lazy or non-existent PAL porting.
User avatar
Kiro
Posts: 7
Joined: Tue Apr 30, 2019 3:01 am

Re: Paganitzu NES

Post by Kiro »

UPDATE: See above for details, but I've sorted out 99% of the NTSC rendering issues now.
Pokun
Posts: 2807
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Paganitzu NES

Post by Pokun »

It seems to work fine in NTSC now on Mesen. But it defaults to Dendy because you set byte 12 in the NES 2.0 header to $03 (if you really meant PAL it should be $01). You also set a few invalid values in the header like the battery flag which is set despite non-volatile RAM is 0, volatile RAM is 256 byte (which is a very odd value considering you are using mapper 02) and byte 11 in the header is set to $FF which are reserved values that can't be used, so I guess those are just errors. The NES 2.0 header is explained in the wiki.
User avatar
Quietust
Posts: 1935
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Re: Paganitzu NES

Post by Quietust »

Pokun wrote: Thu Jul 11, 2024 1:55 pm It seems to work fine in NTSC now on Mesen. But it defaults to Dendy because you set byte 12 in the NES 2.0 header to $03 (if you really meant PAL it should be $01). You also set a few invalid values in the header like the battery flag which is set despite non-volatile RAM is 0, volatile RAM is 256 byte (which is a very odd value considering you are using mapper 02) and byte 11 in the header is set to $FF which are reserved values that can't be used, so I guess those are just errors. The NES 2.0 header is explained in the wiki.
Given that the game doesn't appear to access $6000-$7FFF at all, I would assume those are indeed errors.

NTSC is working much better, but I still noticed a few instances where the screen briefly displayed something other than the playfield. I also noticed a few minor graphical glitches/errors:
  • When you trap a spider between 2 boulders, the resulting gems don't sparkle.
  • When you push a boulder into water, one corner sometimes reappears (in brown)
  • Once you finish level 9, it shows the Game Over screen with a few glitchy green boxes near the bottom
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.
User avatar
Kiro
Posts: 7
Joined: Tue Apr 30, 2019 3:01 am

Re: Paganitzu NES

Post by Kiro »

Yeah the header needs fixing, I'll get to that soon.
Quietust wrote: Thu Jul 11, 2024 2:35 pm
  • When you trap a spider between 2 boulders, the resulting gems don't sparkle.
  • When you push a boulder into water, one corner sometimes reappears (in brown)
  • Once you finish level 9, it shows the Game Over screen with a few glitchy green boxes near the bottom
- Yes, the gems don't sparkle when you trap a spider, i just haven't implemented that yet.
- I have also seen the water glitch where the next tile is replaced even after the water is removed, this is just a timing issue with my animation routine being in progress when the water is removed, should be easy to fix.
- The game over screen is a new one, i'll add that to the list.
Post Reply