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)
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
a powerful macro assembler, a C compiler, linker, librarian and several
other tools.
@ -23,6 +25,7 @@ including
- the Atari 8 bit machines.
- the Atari 5200 console.
- GEOS for the C64, C128 and Apple //e.
- the NEC PC-Engine
- the Nintendo Entertainment System (NES) console.
- the Supervision console.
- the Oric Atmos.

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -57,6 +57,8 @@ start:
tam #%00000001 ; 0000-1FFF = Hardware page
lda #$F8
tam #%00000010 ; 2000-3FFF = Work RAM
; FIXME: setup a larger block of memory to use with C-code
;lda #$F7
;tam #%00000100 ; 4000-5FFF = Save RAM
;lda #1
@ -80,7 +82,7 @@ start:
sta IRQ_MASK ; Interrupts off
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
jsr vdc_init
@ -165,7 +167,7 @@ _irq1:
phx
phy
; increment the system tick counter
inc tickcount
bne @s1
inc tickcount + 1

View file

@ -5,6 +5,7 @@
.include "joy-kernel.inc"
.include "joy-error.inc"
.include "pce.inc"
.macpack module
@ -61,7 +62,7 @@ INSTALL:
lda #<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.
@ -103,14 +104,14 @@ joy1:
read_joy:
; reset multitap counter
lda #$01
sta $1000
sta JOY_CTRL
pha
pla
nop
nop
lda #$03
sta $1000
sta JOY_CTRL
pha
pla
nop
@ -119,26 +120,27 @@ read_joy:
cly
nextpad:
lda #$01
sta $1000 ; sel = 1
sta JOY_CTRL ; sel = 1
pha
pla
nop
nop ; some delay is required
nop
lda $1000
lda JOY_CTRL
asl a
asl a
asl a
asl a
sta padbuffer, y ; store new value
stz $1000
stz JOY_CTRL
pha
pla
nop
nop ; some delay is required
nop
lda $1000
lda JOY_CTRL
and #$0F
ora padbuffer, y ; second half of new value

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -41,7 +41,8 @@ void main(void)
p = malloc(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,
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();
cprintf("clock: %08lx", clk);
for (i = 0; i < 4; ++i)
{
for (i = 0; i < 4; ++i) {
gotoxy(0, 12 + i);
j = joy_read (i);
cprintf ("pad %d: %02x %-6s%-6s%-6s%-6s%-6s%-6s%-6s%-6s",