Like I said on another topic here, I'm working on a SNES emulator, and today I decided to implement the HiRes modes 5 and 6. I was really wondering if the effort was worth it, since I can count on my fingers the games that actually make use of those modes, and I unfortunately can't count on my fingers the number of FPS I lost since I started implementing said modes.
Well, going to the point, I saw on Anomie doc that the HiRes modes will always use a 16 pixels wide tile, even on the 8x8 tile mode (so it can have either a 16x8 tile on the 8x8 mode, ie, 0x2105 bits 4-7 clear, or 16x16 on the 16x16 tiles mode). It should then render the even pixels (0, 2, 4, 6...) on the Sub Screen, and odd (1, 3, 5, 7...) on the Main Screen. This makes sense since it is supposed to create a 512 pixels wide picture on the end. Since the image is squished on the TV screen anyway, I think that what makes most sense on a emulator, is doing something like (Main[X] + Sub[X]) / 2 to get the final 256 pixels wide image, as opposed to display the whole 512 pixels on the screen.
My first doubt was wish effect the TM, TS, TMW and TSW (0x212C-0x212F) registers have on those HiRes modes. Normally, they are used to select if the pixel is rendered to the Main Screen or on the Sub Screen. But since modes 5/6 NEEDS to use the Sub Screen anyway, I guess that those registers have no effect (or they produce some weird result?)
My second doubt is what happen to the OAM objects (aka sprites) on the HiRes modes. They have a X/Y position and the X value normally only goes from -256 to 255. So I only see two possibilities to make this work on the HiRes mode, the X registers is either doubled, to take the new size into account, or the sign bit is no longer used, and the register would instead be a value between 0 and 511, and a left off-screen scrolling would be no longer possible.
Those are my doubts and I would be really thankful if someone could enlighten me on the subject.
Well, going to the point, I saw on Anomie doc that the HiRes modes will always use a 16 pixels wide tile, even on the 8x8 tile mode (so it can have either a 16x8 tile on the 8x8 mode, ie, 0x2105 bits 4-7 clear, or 16x16 on the 16x16 tiles mode). It should then render the even pixels (0, 2, 4, 6...) on the Sub Screen, and odd (1, 3, 5, 7...) on the Main Screen. This makes sense since it is supposed to create a 512 pixels wide picture on the end. Since the image is squished on the TV screen anyway, I think that what makes most sense on a emulator, is doing something like (Main[X] + Sub[X]) / 2 to get the final 256 pixels wide image, as opposed to display the whole 512 pixels on the screen.
My first doubt was wish effect the TM, TS, TMW and TSW (0x212C-0x212F) registers have on those HiRes modes. Normally, they are used to select if the pixel is rendered to the Main Screen or on the Sub Screen. But since modes 5/6 NEEDS to use the Sub Screen anyway, I guess that those registers have no effect (or they produce some weird result?)
My second doubt is what happen to the OAM objects (aka sprites) on the HiRes modes. They have a X/Y position and the X value normally only goes from -256 to 255. So I only see two possibilities to make this work on the HiRes mode, the X registers is either doubled, to take the new size into account, or the sign bit is no longer used, and the register would instead be a value between 0 and 511, and a left off-screen scrolling would be no longer possible.
Those are my doubts and I would be really thankful if someone could enlighten me on the subject.