Adjusted comment formatting in several assembler files.
Removed dummy kbhit() function, as it's better to get a linker
error than an implementation that does the wrong thing.
<sect1>conio implementation<p>
-The conio implementation is complete except for a working kbhit() function.
-kbhit() currently returns true unconditionally.
+The conio implementation is complete except for a kbhit() function.
<sect1>stdio implementation<p>
cmp #0 ; Is the length zero?
beq L9 ; Jump if done
sta tmp1
-L1: lda #$94 ; Horizontal line, screen code
+L1: lda #$94 ; Horizontal line, screen code
jsr cputdirect ; Direct output
dec tmp1
bne L1
BANKS = VIDEORAMSIZE / $100\r
\r
_clrscr:\r
- lda #$20 ;' '\r
+ lda #$20 ; ' '\r
ldy #BANKS\r
ldx #$00\r
staloc:\r
inc staloc+2\r
dey\r
bne staloc\r
- lda #>(SCRNBASE); load high byte\r
- sta staloc+2 ; restore base address\r
+ lda #>(SCRNBASE) ; Load high byte\r
+ sta staloc+2 ; Restore base address\r
\r
- lda #$00 ; cursor in upper left corner\r
+ lda #$00 ; Cursor in upper left corner\r
sta CURS_X\r
sta CURS_Y\r
- jmp plot ; Set the cursor position\r
+ jmp plot ; Set the cursor position\r
.export _init, _exit
.import _main
-.export __STARTUP__ : absolute = 1 ; Mark as startup
-.import __RAM_START__, __RAM_SIZE__ ; Linker generated
+.export __STARTUP__ : absolute = 1 ; Mark as startup
+.import __RAM_START__, __RAM_SIZE__ ; Linker generated
.import zerobss, initlib, donelib
; ---------------------------------------------------------------------------
; A little light 6502 housekeeping
-_init: ldx #$FF ; Initialize stack pointer to $01FF
+_init: ldx #$FF ; Initialize stack pointer to $01FF
txs
- cld ; Clear decimal mode
+ cld ; Clear decimal mode
; ---------------------------------------------------------------------------
; Set cc65 argument stack pointer
; ---------------------------------------------------------------------------
; Initialize memory storage
- jsr zerobss ; Clear BSS segment
- jsr initlib ; Run constructors
+ jsr zerobss ; Clear BSS segment
+ jsr initlib ; Run constructors
; ---------------------------------------------------------------------------
; Call main()
jsr _main
; ---------------------------------------------------------------------------
-; Back from main (this is also the _exit entry): force a software break
+; Back from main (this is also the _exit entry):
-_exit: jsr donelib ; Run destructors
- jmp RESET ; Display boot menu after program exit
+_exit: jsr donelib ; Run destructors
+ jmp RESET ; Display boot menu after program exit
cmp #0 ; Is the length zero?
beq L9 ; Jump if done
sta tmp1
-L1: lda #$95 ; Vertical bar
+L1: lda #$95 ; Vertical bar
jsr putchar ; Write, no cursor advance
jsr newline ; Advance cursor to next line
dec tmp1
+++ /dev/null
-;
-; int kbhit (void);
-;
-; Currently a dummy function that returns always true
-
- .export _kbhit
-
-_kbhit:
- lda #$01 ; load low byte with true value
- ldx #$00 ; load high byte
- rts
; Addresses\r
-SCRNBASE := $D000 ; Base of video RAM\r
-INPUTC := $FD00 ; Input character from keyboard\r
-RESET := $FF00 ; Reset address, show boot prompt\r
+SCRNBASE := $D000 ; Base of video RAM\r
+INPUTC := $FD00 ; Input character from keyboard\r
+RESET := $FF00 ; Reset address, show boot prompt\r
\r
; Other definitions\r
-VIDEORAMSIZE = $0400 ; Size of C1P video RAM (1 kB)\r
-SCR_LINELEN = $18 ; screen width - 1\r
-SCR_HEIGHT = $18 ; screen height - 1\r
+VIDEORAMSIZE = $0400 ; Size of C1P video RAM (1 kB)\r
+SCR_LINELEN = $18 ; screen width - 1\r
+SCR_HEIGHT = $18 ; screen height - 1\r