Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2015
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. #include "kernel.inc"
  2. #include "corelib.inc"
  3. .db "KEXC"
  4. .db KEXC_ENTRY_POINT
  5. .dw start
  6. .db KEXC_STACK_SIZE
  7. .dw 20
  8. .db KEXC_NAME
  9. .dw name
  10. .db KEXC_HEADER_END
  11. name:
  12. .db "hello_world", 0
  13. start:
  14. ; This is an example program, replace it with your own!
  15. kld(de, corelib_path)
  16. pcall(loadLibrary)
  17.  
  18. ; Get a lock on the devices we intend to use
  19. pcall(getLcdLock)
  20. pcall(getKeypadLock)
  21.  
  22. ; Allocate and clear a buffer to store the contents of the screen
  23. pcall(allocScreenBuffer)
  24. pcall(clearBuffer)
  25.  
  26. kld(hl, window_title)
  27. xor a
  28. corelib(drawWindow)
  29.  
  30. call sub
  31.  
  32. .loop:
  33. ; Copy the display buffer to the actual LCD
  34. pcall(fastCopy)
  35.  
  36. ; flushKeys waits for all keys to be released
  37. pcall(flushKeys)
  38. ; waitKey waits for a key to be pressed, then returns the key code in A
  39. ;pcall(waitKey)
  40. corelib(appWaitKey)
  41.  
  42. cp kMODE
  43. jr nz, .loop
  44.  
  45. ; Exit when the user presses "MODE"
  46. ret
  47.  
  48. sub:
  49. ret
  50.  
  51. corelib_path:
  52. .db "/lib/core", 0
  53. window_title:
  54. .db "Hello World", 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement