Scroll Map scaling
Moderators: BigEvilCorporation, Mask of Destiny
Scroll Map scaling
Hello everyone. Here I come, with another question.
Have you ever played Thunder Force IV, and seen how does the title screen scales?
Here's what I mean:
I want to do some scaling in my game too, like this; but, I don't even know what logic have this.
Can someone tell me a way to do this? Thanks.
Have you ever played Thunder Force IV, and seen how does the title screen scales?
Here's what I mean:
I want to do some scaling in my game too, like this; but, I don't even know what logic have this.
Can someone tell me a way to do this? Thanks.
-
- Very interested
- Posts: 745
- Joined: Sat Dec 15, 2007 7:49 am
- Location: Kazakhstan, Pavlodar
-
- Very interested
- Posts: 745
- Joined: Sat Dec 15, 2007 7:49 am
- Location: Kazakhstan, Pavlodar
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
Here is how you do it in asm
If you want it to double plane b change the 4 to a 6
Also on vblank you must have:
and at the beginning of your code you must have
And to do it in c using SGDK
Vblank:
and in your main code do
Code: Select all
;---------------------
; Horizontal Blank
;---------------------
HBlank:
tst.b (want_line_double)
beq.s no_double ;branch if beq=0 bne!=0
move.l #$40000010,($C00004).l; ; Set VDP to V-Ram write mode at location 0000
move.l (vscroll),($C00000).l ; set the line scroll data
subq #1,(vscroll)
no_double:
rte
Also on vblank you must have:
Code: Select all
;---------------------
; Vertical Blank
;---------------------
VBlank:
move.w #$800,(vscroll)
Code: Select all
move.w #$8014,($C00004).l ; enable H-interrupts
move.w #$8A01,($C00004).l
Vblank:
Code: Select all
void vblank()
{
vscroll=0x800;
}
Code: Select all
void myHBlankFunction()
{
*((u32 *) /*GFX_CTRL_PORT*/0xC00004) = 0x40000010;
//asm("MOVE.L 0x40000010, (0xC00004)");
*((u16 *) 0xC00000) = vscroll;
vscroll--;
}
Code: Select all
setVBlankCallback(vblank);
// define method to call on HInt / HBlank
setHBlankCallback(myHBlankFunction);
VDP_setHIntCounter(1);
// enable H Int
VDP_setHInterrupt(1);
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
Shouldn't that
be more something like
?
Code: Select all
tst.b (want_line_double)
Code: Select all
eori.b #1,(want_line_double)
-
- Very interested
- Posts: 745
- Joined: Sat Dec 15, 2007 7:49 am
- Location: Kazakhstan, Pavlodar
Because it is mask flag, not even/odd scanline detector? And why don't just set HBlank firing every second scanline? For example my old video PD ROM:Chilly Willy wrote:Shouldn't thatbe more something likeCode: Select all
tst.b (want_line_double)
?Code: Select all
eori.b #1,(want_line_double)
Code: Select all
; In VDP init code set HBlank firing at every second scanline.
move.l #$C00004,a6
move.l #$C00000,a5
move.w #$8A01,$c00004
; In VBlank procedure reset vertical scroll position.
move.l #0,d5
; All dirty work done in HBlank procedure.
HInt:
cmp.w #0,d5 ;Begin of frame?
beq HInit ;No - continue to scroll down by 1 scanline
move.l #$40000010,(a6) ;Access to scroll RAM
and.w #$0FF,d5 ;Offset wraping
move.w d5,(a5) ;Access to scroll RAM
sub.w #1,d5 ;Next scanline
rte
HInit:
move.w #$8A01,(a6) ;Set HInt skip 1 scanline
move.l #$40000010,(a6) ;Access to scroll RAM
move.w d5,(a5) ;Access to scroll RAM
sub.w #1,d5
rte
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
That was why I asked if the test was wrong... because if it's not, it's completely pointless. You either do the int or not, and that would be decided before enabling the hint or not.Gigasoft wrote:That's kind of pointless, since you could just disable H-interrupts instead. And instead of writing the address each time, you should set the auto-increment to 0.