case on dummy start end ; ;ReverseScrollRegion(line1, line2) ; ReverseScrollRegion START line2 equ 9 line1 equ 7 _rtlb equ 3 _d equ 1 ; brk $ea phb phd tsc tcd lda 23*8*160 ldx #$e12000+1920 ; src address ldy #$e12000+640 ; dest address ; ldx #$2000+1280 ; ldy #$2000 mvn $e10000,$e10000 ; ; now empty outline #24 ; pea 23 jsl ClearLine plb rtl END ; ; ClearLine(int line_no); clears the line ; ClearLine START line equ 9 _rtlb equ 5 tmp equ 3 _d equ 1 ; brk $ea phb pha phd tsc tcd ; line * 8 * 160 + 4*160 ; = line * 1024 + line * 256 + 4*160 lda $e10000,x ; stick a 0 in there txy ; destination address (src + 2) iny iny lda #8*160-3 ; length -1 mvn $e10000,$e10000 lda <_rtlb+2 sta <_rtlb+4 lda <_rtlb sta <_rtlb+2 pld pla pla plb rtl END ;extern void ClearScreenFrom(int Y); ; ; ; ClearScreenFrom START Y equ 9 _rtlb equ 5 tmp equ 3 _d equ 1 ; brk $ea phb pha phd tsc tcd ; line * 8 * 160 + 4*160 ; = line * 1024 + line * 256 + 4*160 lda $e10000,x ; stick a 0 in there txy ; destination address (src + 2) iny iny phy lda #$9d00-2 ; end of graphics + $2000 sec sbc 1,s ply ; a now equals length to clear mvn $e10000,$e10000 lda <_rtlb+2 sta <_rtlb+4 lda <_rtlb sta <_rtlb+2 pld pla pla plb rtl END ; ;extern void ClearLineFrom(int Y, int X); ; ; ; clear the end of the line from a given x & y ; ClearLineFrom START X equ 11 Y equ 9 _rtlb equ 5 tmp equ 3 _d equ 1 phb pha phd tsc tcd pea $e1e1 plb plb ; ; if X is >= 80, skip it... ; lda $e12000,x pld pla ;tmp pla sta 5,s pla sta 5,s pla plb rtl END ; ; clear the screen to black (or whatnot) ; ClearScreen START phb pea $e1e1 plb plb lda #0 ldy #0 loop anop sta $2000,y iny iny cpy #32000 bcc loop plb rtl ; ; this will, in 1 atomic action, blast the screen with 0 ; phb lda #0 sta >$e12000 lda #32000-3 ;length ldx #$2000 ldy #$2002 mvn $e10000,$e10000 plb rtl END ; ; draw a character at the current Xpos & Ypos ; ; PrintChar START andMask equ 11 char equ 9 _rtlb equ 5 pos equ 3 _d equ 1 ; brk $ea phb pha phd tsc tcd ; sanity check on Xpos && Ypos lda Xpos cmp #80 bcc _ok lda Ypos cmp #24 bcc _ok brl exit _ok anop pea $e1e1 plb plb ; ; each line has a width of 160 pixels ; ; start drawing the letter at $e12000 + (Ypos x 160 x 8) + Xpos ; 160 * 8 = 1240 = 1024 + 256 lda >Ypos and #$00ff xba ; x 256 sta Xpos asl a ; x 2 clc adc CHAR_SPACE,x eor >xor_mask and CHAR_SPACE+2,x eor >xor_mask and CHAR_SPACE+4,x eor >xor_mask and CHAR_SPACE+6,x eor >xor_mask and CHAR_SPACE+8,x eor >xor_mask and CHAR_SPACE+10,x eor >xor_mask and CHAR_SPACE+12,x eor >xor_mask and CHAR_SPACE+14,x eor >xor_mask and