style fixes

This commit is contained in:
mrdudz
2015-08-29 15:58:57 +02:00
parent 0e29a0993f
commit 57b8af1adc
22 changed files with 830 additions and 818 deletions

View File

@@ -4,6 +4,8 @@
[![build status](http://travis-ci.org/cc65/cc65.png)](http://travis-ci.org/cc65/cc65/builds) [![build status](http://travis-ci.org/cc65/cc65.png)](http://travis-ci.org/cc65/cc65/builds)
Binary snapshot for [Windows](http://sourceforge.net/projects/cc65/files/cc65-snapshot-win32.zip)
cc65 is a complete cross development package for 65(C)02 systems, including cc65 is a complete cross development package for 65(C)02 systems, including
a powerful macro assembler, a C compiler, linker, librarian and several a powerful macro assembler, a C compiler, linker, librarian and several
other tools. other tools.
@@ -23,6 +25,7 @@ including
- the Atari 8 bit machines. - the Atari 8 bit machines.
- the Atari 5200 console. - the Atari 5200 console.
- GEOS for the C64, C128 and Apple //e. - GEOS for the C64, C128 and Apple //e.
- the NEC PC-Engine
- the Nintendo Entertainment System (NES) console. - the Nintendo Entertainment System (NES) console.
- the Supervision console. - the Supervision console.
- the Oric Atmos. - the Oric Atmos.

View File

@@ -2,8 +2,7 @@
; PCE definitions. By Groepaz/Hitmem. ; PCE definitions. By Groepaz/Hitmem.
; ;
;; FIXME: optimize zeropage usage ; FIXME: optimize zeropage usage
CURS_X = $30 CURS_X = $30
CURS_Y = $31 CURS_Y = $31
SCREEN_PTR = $32 ;2 SCREEN_PTR = $32 ;2
@@ -13,6 +12,7 @@ RVS = $37
BGCOLOR = $38 BGCOLOR = $38
tickcount = $39 ;4 tickcount = $39 ;4
; FIXME: screen dimensions my change according to selected video mode
screenrows = (224/8) screenrows = (224/8)
charsperline = 61 charsperline = 61

View File

@@ -6,7 +6,6 @@
.export _clock .export _clock
.importzp sreg .importzp sreg
;; .importzp tickcount
.proc _clock .proc _clock

View File

@@ -10,8 +10,10 @@ _clrscr:
st0 #VDC_VWR st0 #VDC_VWR
ldy #$40 ldy #$40
rowloop: ldx #$80 rowloop:
colloop: lda #' ' ldx #$80
colloop:
lda #' '
sta a:VDC_DATA_LO sta a:VDC_DATA_LO
lda #$02 lda #$02
sta a:VDC_DATA_HI sta a:VDC_DATA_HI

View File

@@ -38,7 +38,8 @@ _bordercolor:
.export colors .export colors
colors: ; G R B colors:
; G R B
.word ((0<<6)+(0<<3)+(0)) ; 0 black .word ((0<<6)+(0<<3)+(0)) ; 0 black
.word ((7<<6)+(7<<3)+(7)) ; 1 white .word ((7<<6)+(7<<3)+(7)) ; 1 white
.word ((0<<6)+(7<<3)+(0)) ; 2 red .word ((0<<6)+(7<<3)+(0)) ; 2 red

View File

@@ -7,8 +7,8 @@
.constructor initconio, 24 .constructor initconio, 24
.macpack longbranch .macpack longbranch
initconio: initconio:
;; jsr vdc_init
jsr vce_init jsr vce_init
jsr psg_init jsr psg_init
jsr conio_init jsr conio_init
@@ -90,7 +90,8 @@ conio_init:
copy: copy:
ldy #$80 ; 128 chars ldy #$80 ; 128 chars
charloop: ldx #$08 ; 8 bytes/char charloop:
ldx #$08 ; 8 bytes/char
lineloop: lineloop:
lda (ptr1) lda (ptr1)
eor tmp1 eor tmp1
@@ -107,7 +108,8 @@ lineloop:
dex dex
bne lineloop ; next bitplane 0 byte bne lineloop ; next bitplane 0 byte
ldx #$08 ; fill bitplane 2/3 with 0 ldx #$08 ; fill bitplane 2/3 with 0
fillloop: st1 #$00 fillloop:
st1 #$00
st2 #$00 st2 #$00
dex dex
bne fillloop ; next byte bne fillloop ; next byte

View File

@@ -12,6 +12,7 @@
.importzp tmp3,tmp4 .importzp tmp3,tmp4
.include "pce.inc" .include "pce.inc"
_cputcxy: _cputcxy:
pha ; Save C pha ; Save C
jsr popa ; Get Y jsr popa ; Get Y
@@ -56,8 +57,6 @@ plot: ldy CURS_X
clc clc
jmp PLOT ; Set the new cursor jmp PLOT ; Set the new cursor
; Write one character to the screen without doing anything else, return X ; Write one character to the screen without doing anything else, return X
; position in Y ; position in Y

View File

@@ -57,6 +57,8 @@ start:
tam #%00000001 ; 0000-1FFF = Hardware page tam #%00000001 ; 0000-1FFF = Hardware page
lda #$F8 lda #$F8
tam #%00000010 ; 2000-3FFF = Work RAM tam #%00000010 ; 2000-3FFF = Work RAM
; FIXME: setup a larger block of memory to use with C-code
;lda #$F7 ;lda #$F7
;tam #%00000100 ; 4000-5FFF = Save RAM ;tam #%00000100 ; 4000-5FFF = Save RAM
;lda #1 ;lda #1
@@ -80,7 +82,7 @@ start:
sta IRQ_MASK ; Interrupts off sta IRQ_MASK ; Interrupts off
stz IRQ_STATUS ; Acknowledge timer stz IRQ_STATUS ; Acknowledge timer
;; FIXME; i dont know why the heck this one doesnt work when called from a constructor :/ ; FIXME; i dont know why the heck this one doesnt work when called from a constructor :/
.import vdc_init .import vdc_init
jsr vdc_init jsr vdc_init
@@ -165,7 +167,7 @@ _irq1:
phx phx
phy phy
; increment the system tick counter
inc tickcount inc tickcount
bne @s1 bne @s1
inc tickcount + 1 inc tickcount + 1

View File

@@ -5,6 +5,7 @@
.include "joy-kernel.inc" .include "joy-kernel.inc"
.include "joy-error.inc" .include "joy-error.inc"
.include "pce.inc"
.macpack module .macpack module
@@ -61,7 +62,7 @@ INSTALL:
lda #<JOY_ERR_OK lda #<JOY_ERR_OK
ldx #>JOY_ERR_OK ldx #>JOY_ERR_OK
; rts ; Run into DEINSTALL instead ; rts ; Run into UNINSTALL instead
; ------------------------------------------------------------------------ ; ------------------------------------------------------------------------
; DEINSTALL routine. Is called before the driver is removed from memory. ; DEINSTALL routine. Is called before the driver is removed from memory.
@@ -103,14 +104,14 @@ joy1:
read_joy: read_joy:
; reset multitap counter ; reset multitap counter
lda #$01 lda #$01
sta $1000 sta JOY_CTRL
pha pha
pla pla
nop nop
nop nop
lda #$03 lda #$03
sta $1000 sta JOY_CTRL
pha pha
pla pla
nop nop
@@ -119,26 +120,27 @@ read_joy:
cly cly
nextpad: nextpad:
lda #$01 lda #$01
sta $1000 ; sel = 1 sta JOY_CTRL ; sel = 1
pha pha
pla pla
nop nop ; some delay is required
nop nop
lda $1000 lda JOY_CTRL
asl a asl a
asl a asl a
asl a asl a
asl a asl a
sta padbuffer, y ; store new value sta padbuffer, y ; store new value
stz $1000 stz JOY_CTRL
pha pha
pla pla
nop
nop ; some delay is required
nop nop
lda $1000 lda JOY_CTRL
and #$0F and #$0F
ora padbuffer, y ; second half of new value ora padbuffer, y ; second half of new value

View File

@@ -34,4 +34,3 @@ _plothi:
.import initconio .import initconio
conio_init = initconio conio_init = initconio

View File

@@ -17,7 +17,8 @@ psg_clear_loop:
stz $0809 ; Clear LFO control stz $0809 ; Clear LFO control
cly cly
psg_clear_waveform: stz $0806 ; Clear waveform byte psg_clear_waveform:
stz $0806 ; Clear waveform byte
iny iny
cpy #$20 cpy #$20
bne psg_clear_waveform bne psg_clear_waveform
@@ -26,4 +27,3 @@ psg_clear_waveform: stz $0806 ; Clear waveform byte
cpx #$06 cpx #$06
bne psg_clear_loop bne psg_clear_loop
rts rts

View File

@@ -4,11 +4,14 @@
.export vce_init .export vce_init
vce_init: vce_init:
stz VCE_ADDR_LO ; ; Set CTA to zero
stz VCE_ADDR_HI ; Set CTA to zero stz VCE_ADDR_LO
stz VCE_ADDR_HI
ldy #$01 ldy #$01
vce_clear_bank: ldx #$00 vce_clear_bank:
vce_clear_color: stz VCE_DATA_LO ; Clear color (LSB) ldx #$00
vce_clear_color:
stz VCE_DATA_LO ; Clear color (LSB)
stz VCE_DATA_HI ; Clear color (MSB) stz VCE_DATA_HI ; Clear color (MSB)
dex dex
bne vce_clear_color bne vce_clear_color

View File

@@ -1,6 +1,7 @@
.include "pce.inc" .include "pce.inc"
; FIXME: implement selection of different video modes at runtime
HIRES = 1 HIRES = 1
.export vdc_init .export vdc_init

View File

@@ -2,7 +2,7 @@
; VGA charset for the PC-Engine conio implementation ; VGA charset for the PC-Engine conio implementation
.byte $00, $00, $00, $00, $00, $00, $00, $00 .byte $00, $00, $00, $00, $00, $00, $00, $00
;;.byte $7E, $81, $A5, $81, $BD, $99, $81, $7E
.byte %00000000 .byte %00000000
.byte %00000000 .byte %00000000
.byte %00000000 .byte %00000000
@@ -11,7 +11,7 @@
.byte %00000000 .byte %00000000
.byte %00000000 .byte %00000000
.byte %00000000 .byte %00000000
;;.byte $7E, $FF, $DB, $FF, $C3, $E7, $FF, $7E
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
@@ -20,7 +20,7 @@
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
;;.byte $6C, $FE, $FE, $FE, $7C, $38, $10, $00
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
@@ -29,7 +29,7 @@
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
;;.byte $10, $38, $7C, $FE, $7C, $38, $10, $00
.byte %00000000 .byte %00000000
.byte %00000000 .byte %00000000
.byte %00000000 .byte %00000000
@@ -38,7 +38,7 @@
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
;;.byte $38, $7C, $38, $FE, $FE, $7C, $38, $7C
.byte %00000000 .byte %00000000
.byte %00000000 .byte %00000000
.byte %00000000 .byte %00000000
@@ -47,7 +47,7 @@
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
;;.byte $10, $10, $38, $7C, $FE, $7C, $38, $7C
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
@@ -56,7 +56,7 @@
.byte %00000000 .byte %00000000
.byte %00000000 .byte %00000000
.byte %00000000 .byte %00000000
;;.byte $00, $00, $18, $3C, $3C, $18, $00, $00
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
@@ -65,7 +65,7 @@
.byte %00000000 .byte %00000000
.byte %00000000 .byte %00000000
.byte %00000000 .byte %00000000
;;.byte $FF, $FF, $E7, $C3, $C3, $E7, $FF, $FF
.byte %00000000 .byte %00000000
.byte %00000000 .byte %00000000
.byte %00000000 .byte %00000000
@@ -74,7 +74,7 @@
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
;;.byte $00, $3C, $66, $42, $42, $66, $3C, $00
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
@@ -83,7 +83,7 @@
.byte %00000000 .byte %00000000
.byte %00000000 .byte %00000000
.byte %00000000 .byte %00000000
;;.byte $FF, $C3, $99, $BD, $BD, $99, $C3, $FF
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
@@ -92,7 +92,7 @@
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
;;.byte $0F, $07, $0F, $7D, $CC, $CC, $CC, $78
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
@@ -101,6 +101,7 @@
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
.byte %00010000 .byte %00010000
.byte $3C, $66, $66, $66, $3C, $18, $7E, $18 .byte $3C, $66, $66, $66, $3C, $18, $7E, $18
.byte $3F, $33, $3F, $30, $30, $70, $F0, $E0 .byte $3F, $33, $3F, $30, $30, $70, $F0, $E0
.byte $7F, $63, $7F, $63, $63, $67, $E6, $C0 .byte $7F, $63, $7F, $63, $63, $67, $E6, $C0

View File

@@ -5,7 +5,6 @@
.include "pce.inc" .include "pce.inc"
.export _waitvblank .export _waitvblank
;; .importzp tickcount
.proc _waitvblank .proc _waitvblank
@@ -15,4 +14,3 @@
rts rts
.endproc .endproc

View File

@@ -41,7 +41,8 @@ void main(void)
p = malloc(16); p = malloc(16);
memcpy(p, "01234567890abcdef", 16); memcpy(p, "01234567890abcdef", 16);
cprintf("alloced at: %04p - %c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c", p, cprintf("alloced at: %04p - %c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c", p,
p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],p[9],p[10],p[11],p[12],p[13],p[14],p[15] p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],
p[8],p[9],p[10],p[11],p[12],p[13],p[14],p[15]
); );
} }
@@ -91,8 +92,7 @@ void main(void)
clk = clock(); clk = clock();
cprintf("clock: %08lx", clk); cprintf("clock: %08lx", clk);
for (i = 0; i < 4; ++i) for (i = 0; i < 4; ++i) {
{
gotoxy(0, 12 + i); gotoxy(0, 12 + i);
j = joy_read (i); j = joy_read (i);
cprintf ("pad %d: %02x %-6s%-6s%-6s%-6s%-6s%-6s%-6s%-6s", cprintf ("pad %d: %02x %-6s%-6s%-6s%-6s%-6s%-6s%-6s%-6s",