Points of Required Attention™
Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,494,020
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 04-27-24 09:17 PM
Guest: Register | Login

Main - Posts by never-obsolete

Pages: 1 2 3 4 5

never-obsolete
Posted on 02-17-10 11:36 PM, in 6502 ASM Questions... [Please?] (rev. 3 of 02-17-10 11:41 PM) Link | Quote | ID: 127224


Rat
Level: 24

Posts: 62/96
EXP: 74504
Next: 3621

Since: 02-22-07
From: Phoenix, AZ

Last post: 2597 days
Last view: 2597 days
You need to put a branch and destination. A JMP is needed if you don't want the second function called.


LDX $DCD0
CPX #$10
BCC _isLess
_isMore: JSR $3F0C
JMP _exit
_isLess: JSR $3FBD
_exit:



Here's an explanation on how the compares work. There's a table in the middle that shows which branch to use for each equality test.

never-obsolete
Posted on 03-22-10 08:47 PM, in LoZ (nes) stuff (rev. 2 of 03-22-10 08:48 PM) Link | Quote | ID: 128675


Rat
Level: 24

Posts: 63/96
EXP: 74504
Next: 3621

Since: 02-22-07
From: Phoenix, AZ

Last post: 2597 days
Last view: 2597 days


I definitely know a thing or two about implementing menus screens, they're tough to put in/extensively modify without screwing the game up (especially when returning to the normal game), so it's really nice you've pretty much avoided that.



Because of all the headaches, I ended up hacking in a completely new inventory screen. It used all original code (even joypad reading), and polled $2002 for timing rather than use the NMI. To get the "Save Retry Exit" screen to work, I had to copy a stream of data to the stack, trash the old stack pointer, and then jump to the code. It was ugly, but it worked...

never-obsolete
Posted on 06-02-10 08:38 PM, in CHR-RAM Trouble (rev. 2 of 06-02-10 08:39 PM) Link | Quote | ID: 131627


Rat
Level: 24

Posts: 64/96
EXP: 74504
Next: 3621

Since: 02-22-07
From: Phoenix, AZ

Last post: 2597 days
Last view: 2597 days
All of vram is written to the same way. Setting PPU_ADDR ($2006) to $0000 will point to tile #$00 of pattern table #0, $1000 will point to tile #$00 of pattern table #1.

never-obsolete
Posted on 06-03-10 07:18 PM, in CHR-RAM Trouble Link | Quote | ID: 131674


Rat
Level: 24

Posts: 65/96
EXP: 74504
Next: 3621

Since: 02-22-07
From: Phoenix, AZ

Last post: 2597 days
Last view: 2597 days
Tiles are 16 bytes, so tile #$48 would be either $0480 or $1480 depending on which pattern table you want to write to.

Once you set PPU_ADDR ($2006) you have to write to PPU_DATA ($2007) 16 times to write a full tile. This has to been done during vblank (or while rendering is disabled) or else you'll have some graphical glitches.

never-obsolete
Posted on 06-05-10 02:15 AM, in CHR-RAM Trouble (rev. 2 of 06-05-10 02:17 AM) Link | Quote | ID: 131743


Rat
Level: 24

Posts: 66/96
EXP: 74504
Next: 3621

Since: 02-22-07
From: Phoenix, AZ

Last post: 2597 days
Last view: 2597 days
$2007 is just a data transfer register. Its use (combined with $2006) is to be able to move data from whats mapped into cpu's address space to the ppu's and vice versa. So the use really depends on where you're writing to or reading from.

A tile is 16 bytes because NES graphics are limited to 2 bits per pixel. Here's a better visual.

Now for the bigger problem. The reason for all that is because $2006 also has another use. During rendering, it's used by the ppu to draw the screen. You have to turn the screen off to use it, but before you turn it back on, you have to reset $2006 to the correct address. Even if you do that, you'll still have a portion of the screen be blanked because you turned it off mid-frame.

What you want to do is find out how the game buffers its vram updates and write all your data to the buffer. Then let the game take care of writing to vram on the next vblank.

I played a fair amount of RR back in the day too, thanks for the comments.

never-obsolete
Posted on 06-15-10 06:10 AM, in CHR-RAM Trouble Link | Quote | ID: 132016


Rat
Level: 24

Posts: 67/96
EXP: 74504
Next: 3621

Since: 02-22-07
From: Phoenix, AZ

Last post: 2597 days
Last view: 2597 days


Now, when you say write to the VRAM buffer, am I going to the buffer itself, and simply jumping to some free space, putting all of my code there, and then returning?

Matrixz has most of MM4's data documented, and it has the addresses of the VRAM buffer stuff. But I have no clue which one I should be using. I'm assuming it could be $19 or $1A because the name of that section is Graphics updates.



You'll be writing your tile data to the buffer instead of directly to vram. The code to do this will be wherever you have free space.

From the notes you posted, it looks like you'll need to write your data to $780-$7FE. $19 will need to be set (to 1?), but their might be other things.



Last question. Once I have a single tile written by $2007, do I have to use a LSR or ROR to make the tile shift downwards, to give the appearance that the rain is falling?



Shifts and rotates will work for moving it left and right. To shit up and down you write each byte off by one every frame and wrap after 7 for each plane.

never-obsolete
Posted on 11-30-10 04:04 PM, in The General Project Screenshot/Videos Thread... Link | Quote | ID: 138247


Rat
Level: 24

Posts: 68/96
EXP: 74504
Next: 3621

Since: 02-22-07
From: Phoenix, AZ

Last post: 2597 days
Last view: 2597 days
Here's what I've been working on lately:



never-obsolete
Posted on 12-07-10 04:04 PM, in The General Project Screenshot/Videos Thread... (rev. 2 of 12-07-10 04:05 PM) Link | Quote | ID: 138457


Rat
Level: 24

Posts: 69/96
EXP: 74504
Next: 3621

Since: 02-22-07
From: Phoenix, AZ

Last post: 2597 days
Last view: 2597 days
The game uses a sort of 6 in 1 compression scheme. For any given block of data you can have these mixed in:

raw data
1 byte rle
2 byte rle
1 byte rle + increment
lz
lz bit-reversed
lz reverse read

You can also set a flag to increase the size of the run.

The compression was the main reason I started working on this. Writing a decompressor was straight forward. The compressor I have usually saves a few bytes over the original data, but its slow. This game is pretty strapped for space and I think it's already hit the upper limit for the MMC3. I think a mapper hack to the MMC5 is the only way to go.


The program is written in VB6 + WinAPI.


never-obsolete
Posted on 03-05-11 07:08 AM, in What was the first game you ever emulated? Link | Quote | ID: 140001


Rat
Level: 24

Posts: 72/96
EXP: 74504
Next: 3621

Since: 02-22-07
From: Phoenix, AZ

Last post: 2597 days
Last view: 2597 days
It was Castlevania+Nesticle...on an e-Machine.

never-obsolete
Posted on 03-08-11 11:15 PM, in If you've ever programmed the NES... Link | Quote | ID: 140073


Rat
Level: 24

Posts: 73/96
EXP: 74504
Next: 3621

Since: 02-22-07
From: Phoenix, AZ

Last post: 2597 days
Last view: 2597 days
After awhile you'll have it memorized. Especially for the NES, which only has a handful of registers compared to some of the other systems. I mostly need to reference cycle counts nowadays, but in the beginning I couldn't go more than 20 minutes without having to page through a document.

never-obsolete
Posted on 03-31-11 04:47 PM, in Mega Man 4 Hack - PPU Address (rev. 4 of 03-31-11 04:57 PM) Link | Quote | ID: 140608


Rat
Level: 24

Posts: 74/96
EXP: 74504
Next: 3621

Since: 02-22-07
From: Phoenix, AZ

Last post: 2597 days
Last view: 2597 days
Writing #$00 to $2001 disables background and sprite rendering, so you have to add another write to turn them back on. Writing #$00 to $2001 midframe will cause portions of the screen not to be drawn. If you do all your writes to $2006/$2007 during VBlank, you don't need to write #$00 to $2001.

Also, here's a breakdown of what each bit of $2001 does.

never-obsolete
Posted on 03-31-11 05:37 PM, in Mega Man 4 Hack - PPU Address (rev. 2 of 03-31-11 05:39 PM) Link | Quote | ID: 140610


Rat
Level: 24

Posts: 75/96
EXP: 74504
Next: 3621

Since: 02-22-07
From: Phoenix, AZ

Last post: 2597 days
Last view: 2597 days
You can't call VBlank, because from the NES point of view, its just an interrupt that is synced to the tv.

You don't normally want to wait for vblank to write directly to VRAM because that will cause your game to slow down. You'd instead want to buffer the data so that it's written on the next VBlank. VBlank is not very long, so be careful you don't go over or you'll glitch the screen.

never-obsolete
Posted on 07-22-11 06:41 AM, in Whats the best MMC5 ROM to understand vertical split scroll? (rev. 4 of 07-22-11 06:47 AM) Link | Quote | ID: 145380


Rat
Level: 24

Posts: 76/96
EXP: 74504
Next: 3621

Since: 02-22-07
From: Phoenix, AZ

Last post: 2597 days
Last view: 2597 days
Did you set $5105 to map the nametables where you want them? I've never used the split feature either, so I'm not to sure how to set it up. Other than that, you might have to trace all the mapper writes to see how its done.





never-obsolete
Posted on 07-22-11 10:34 PM, in Whats the best MMC5 ROM to understand vertical split scroll? (rev. 3 of 07-22-11 10:41 PM) Link | Quote | ID: 145410


Rat
Level: 24

Posts: 77/96
EXP: 74504
Next: 3621

Since: 02-22-07
From: Phoenix, AZ

Last post: 2597 days
Last view: 2597 days
I poked around with this a little bit. I managed to set it up similar to Uchuu Keibitai SDF.

Nametables were mapped like this:

[NTA] [NTB]
[FILL] [EXRAM]

So first I filled the exram nametable with 2x2 metatiles like so:

#$00 #$01
#$02 #$03


ldx #0 ;
stx t0 ;
_lp1_newline: ldy #16
_lp1_fill: lda t0 ;
sta $5C00, X ;
sta $5D00, X ;
sta $5E00, X ;
sta $5F00, X ;
inx ;
ora #1 ;
sta $5C00, X ;
sta $5D00, X ;
sta $5E00, X ;
sta $5F00, X ;
inx ;
dey ;
bne _lp1_fill ;
lda t0 ;
eor #2 ;
sta t0 ;
cpx #0 ;
bne _lp1_newline ;



This has to be done during rendering otherwise it won't get written. NTA and NTB were filled with tile #$01.

This is how I initialized the split:


lda #$D8
sta MMC5_VS_MODE ; $5200
lda #2
sta MMC5_VS_BANK ; $5202
lda #0
sta splitScrollV


splitScrollV gets written to MMC5_VS_VSCROLL ($5201) every NMI. I'm not sure how you set it so that the emulator uses the MMC5 in "SL" mode. I was getting really jerky scrolling described in "CL" mode.

edit: Just to be clear, ExRam only needs to be written to during rendering for modes 0 and 1.



never-obsolete
Posted on 10-22-11 06:49 AM, in CHR-ROM MMC4 PPU Question (rev. 2 of 10-22-11 06:51 AM) Link | Quote | ID: 148181


Rat
Level: 24

Posts: 78/96
EXP: 74504
Next: 3621

Since: 02-22-07
From: Phoenix, AZ

Last post: 2597 days
Last view: 2597 days
Which side ($0000 or $1000) that has 2x2KB and 1x4KB can be set with bit7 of the bank select register ($8000). Which table sprites and backgrounds use can be changed with the ppu control register (assuming 8x8 sprites, otherwise bit0 of oam_t determines the table for sprites).

Now I'm confused as to your problem. Is the game crashing or is not displaying the correct graphics? If the latter, did you change the bank numbers that its supposed to be swapping in?

edit: If it is a graphics problem, is it in the pattern table viewer or on screen?

never-obsolete
Posted on 01-06-12 04:54 PM, in How often do you check or use this section of the forum? Link | Quote | ID: 149231


Rat
Level: 24

Posts: 79/96
EXP: 74504
Next: 3621

Since: 02-22-07
From: Phoenix, AZ

Last post: 2597 days
Last view: 2597 days
I check it usually once a day, sometimes more if there's an interesting topic.

never-obsolete
Posted on 02-02-12 06:40 PM, in Favorite Call Of Duty Game... Link | Quote | ID: 149756


Rat
Level: 24

Posts: 80/96
EXP: 74504
Next: 3621

Since: 02-22-07
From: Phoenix, AZ

Last post: 2597 days
Last view: 2597 days
My favorite was probably United Offensive. The larger maps and addition of vehicles was pretty fun. Also not a big fan of the regenerating health in the later games (amongst other things).

I like arena shooters, and Unreal Tournament has always been my favorite. I should probably give TF2 another try, since the UT population is pretty small.

never-obsolete
Posted on 02-08-12 01:02 AM, in Favorite Call Of Duty Game... (rev. 2 of 02-08-12 01:03 AM) Link | Quote | ID: 149805


Rat
Level: 24

Posts: 81/96
EXP: 74504
Next: 3621

Since: 02-22-07
From: Phoenix, AZ

Last post: 2597 days
Last view: 2597 days
My old roommate had mentioned the Tribes series to me back in the day. Based on what I saw in some gameplay videos, it seems right up my alley.

Sorta off topic, anyone here play(ed) ET:Quake Wars?

never-obsolete
Posted on 03-05-12 08:15 PM, in Question about Endless Loop (rev. 3 of 03-05-12 08:21 PM) Link | Quote | ID: 150348


Rat
Level: 24

Posts: 82/96
EXP: 74504
Next: 3621

Since: 02-22-07
From: Phoenix, AZ

Last post: 2597 days
Last view: 2597 days
The loop is broken when the nmi is triggered at the start of vblank. From my understanding of SMB, all game logic is run in the nmi handler and the “main“ thread is just a loop. There's a thread over at nesdev about the pros and cons of this method versus others.

never-obsolete
Posted on 03-16-12 06:40 AM, in Scanline or Interrupts? Link | Quote | ID: 150493


Rat
Level: 24

Posts: 83/96
EXP: 74504
Next: 3621

Since: 02-22-07
From: Phoenix, AZ

Last post: 2597 days
Last view: 2597 days
It's a little of both...you set an interrupt to fire at a particular scanline. In the interrupt handler, you write to the ppu and/or mapper to create whatever effect you are going for. Usually there is some timed code involved so that graphic/palette changes will happen during hblank and not muck up the display (assuming rendering is enabled).
Pages: 1 2 3 4 5


Main - Posts by never-obsolete

Acmlmboard 2.1+4δ (2023-01-15)
© 2005-2023 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.236 seconds. (332KB of memory used)
MySQL - queries: 138, rows: 170/170, time: 0.226 seconds.