| |||
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 |
never-obsolete |
| ||
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.
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 |
| ||
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 |
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 |
| ||
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 |
| ||
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 |
| ||
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 |
| ||
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 |
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.
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 |
| ||
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 |
| ||
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 |
| ||
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 |
| ||
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 |
| ||
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 |
| ||
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 |
| ||
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 |
| ||
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
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:
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 |
| ||
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 |
| ||
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 |
| ||
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 |
| ||
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 |
| ||
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 |
| ||
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). |
Main - Posts by never-obsolete |
© 2005-2023 Acmlm, blackhole89, Xkeeper et al. |
MySQL - queries: 138, rows: 170/170, time: 0.226 seconds. |