Have you ever played Thunder Force IV, and seen how does the title screen scales?
Here's what I mean:
![Image](http://dl.dropbox.com/u/38774534/t1.png)
![Image](http://dl.dropbox.com/u/38774534/t2.png)
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.
Moderators: BigEvilCorporation, Mask of Destiny
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
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
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);
Code: Select all
tst.b (want_line_double)
Code: Select all
eori.b #1,(want_line_double)
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
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.