Hello!
I have a small issue with H.STKE hook. I am using it to initialize DISK ROM after my ROM started and then to get control of my ROM back.
Here is the code:
DI CALL RSLREG RRCA RRCA AND %00000011 LD B,A LD HL,EXPTBL ADD A,L LD L,A LD C,(HL) INC L INC L INC L INC L LD A,(HL) AND %00001100 OR B OR C LD (F0F8h),A LD H,A LD L,F7h ; RST 30h LD (H.STKE),HL LD HL,START_2 LD (H.STKE+2),HL RET START_2:
Everything works fine, except that my ROM executed twice. The ROM starts, then I initialize H.STKE and return back from the ROM. Then my ROM starts again, executes the same code as 1st time, initializes HSTKE again, and, on 3rd time it comes to START_2 from H.STKE hook. So, the question is - why ROM starts twice and how to prevent it from happening. I checked other similar programs and they work fine (one ROM execution and then hook). It really puzzles me. Hope somebody have an idea on why this is happening.
Login or register to post comments