This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

SMB1: Scrolling Render Math Problem

SMB1: Scrolling Render Math Problem
by on (#41575)
RenderAreaGraphics:
lda CurrentColumnPos ;store LSB of where we're at
and #$01
sta $05
ldy VRAM_Buffer2_Offset ;store vram buffer offset
sty $00
lda CurrentNTAddr_Low ;get current name table address
sta VRAM_Buffer2+1,y ;we're supposed to render
lda CurrentNTAddr_High
sta VRAM_Buffer2,y
lda #$9a ;store length byte of 26 here with d7 set
sta VRAM_Buffer2+2,y ;to increment by 32 (in columns)

lda #$00 ;init attribute row
sta $04
tax

Every Time I try to change it to Render using Horizontal or vertical mirroring and it does not work properly, and every
value I use except #$9a corrupts the screen , I even tried the Windows Calculator, It didn't work

If you want to, I need some help on turning this routine to handle rendering for Horizontal mirroring or One screen mirroring

by on (#41577)
The lines you bolded have nothing to do with horiz/vert mirroring... $9A tells the the VRAM write routine that you want to draw a vertical line of 26 tiles.

The CurrentNTAddr_High would most likely be the culprit when it comes to mirroring issues.

Why exactly are you changing the mirroring? What are you trying to accomplish?

by on (#41579)
DarkCode wrote:
The lines you bolded have nothing to do with horiz/vert mirroring... $9A tells the the VRAM write routine that you want to draw a vertical line of 26 tiles.

The CurrentNTAddr_High would most likely be the culprit when it comes to mirroring issues.

Why exactly are you changing the mirroring? What are you trying to accomplish?


I wanted to switch to MMC5 mapper for enhanced 8x8 color rendering. But this enhancement only applies to One Screen Mirroring.

There is also some mappers that only handle Onescreen mirroring that I wanted to try it out with.

by on (#41582)
It would require quite a rewrite of the rendering engine being as the engine currently renders about 1/4 screen width ahead of the current screen full of data.

by on (#41585)
You do not need to change the mirroring mode for that, nor do you need to change how much of the level is pre-loaded and pre-rendered for it.

But you DO need to keep the ExAttributes updated and limit them to just what's on screen. But that's something you'd have to code from scratch anyway.

So yeah -- you don't need to mess with this part of the drawing routine or change the mirroring mode or whatever.

EDIT

I guess you do need to do all this work if you want to switch to 1-screen. But why would you want to do that? Only mapper I can think of that is worth considering which only does 1-screen is mapper 7, but what good would mapper 7 do you for SMB?

by on (#41599)
Sweet mother of science, I've created a monster.

by on (#41634)
Disch wrote:
You do not need to change the mirroring mode for that, nor do you need to change how much of the level is pre-loaded and pre-rendered for it.

But you DO need to keep the ExAttributes updated and limit them to just what's on screen. But that's something you'd have to code from scratch anyway.

So yeah -- you don't need to mess with this part of the drawing routine or change the mirroring mode or whatever.

EDIT

I guess you do need to do all this work if you want to switch to 1-screen. But why would you want to do that? Only mapper I can think of that is
worth considering which only does 1-screen is mapper 7, but what good would mapper 7 do you for SMB?


I really originally needed to hack it to use Horizontal mirroring. So I can not use Four-screen mirroring all the time, And also to to improve the game a little, I guess the only solution is Four-screen I guess.

If SMB3 ever gets disassembled (according to doppleganger at RHDN) Then things get better than this.

by on (#41635)
Er... wait... Horizontal? 4-screen? I thought you were talking about ExAttributes and 1-screen?

What are you trying to do again? And what does any of this have to do with SMB3?

Should I even ask these questions?

by on (#41636)
Disch wrote:
Er... wait... Horizontal? 4-screen? I thought you were talking about ExAttributes and 1-screen?

What are you trying to do again? And what does any of this have to do with SMB3?

Should I even ask these questions?


First of all, My hacks originally used Four-screen, Then I wanted to make some hack to make the renderer use One/Horizontal Mirroring, Then I hit a problem. So I now must do the original plan instead of that.

Does that make sense now?

by on (#41637)
Sort of.
Re: SMB1: Scrolling Render Math Problem
by on (#42585)
(Bump) I have found a few ideas on how to do this:

1. Make my own render routine. (Not that possible right now unless I learn more about Metatile Rendering ASM basics),

2. Make my own map/attribute/metatile editor with a NEW Map system (Not very easy to implent)

3. Get a Team or someone to help out a little, as in the recent RHDN/(Acmlm)Board2 teams. (Attempted, but not that possible to me)

OR

4. Do not bother with it at all (VERY likely)

For right now, Number 4 is the best choice unless I do and learn more of 6502 ASM, Which is the only syntax I know (although not very much) about ASM.

Until then, I should wait until Tepples SMB1 clone ''President'' is done.