; Screen size variables
;
- .export xsize, ysize
+ .export screensize
-.rodata
+ .include "apple2.inc"
-xsize: .byte 40
-ysize: .byte 24
+.proc screensize
+ ldx #XSIZE
+ ldy #YSIZE
+ rts
+.endproc
BRKVec = $03F0 ; Break vector
RESTOR = $03D0 ; Goto Dos
+; ---------------------------------------------------------------------------
+; Screen size
+
+XSIZE = 40
+YSIZE = 24
+
;-----------------------------------------------------------------------------
; Hardware
; Screen size variables
;
- .export xsize, ysize
+ .export screensize
-.rodata
+.proc screensize
-xsize: .byte 40
-ysize: .byte 24
+ ldx #40
+ ldy #24
+ rts
+.endproc
; Screen size variables
;
- .export xsize, ysize
- .import SCREEN
- .constructor initscrsize
+ .export screensize
+ .include "c128.inc"
-.code
-
-initscrsize:
- jsr SCREEN
- inx
- stx xsize
- iny
- sty ysize
- rts
-
-.bss
-
-xsize: .res 1
-ysize: .res 1
+.proc screensize
+ ldx #40 ; Assume 40 column mode
+ bit MODE
+ bpl C40 ; Jump if 40 column mode
+ ldx #80
+C40: ldy #25
+ rts
+.endproc
; Screen size variables
;
- .export xsize, ysize
+ .export screensize
.import SCREEN
- .constructor initscrsize
-
-.code
-
-initscrsize:
- jsr SCREEN
- stx xsize
- sty ysize
- rts
-
-.bss
-
-xsize: .res 1
-ysize: .res 1
+screensize = SCREEN
.export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot
.import popa, _gotoxy
- .import xsize
.import PLOT
.include "../plus4/plus4.inc"
advance:
iny
- cpy xsize
+ cpy #XSIZE
bne L3
jsr newline ; new line
ldy #0 ; + cr
newline:
clc
- lda xsize
+ lda #XSIZE
adc SCREEN_PTR
sta SCREEN_PTR
bcc L4
inc SCREEN_PTR+1
clc
-L4: lda xsize
+L4: lda #XSIZE
adc CRAM_PTR
sta CRAM_PTR
bcc L5
; Screen size variables
;
- .export xsize, ysize
+ .export screensize
.import SCREEN
- .constructor initscrsize
-
-.code
-
-initscrsize:
- jsr SCREEN
- stx xsize
- sty ysize
- rts
-
-.bss
-
-xsize: .res 1
-ysize: .res 1
+screensize = SCREEN
TIME = $A0 ; 60 HZ clock
FNAM_LEN = $B7 ; Length of filename
SECADR = $B9 ; Secondary address
-DEVNUM = $BA ; Device number
+DEVNUM = $BA ; Device number
FNAM = $BB ; Pointer to filename
KEY_COUNT = $C6 ; Number of keys in input buffer
RVS = $C7 ; Reverse flag
BRKVec = $0316
NMIVec = $0318
+; ---------------------------------------------------------------------------
+; Screen size
+
+XSIZE = 40
+YSIZE = 25
+
; ---------------------------------------------------------------------------
; I/O: VIC
.export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot
.import popa, _gotoxy
- .import xsize
.import PLOT
.include "c64.inc"
advance:
iny
- cpy xsize
+ cpy #XSIZE
bne L3
jsr newline ; new line
ldy #0 ; + cr
newline:
clc
- lda xsize
+ lda #XSIZE
adc SCREEN_PTR
sta SCREEN_PTR
bcc L4
inc SCREEN_PTR+1
clc
-L4: lda xsize
+L4: lda #XSIZE
adc CRAM_PTR
sta CRAM_PTR
bcc L5
; Screen size variables
;
- .export xsize, ysize
+ .export screensize
-.rodata
+ .include "cbm510.inc"
-xsize: .byte 40
-ysize: .byte 25
+.proc screensize
+ ldx #XSIZE
+ ldy #YSIZE
+ rts
+
+.endproc
wstvec = $03F8
WstFlag = $03FA ; Warm start flag
+; ---------------------------------------------------------------------------
+; Screen size
+
+XSIZE = 40
+YSIZE = 25
+
;-----------------------------------------------------------------------------
; I/O Definitions
.import PLOT
.import popa, _gotoxy
- .import xsize
.include "cbm510.inc"
advance:
iny
- cpy xsize
+ cpy #XSIZE
bne L3
jsr newline ; new line
ldy #0 ; + cr
newline:
clc
- lda xsize
+ lda #XSIZE
adc SCREEN_PTR
sta SCREEN_PTR
bcc L4
inc SCREEN_PTR+1
clc
-L4: lda xsize
+L4: lda #XSIZE
adc CRAM_PTR
sta CRAM_PTR
bcc L5
; Screen size variables
;
- .export xsize, ysize
+ .export screensize
-.rodata
+ .include "cbm610.inc"
-xsize: .byte 80
-ysize: .byte 25
+.proc screensize
+ ldx #XSIZE
+ ldy #YSIZE
+ rts
+
+.endproc
WstFlag = $03FA ; Warm start flag
+; ---------------------------------------------------------------------------
+; Screen size
+
+XSIZE = 80
+YSIZE = 25
+
; ---------------------------------------------------------------------------
; I/O definitions
.import PLOT
.import _gotoxy
.import popa
- .import xsize
.include "cbm610.inc"
advance:
iny
- cpy xsize
+ cpy #XSIZE
bne L3
jsr newline ; new line
ldy #0 ; + cr
newline:
clc
- lda xsize
+ lda #XSIZE
adc CharPtr
sta CharPtr
bcc L4
.export _screensize
- .import popax
- .import xsize, ysize
- .importzp ptr1, ptr2
+ .import popsreg
+ .import screensize
+ .importzp ptr1, sreg
.proc _screensize
- sta ptr1 ; Store the y pointer
+ sta ptr1 ; Store the y pointer
stx ptr1+1
+ jsr popsreg ; Get the x pointer into sreg
+ jsr screensize ; Get screensize into X/Y
+ tya ; Get Y size into A
+
+.IFP02
+ ldy #0
+ sta (ptr1),y
+ txa
+ sta (sreg),y
+.ELSE
+ sta (ptr1)
+ txa
+ sta (sreg)
+.ENDIF
- jsr popax ; get the x pointer
- sta ptr2
- stx ptr2+1
-
- ldy #0
- lda xsize
- sta (ptr2),y
- lda ysize
- sta (ptr1),y
rts
.endproc
; Screen size variables
;
-
- .export xsize, ysize
- .constructor initscrsize
+ .export screensize
.include "pet.inc"
-.code
+.proc screensize
-initscrsize:
ldx SCR_LINELEN
inx ; Variable is one less
- stx xsize
- lda #25
- sta ysize
+ ldy #25
rts
-
-.bss
-
-xsize: .res 1
-ysize: .res 1
-
-
+.endproc
.export _clrscr
.import plot
.importzp ptr1
- .import xsize
.include "pet.inc"
; Determine, how many pages to fill
ldx #4
- lda xsize
- cmp #40
- beq L1
+ lda SCR_LINELEN ; Check length of one line
+ cmp #40+1
+ bcc L1
ldx #8
; Clear the screen
.export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot
.import popa, _gotoxy
- .import xsize
.include "pet.inc"
-; .include "../cbm/cbm.inc"
_cputcxy:
pha ; Save C
; Advance cursor position
advance:
- iny
- cpy xsize
+ cpy SCR_LINELEN ; xsize-1
bne L3
jsr newline ; new line
- ldy #0 ; + cr
-L3: sty CURS_X
+ ldy #$FF ; + cr
+L3: iny
+ sty CURS_X
rts
newline:
- clc
- lda xsize
+ lda SCR_LINELEN ; xsize-1
+ sec ; Account for -1 above
adc SCREEN_PTR
sta SCREEN_PTR
bcc L4
lda ScrLo,y
sta SCREEN_PTR
lda ScrHi,y
- ldy xsize
- cpy #40
- beq @L1
+ ldy SCR_LINELEN
+ cpy #40+1
+ bcc @L1
asl SCREEN_PTR ; 80 column mode
rol a
@L1: ora #$80 ; Screen at $8000
; Screen size variables
;
- .export xsize, ysize
+ .export screensize
-.data
+; We will return the values directly instead of banking in the ROM and calling
+; SCREEN which is a lot more overhead in code size and CPU cycles.
+
+.proc screensize
+
+ ldx #40
+ ldy #25
+ rts
+
+.endproc
-xsize: .byte 40
-ysize: .byte 25
.export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot
.import popa, _gotoxy
- .import xsize
.import PLOT
.include "plus4.inc"
advance:
iny
- cpy xsize
+ cpy #XSIZE
bne L3
jsr newline ; new line
ldy #0 ; + cr
newline:
clc
- lda xsize
+ lda #XSIZE
adc SCREEN_PTR
sta SCREEN_PTR
bcc L4
inc SCREEN_PTR+1
clc
-L4: lda xsize
+L4: lda #XSIZE
adc CRAM_PTR
sta CRAM_PTR
bcc L5
BRKVec = $0316
NMIVec = $0318
+; ---------------------------------------------------------------------------
+; Screen size
+
+XSIZE = 40
+YSIZE = 25
+
; ---------------------------------------------------------------------------
; I/O
; Screen size variables
;
- .export xsize, ysize
+ .export screensize
.import SCREEN
- .constructor initscrsize
-
-.code
-
-initscrsize:
- jsr SCREEN
- stx xsize
- sty ysize
- rts
-
-.bss
-
-xsize: .res 1
-ysize: .res 1
+screensize = SCREEN
.export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot
.import popa, _gotoxy
- .import xsize
.import PLOT
.include "vic20.inc"
advance:
iny
- cpy xsize
+ cpy #XSIZE
bne L3
jsr newline ; new line
ldy #0 ; + cr
newline:
clc
- lda xsize
+ lda #XSIZE
adc SCREEN_PTR
sta SCREEN_PTR
bcc L4
inc SCREEN_PTR+1
clc
-L4: lda xsize
+L4: lda #XSIZE
adc CRAM_PTR
sta CRAM_PTR
bcc L5
PALFLAG = $2A6 ; $01 = PAL, $00 = NTSC
+; ---------------------------------------------------------------------------
+; Screen size
+
+XSIZE = 22
+YSIZE = 23
+
; ---------------------------------------------------------------------------
; Kernal routines