Jump to content
IGNORED

SecondBASIC Studio HBLANK Example


Gemintronic

Recommended Posts

dra600n of Second Dimension posted a small HBLANK example I'd like to share here.  Basically, if you want to mess with the display on a certain scanline this is how you do it.  In this example we're changing out a whole palette on a certain line.  This is good if you want a status bar with a different set of palettes or a water effect like in Sonic 3.

 

Note that you will most likely get artifacts like "CRAM dots" if you mess with hblank even a little.

 

    hBlank 111
    
    On hInt GoSub hbl
    On vInt GoSub vbl
    
    Enable hInt
    Enable vInt
    
    hint_counter = 111
    
    End
    
    
vbl:
    Palettes pal1,0,0,16
    
    j = JoyPad(0)

    If j.0 = 1 Or j.1 = 1 Then
        hint_counter+=j.1-j.0
        hBlank hint_counter
    End If
    
    Return
    
    
hbl:
    Palettes pal2,0,0,16
    Return
    
    
    
pal1:
    DataInt $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
    DataInt $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
    
pal2:
    DataInt $0EEE,$0000,$0000,$0000,$0000,$0000,$0000,$0000
    DataInt $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...