Jump to content

SecondBASIC Studio HBLANK Example


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
    Palettes pal1,0,0,16
    j = JoyPad(0)

    If j.0 = 1 Or j.1 = 1 Then
        hBlank hint_counter
    End If
    Palettes pal2,0,0,16
    DataInt $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
    DataInt $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
    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.

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.

  • Recently Browsing   0 members

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