No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

70 líneas
1.8KB

  1. ; vrow.s - draw one screen row for the c64 vim clone (called from power c).
  2. ;
  3. ; Position independent: no absolute jumps and no absolute data, so the bytes can
  4. ; sit in a C array and be called at wherever the linker put that array.
  5. ;
  6. ; Parameters live in zero page scratch that Power C leaves to ML routines
  7. ; (decimal 34-42 = $22-$2A), poked by C before the call (see vml.c):
  8. ; $22/$23 src address of the first byte of text (petscii)
  9. ; $24 len bytes of text to show, 0..40
  10. ; $25/$26 dst screen RAM address of the row's first cell
  11. ; $27 cur column to show reverse (the cursor), $FF = none
  12. ; $28 rev $00 normal text, $80 whole row reverse (status row)
  13. ;
  14. ; The row is cleared to blanks, the text is converted petscii -> screen code
  15. ; and copied, then the cursor cell is flipped to reverse video. Codes below
  16. ; $20 show as a blank. Colour RAM is set once at start-up, not here.
  17. ;
  18. ; Build: build-ml.ps1 (ca65 + ld65 -> vrow.bin -> vml.c).
  19. src = $22
  20. len = $24
  21. dst = $25
  22. cur = $27
  23. rev = $28
  24. .segment "CODE"
  25. entry: lda rev ; clear the row
  26. ora #$20
  27. ldy #39
  28. clr: sta (dst),y
  29. dey
  30. bpl clr
  31. ldy #0
  32. cp: cpy len
  33. beq done
  34. lda (src),y
  35. cmp #$20
  36. bcs ok
  37. lda #$20
  38. ok: cmp #$C0 ; petscii -> screen code
  39. bcc l1
  40. sbc #$80
  41. bcs st ; carry is still set: an unconditional branch
  42. l1: cmp #$A0
  43. bcc l2
  44. sbc #$40
  45. bcs st
  46. l2: cmp #$60
  47. bcc l3
  48. sbc #$20
  49. bcs st
  50. l3: cmp #$40
  51. bcc st
  52. sbc #$40
  53. st: ora rev
  54. sta (dst),y
  55. iny
  56. bne cp ; y never wraps (max 40): unconditional
  57. done: lda cur
  58. cmp #$FF
  59. beq fin
  60. tay
  61. lda (dst),y
  62. eor #$80
  63. sta (dst),y
  64. fin: rts

Powered by TurnKey Linux.