SHARE
TWEET

HALT+DI testing

ISSOtm Oct 20th, 2017 (edited) 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     di
  2.     ld a, 2
  3.     ld [rIE], a
  4.     ld a, $20
  5.     ld [rSTAT], a
  6.    
  7.     xor a
  8.     ld [rIF], a
  9.     ld [$C001], a
  10.     halt ; Wait until a Mode 2 int
  11.     ld [rIF], a ; Clear it
  12.     ei ; Enable Mode 2 int
  13. REPT $100
  14.     inc a
  15. ENDR
  16.     ld de, $9909
  17.     ld a, [$C001]
  18.     and a
  19.     jr nz, .didInt
  20.     ld b, "!"
  21. .waitVRAMNoInt
  22.     rst isVRAMOpen
  23.     jr nz, .waitVRAMNoInt
  24.     ld a, b
  25.     ld [de], a
  26.     inc de
  27.     ld [de], a
  28.     jr @
  29. .didInt
  30.     ld a, [$C000]
  31.     call PrintHex
  32.    
  33.     jr @
  34.  
  35.  
  36. ; @ 0048, STAT handler :
  37. STAT_int::
  38.     ld hl, $C000
  39.     ld [hli], a
  40.     ld [hl], 1
  41.     ret ; Don't re-enable interrupts
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top