mirror of
https://github.com/gungwald/prodos-more.git
synced 2024-12-01 21:50:41 +00:00
Tried to use CR sub buit it didn't work
This commit is contained in:
parent
8ace07d469
commit
0add3cc9d7
@ -44,7 +44,7 @@
|
||||
*
|
||||
* SYSTEM VARIABLES
|
||||
*
|
||||
PTR EQU $06 ;ONLY FREE 0-PAGE LOCATION
|
||||
PTR EQU 06 ;ONLY FREE 0-PAGE LOCATION
|
||||
CH EQU $24 ;40-COL HORZ CURS POSITION
|
||||
CV EQU $25 ;40-COL VERT CURS POSITION
|
||||
PROMPT EQU $33 ;PROMPT CHARACTER
|
||||
@ -60,6 +60,7 @@ OURCV EQU $05FB ;VERTICAL CURSOR POSITION
|
||||
*
|
||||
* SUBROUTINES IN MONITOR ROM: $F800 - $FFFF
|
||||
*
|
||||
CR EQU $FC62 ;CURSOR TO BEG OF NEXT LINE
|
||||
RDKEY EQU $FD0C ;READS A CHARACTER
|
||||
GETLN EQU $FD6A ;READS A LINE, WITH PROMPT($33)
|
||||
GETLN1 EQU $FD6F ;READS A LINE, NO PROMPT
|
||||
@ -98,7 +99,7 @@ CLOSEPARMCNT EQU 1
|
||||
*
|
||||
* ASCII
|
||||
*
|
||||
CR EQU $0D ;ASCII CARRIAGE RETURN
|
||||
CR_CHAR EQU $0D ;ASCII CARRIAGE RETURN
|
||||
CR_HIBIT EQU $8D ;CARRIAGE RET WITH HIGH BIT SET
|
||||
*
|
||||
* CONSTANTS
|
||||
@ -153,7 +154,7 @@ CPIN MAC
|
||||
LOOP CPY ]1 ;COMPARE Y WITH LENGTH BYTE
|
||||
BEQ ENDLOOP ;DONE IF LENGTH IS REACHED
|
||||
LDA IN,Y ;LOAD IN[Y] INTO ACCUMULATOR
|
||||
CMP #CR ;COMPARE WITH CARRIAGE RETURN
|
||||
CMP #CR_CHAR ;COMPARE WITH CARRIAGE RETURN
|
||||
BEQ ENDLOOP ;STOP AT CARRIAGE RETURN
|
||||
INY ;DEST STR IS 1 AHEAD OF IN BUF
|
||||
STA ]1,Y ;COPY CHAR TO DEST STR ]1
|
||||
@ -350,6 +351,7 @@ GET_SCRN_WDTH LDA #128
|
||||
JMP :END
|
||||
:EIGHTY_COLUMNS LDA #80
|
||||
STA SCR_WDTH
|
||||
JSR PRBYTE
|
||||
:END NOP
|
||||
RTS
|
||||
|
||||
@ -504,6 +506,7 @@ VIEWFILE
|
||||
PUTS ENVIEW
|
||||
FIN
|
||||
|
||||
COPY_B SCRNLINE;#1 ;INIT SCREEN LINE NUMBER
|
||||
COPY_B LINEIDX;#1 ;POSITION IN LINE
|
||||
:LOOP JSR PRODOS_MLI ;CALL PRODOS TO READ FILE
|
||||
DB READ ;SPECIFY PRODOS READ COMMAND
|
||||
@ -534,7 +537,7 @@ WRITEBUF PUSHY
|
||||
*
|
||||
* CHECK AT END OF PAGE
|
||||
*
|
||||
LDA CV ;CURSOR VERTICAL SCREEN LINE
|
||||
LDA SCRNLINE ;CURSOR VERTICAL SCREEN LINE
|
||||
CMP #SCR_HGHT ;AT BOTTOM OF SCREEN?
|
||||
BNE :CONT ;NO? THEN NEXT CHAR
|
||||
JSR STATBAR ;YES? THEN SHOW THE STATUS BAR
|
||||
@ -556,22 +559,30 @@ WRITEBUF PUSHY
|
||||
* *
|
||||
* WRITE CHAR TO SCREEN *
|
||||
* CLIPS TO SCREEN WIDTH *
|
||||
* PRESERVES ACCUMULATOR *
|
||||
* *
|
||||
********************************
|
||||
WRITECHAR STA CHAR ;DON'T LOOSE THE CHARACTER
|
||||
CMP #CR_HIBIT ;COMPARE TO CARRIAGE RETURN
|
||||
BNE :NOT_EOL ;IF NOT END OF LINE, PRINT
|
||||
INC CV ;FORCE DOWN 1 LINE ON SCREEN
|
||||
COPY_B LINEIDX;#1 ;RESET TO BEGINNING OF LINE
|
||||
JSR DOWN1LINE
|
||||
JMP :ENDSUB ;NOTHING MORE TO DO FOR EOL
|
||||
:NOT_EOL LDA LINEIDX ;GET CURSOR HORIZ COL
|
||||
CMP SCR_WDTH ;COMPARE WITH SCREEN WIDTH
|
||||
BPL :ENDSUB ;DON'T PRINT IF OFF SCREEN
|
||||
BPL :FORWARD ;DON'T PRINT IF OFF SCREEN
|
||||
LDA CHAR ;ON SCREEN, SO PRINT IT
|
||||
JSR COUT
|
||||
INC LINEIDX
|
||||
:ENDSUB LDA CHAR
|
||||
:FORWARD INC LINEIDX
|
||||
:ENDSUB RTS
|
||||
|
||||
********************************
|
||||
* *
|
||||
* GO TO BEGINNING OF NEXT LINE *
|
||||
* *
|
||||
********************************
|
||||
DOWN1LINE INC SCRNLINE ;KEEP TRACK OF LINE NUMBER
|
||||
COPY_B LINEIDX;#1 ;RESET TO BEGINNING OF LINE
|
||||
;COPY_B OURCH;#0
|
||||
JSR CROUT ;LINE DOWN & SCROLL IF NEEDED
|
||||
RTS
|
||||
|
||||
********************************
|
||||
@ -607,11 +618,11 @@ STATBAR
|
||||
:LOOP JSR RDKEY ;GET A KEY FROM THE USER
|
||||
CMP #" " ;CHECK IF SPACE ENTERED
|
||||
BNE :CHKCR ;IF NOT FORWARD TO NEXT CHECK
|
||||
SET1 LINENUM ;ADVANCE ONE PAGE, STORE 1
|
||||
SET1 SCRNLINE ;ADVANCE ONE PAGE, STORE 1
|
||||
JMP :ENDLOOP ;PROCESSED SPACE SO DONE
|
||||
:CHKCR CMP #CR_HIBIT ;CHECK FOR CARRIAGE RETURN
|
||||
BNE :CHKQUIT
|
||||
SET23 LINENUM
|
||||
SET23 SCRNLINE
|
||||
JMP :ENDLOOP
|
||||
:CHKQUIT CMP #"Q" ;USER WANTS TO QUIT
|
||||
BEQ :QUITTING ;NO RECOGNIZED INPUT
|
||||
@ -844,7 +855,7 @@ ERRTXT STR "ERROR:"
|
||||
FILENAME DS $FF
|
||||
PREFIX DS 64
|
||||
ERRCODE DS 1
|
||||
LINENUM DS 1
|
||||
SCRNLINE DS 1
|
||||
LINEIDX DS 1
|
||||
CHAR DS 1
|
||||
BAR STR '[RET] LINE [SPC] PAGE [Q]UIT'
|
||||
|
Loading…
Reference in New Issue
Block a user