Line Interrupt on the SMS

Post Reply
Yuguzu
New member
Posts: 1
Joined: Mon Sep 08, 2014 7:13 pm

Line Interrupt on the SMS

Post by Yuguzu »

Hello,

Hello,

I can't figure out how to setup a line interrupt on the sms.

Here is my code:

Code: Select all

void rasterHandler(){
        raster = 1;
}

set_vdp_reg(VDP_REG_FLAGS0, VDP_REG_FLAGS0_CHANGE);
set_vdp_reg(VDP_REG_FLAGS1, VDP_REG_FLAGS1_SCREEN|VDP_REG_FLAGS1_VINT);
set_vdp_reg(VDP_REG_HINT_COUNTER, 0x0F);

add_raster_int(rasterHandler);
The add_pause_int work just fine.

Can some one tell me what's wrong with my code?

Thanks
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

I am not too terribly familiar with the sms but the following lines from sms_crt0.asm doesn't look right:

Code: Select all

int_RASTER:
        push        hl
        
        ld        a, ($BF)
        or        a
        jp        p, int_not_VBL        ; Bit 7 not set
        jr        int_VBL

int_not_VBL:
        pop        hl
=====>>>>> insert "ei"
        reti
Before the last "reti" I think there should be an "ei".

Would you like to give that a try? The file can be found at z88dk/lib/sms_crt0.asm
Post Reply