monroecon.asm 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. spt_con_print: pop hl
  2. con_print:
  3. ld a,004h ; Select display memory
  4. out (0c8h),a ; Output to screen Map and system control
  5. .loop:
  6. ld a,(HL) ; get message char
  7. or a ; test for null
  8. jr z, .done ; return if done
  9. ld (ix+1),A ; store char
  10. inc ix ; advance screen pointer
  11. inc ix
  12. inc hl ; advance message pointer
  13. jr .loop ; continue
  14. .done:
  15. xor a ;054b Reset map
  16. out (0c8h),a ;054c Reset to memory Map and system control
  17. ret
  18. con_home: ld ix,VBASE
  19. ret
  20. spt_con_goto: pop ix
  21. ret
  22. con_NL:
  23. ld a,ixl ; go to beginning of line
  24. and $af ; then go to the next line
  25. add a,$a0
  26. ld ixl,a ; store the low byte back
  27. jr nc,.skip
  28. inc ixh ; fix up high byte if there was a carry
  29. .skip:
  30. ret
  31. con_clear:
  32. ld hl,VBASE
  33. ld bc,VSIZE
  34. ld a,004h ; Select display memory
  35. out (0c8h),a ; Output to screen Map and system control
  36. .loop:
  37. ld (hl),000h ;Put 00h in even byte
  38. inc hl ; bump
  39. ld (hl),020h ;Put 20h in odd byte
  40. dec bc
  41. cpi ; increments HL, decrements BC (and does a CP)
  42. jp pe, .loop
  43. xor a ; Reset A
  44. ld ix,VBASE
  45. out (0c8h),a ;054c Reset to memory Map and system control
  46. ret
  47. spt_con_index: pop bc
  48. con_index:
  49. add ix,bc
  50. ret