Normalized coding style.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5499 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
ol.sc
2012-02-08 16:13:01 +00:00
parent 9aac71b74a
commit 00ddcaeb93
39 changed files with 195 additions and 244 deletions

View File

@@ -5,14 +5,14 @@
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Object files # Object files
S_OBJS += crc.o \ S_OBJS += clearram.o \
doublepop.o \ cmpfstring.o \
clearram.o \
fillram.o \
initram.o \
movedata.o \
doublespop.o \
copystring.o \
cmpstring.o \ cmpstring.o \
copyfstring.o \ copyfstring.o \
cmpfstring.o copystring.o \
crc.o \
doublepop.o \
doublespop.o \
fillram.o \
initram.o \
movedata.o

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Elysium' Witkowiak ; Maciej 'YTM/Elysium' Witkowiak
; ;
@@ -13,13 +12,13 @@
.include "geossym.inc" .include "geossym.inc"
_ClearRam: _ClearRam:
jsr DoublePop jsr DoublePop
pha pha
txa txa
pha pha
jsr ClearRam jsr ClearRam
pla pla
tax tax
pla pla
rts rts

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Elysium' Witkowiak ; Maciej 'YTM/Elysium' Witkowiak
; ;
@@ -13,10 +12,10 @@
.include "jumptab.inc" .include "jumptab.inc"
_CmpFString: _CmpFString:
jsr DoubleSPop jsr DoubleSPop
jsr popa jsr popa
jsr SetPtrXY jsr SetPtrXY
jsr CmpFString jsr CmpFString
bne L1 bne L1
jmp return0 jmp return0
L1: jmp return1 L1: jmp return1

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Elysium' Witkowiak ; Maciej 'YTM/Elysium' Witkowiak
; ;
@@ -13,8 +12,8 @@
.include "jumptab.inc" .include "jumptab.inc"
_CmpString: _CmpString:
jsr DoubleSPop jsr DoubleSPop
jsr CmpString jsr CmpString
bne L1 bne L1
jmp return0 jmp return0
L1: jmp return1 L1: jmp return1

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Elysium' Witkowiak ; Maciej 'YTM/Elysium' Witkowiak
; ;
@@ -13,7 +12,7 @@
.include "jumptab.inc" .include "jumptab.inc"
_CopyFString: _CopyFString:
jsr DoubleSPop jsr DoubleSPop
jsr popa jsr popa
jsr SetPtrXY jsr SetPtrXY
jmp CopyFString jmp CopyFString

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Alliance' Witkowiak ; Maciej 'YTM/Alliance' Witkowiak
; ;
@@ -12,5 +11,5 @@
.include "jumptab.inc" .include "jumptab.inc"
_CopyString: _CopyString:
jsr DoubleSPop jsr DoubleSPop
jmp CopyString jmp CopyString

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Alliance' Witkowiak ; Maciej 'YTM/Alliance' Witkowiak
; ;
@@ -13,9 +12,9 @@
.include "geossym.inc" .include "geossym.inc"
_CRC: _CRC:
jsr DoublePop jsr DoublePop
jsr CRC jsr CRC
lda r2L lda r2L
ldx r2H ldx r2H
rts rts

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Alliance' Witkowiak ; Maciej 'YTM/Alliance' Witkowiak
; ;
@@ -10,9 +9,9 @@
.include "geossym.inc" .include "geossym.inc"
DoublePop: DoublePop:
sta r0L sta r0L
stx r0H stx r0H
jsr popax jsr popax
sta r1L sta r1L
stx r1H stx r1H
rts rts

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Elysium' Witkowiak ; Maciej 'YTM/Elysium' Witkowiak
; ;
@@ -12,17 +11,17 @@
.include "geossym.inc" .include "geossym.inc"
DoubleSPop: DoubleSPop:
sta ptr4 sta ptr4
stx ptr4+1 stx ptr4+1
jsr popax jsr popax
sta ptr3 sta ptr3
stx ptr3+1 stx ptr3+1
; rts ; rts
; ;
; SetPtrXY can be sometimes executed twice, but even this way it is few cycles ; SetPtrXY can be sometimes executed twice, but even this way it is few cycles
; faster... ; faster...
SetPtrXY: SetPtrXY:
ldx #ptr4 ldx #ptr4
ldy #ptr3 ldy #ptr3
rts rts

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Elysium' Witkowiak ; Maciej 'YTM/Elysium' Witkowiak
; ;
@@ -13,18 +12,18 @@
.include "geossym.inc" .include "geossym.inc"
_FillRam: _FillRam:
sta r0L sta r0L
stx r0H stx r0H
jsr popa jsr popa
sta r2L sta r2L
jsr popax jsr popax
sta r1L sta r1L
stx r1H stx r1H
pha pha
txa txa
pha pha
jsr FillRam jsr FillRam
pla pla
tax tax
pla pla
rts rts

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Alliance' Witkowiak ; Maciej 'YTM/Alliance' Witkowiak
; ;
@@ -12,6 +11,6 @@
.include "geossym.inc" .include "geossym.inc"
_InitRam: _InitRam:
sta r0L sta r0L
stx r0H stx r0H
jmp InitRam jmp InitRam

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Elysium' Witkowiak ; Maciej 'YTM/Elysium' Witkowiak
; ;
@@ -13,15 +12,15 @@
.include "geossym.inc" .include "geossym.inc"
_MoveData: _MoveData:
sta r2L sta r2L
stx r2H stx r2H
jsr popax jsr popax
sta r0L sta r0L
stx r0H stx r0H
jsr popax jsr popax
sta r1L sta r1L
stx r1H stx r1H
jsr MoveData jsr MoveData
lda r1L ; return dest ptr to be compatible with memmove and memcpy lda r1L ; return dest ptr to be compatible with memmove and memcpy
ldx r1H ldx r1H
rts rts

View File

@@ -5,10 +5,10 @@
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Object files # Object files
S_OBJS += domenu.o \ S_OBJS += doicons.o \
domenu.o \
dopreviousmenu.o \ dopreviousmenu.o \
redomenu.o \
recovermenu.o \
recoverallmenus.o \
gotofirstmenu.o \ gotofirstmenu.o \
doicons.o recoverallmenus.o \
recovermenu.o \
redomenu.o

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Alliance' Witkowiak ; Maciej 'YTM/Alliance' Witkowiak
; ;
@@ -12,6 +11,6 @@
.include "geossym.inc" .include "geossym.inc"
_DoIcons: _DoIcons:
sta r0L sta r0L
stx r0H stx r0H
jmp DoIcons jmp DoIcons

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Alliance' Witkowiak ; Maciej 'YTM/Alliance' Witkowiak
; ;
@@ -12,7 +11,7 @@
.include "geossym.inc" .include "geossym.inc"
_DoMenu: _DoMenu:
sta r0L sta r0L
stx r0H stx r0H
lda #0 lda #0
jmp DoMenu jmp DoMenu

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Alliance' Witkowiak ; Maciej 'YTM/Alliance' Witkowiak
; ;
@@ -10,4 +9,4 @@
.include "jumptab.inc" .include "jumptab.inc"
_DoPreviousMenu = DoPreviousMenu _DoPreviousMenu = DoPreviousMenu

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Alliance' Witkowiak ; Maciej 'YTM/Alliance' Witkowiak
; ;
@@ -10,4 +9,4 @@
.include "jumptab.inc" .include "jumptab.inc"
_GotoFirstMenu = GotoFirstMenu _GotoFirstMenu = GotoFirstMenu

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Alliance' Witkowiak ; Maciej 'YTM/Alliance' Witkowiak
; ;

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Alliance' Witkowiak ; Maciej 'YTM/Alliance' Witkowiak
; ;
@@ -10,4 +9,4 @@
.include "jumptab.inc" .include "jumptab.inc"
_RecoverMenu = RecoverMenu _RecoverMenu = RecoverMenu

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Alliance' Witkowiak ; Maciej 'YTM/Alliance' Witkowiak
; ;
@@ -10,4 +9,4 @@
.include "jumptab.inc" .include "jumptab.inc"
_ReDoMenu = ReDoMenu _ReDoMenu = ReDoMenu

View File

@@ -5,16 +5,16 @@
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Object files # Object files
S_OBJS += startmousemode.o \ S_OBJS += clearmousemode.o \
clearmousemode.o \
mouseup.o \
mouseoff.o \
drawsprite.o \
possprite.o \
enablsprite.o \
disablsprite.o \ disablsprite.o \
ismseinregion.o \ drawsprite.o \
enablsprite.o \
getnextchar.o \
inittextprompt.o \ inittextprompt.o \
ismseinregion.o \
mouseoff.o \
mouseup.o \
possprite.o \
promptoff.o \ promptoff.o \
prompton.o \ prompton.o \
getnextchar.o startmousemode.o

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Alliance' Witkowiak ; Maciej 'YTM/Alliance' Witkowiak
; ;
@@ -10,4 +9,4 @@
.include "jumptab.inc" .include "jumptab.inc"
_ClearMouseMode = ClearMouseMode _ClearMouseMode = ClearMouseMode

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Alliance' Witkowiak ; Maciej 'YTM/Alliance' Witkowiak
; ;
@@ -12,5 +11,5 @@
.include "geossym.inc" .include "geossym.inc"
_DisablSprite: _DisablSprite:
sta r3L sta r3L
jmp DisablSprite jmp DisablSprite

View File

@@ -1,12 +1,9 @@
; ;
; Maciej 'YTM/Alliance' Witkowiak ; Maciej 'YTM/Alliance' Witkowiak
; ;
; 30.10.99 ; 30.10.99
;
; void DrawSprite (char spritenum, char *tab63 ); ; void DrawSprite (char spritenum, char *tab63 );
;
.import popa .import popa
.export _DrawSprite .export _DrawSprite
@@ -15,9 +12,8 @@
.include "geossym.inc" .include "geossym.inc"
_DrawSprite: _DrawSprite:
sta r4L
sta r4L stx r4H
stx r4H jsr popa
jsr popa sta r3L
sta r3L jmp DrawSprite
jmp DrawSprite

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Alliance' Witkowiak ; Maciej 'YTM/Alliance' Witkowiak
; ;
@@ -12,5 +11,5 @@
.include "geossym.inc" .include "geossym.inc"
_EnablSprite: _EnablSprite:
sta r3L sta r3L
jmp EnablSprite jmp EnablSprite

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Elysium' Witkowiak ; Maciej 'YTM/Elysium' Witkowiak
; ;
@@ -12,7 +11,7 @@
.include "jumptab.inc" .include "jumptab.inc"
_GetNextChar: _GetNextChar:
jsr GetNextChar jsr GetNextChar
ldx #0 ldx #0
tay ; preserve Z flag tay ; preserve Z flag
rts rts

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Alliance' Witkowiak ; Maciej 'YTM/Alliance' Witkowiak
; ;

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Elysium' Witkowiak ; Maciej 'YTM/Elysium' Witkowiak
; ;
@@ -7,13 +6,12 @@
; char IsMseInRegion (struct window *mywindow); ; char IsMseInRegion (struct window *mywindow);
.import _InitDrawWindow .import _InitDrawWindow
.export _IsMseInRegion .export _IsMseInRegion
.include "jumptab.inc" .include "jumptab.inc"
_IsMseInRegion: _IsMseInRegion:
jsr _InitDrawWindow jsr _InitDrawWindow
jsr IsMseInRegion jsr IsMseInRegion
ldx #0 ldx #0
rts rts

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Alliance' Witkowiak ; Maciej 'YTM/Alliance' Witkowiak
; ;
@@ -10,4 +9,4 @@
.include "jumptab.inc" .include "jumptab.inc"
_MouseOff = MouseOff _MouseOff = MouseOff

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Alliance' Witkowiak ; Maciej 'YTM/Alliance' Witkowiak
; ;
@@ -10,4 +9,4 @@
.include "jumptab.inc" .include "jumptab.inc"
_MouseUp = MouseUp _MouseUp = MouseUp

View File

@@ -1,12 +1,9 @@
; ;
; Maciej 'YTM/Alliance' Witkowiak ; Maciej 'YTM/Alliance' Witkowiak
; ;
; 30.10.99 ; 30.10.99
;
; void PosSprite (char spritenum, struct pixel *position ); ; void PosSprite (char spritenum, struct pixel *position );
;
.importzp ptr4 .importzp ptr4
.import popa .import popa
@@ -16,17 +13,17 @@
.include "geossym.inc" .include "geossym.inc"
_PosSprite: _PosSprite:
sta ptr4 sta ptr4
stx ptr4+1 stx ptr4+1
ldy #0 ldy #0
lda (ptr4),y lda (ptr4),y
sta r4L sta r4L
iny iny
lda (ptr4),y lda (ptr4),y
sta r4H sta r4H
iny iny
lda (ptr4),y lda (ptr4),y
sta r5L sta r5L
jsr popa jsr popa
sta r3L sta r3L
jmp PosSprite jmp PosSprite

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Alliance' Witkowiak ; Maciej 'YTM/Alliance' Witkowiak
; ;
@@ -10,4 +9,4 @@
.include "jumptab.inc" .include "jumptab.inc"
_PromptOff = PromptOff _PromptOff = PromptOff

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Alliance' Witkowiak ; Maciej 'YTM/Alliance' Witkowiak
; ;
@@ -13,12 +12,13 @@
.include "geossym.inc" .include "geossym.inc"
_PromptOn: _PromptOn:
sta ptr4 sta ptr4
stx ptr4+1 stx ptr4+1
ldy #0 ldy #0
promptLp: lda (ptr4),y promptLp:
sta stringX,y lda (ptr4),y
iny sta stringX,y
cpy #3 iny
bne promptLp cpy #3
jmp PromptOn bne promptLp
jmp PromptOn

View File

@@ -1,4 +1,3 @@
; ;
; Maciej 'YTM/Alliance' Witkowiak ; Maciej 'YTM/Alliance' Witkowiak
; ;
@@ -11,5 +10,5 @@
.include "jumptab.inc" .include "jumptab.inc"
_StartMouseMode: _StartMouseMode:
clc clc
jmp StartMouseMode jmp StartMouseMode

View File

@@ -5,7 +5,7 @@
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Object files # Object files
S_OBJS += processinitrestartenable.o \ S_OBJS += processblock.o \
processblock.o \
processfreeze.o \ processfreeze.o \
processinitrestartenable.o \
processsleep.o processsleep.o

View File

@@ -1,15 +1,12 @@
; ;
; Maciej 'YTM/Alliance' Witkowiak ; Maciej 'YTM/Alliance' Witkowiak
; ;
; 27.10.99 ; 27.10.99
;
; void InitProcesses (char number, struct process* proctab); ; void InitProcesses (char number, struct process* proctab);
; (rest) ; (rest)
; void BlockProcess (char number); ; void BlockProcess (char number);
; void UnBlockProcess (char number); ; void UnBlockProcess (char number);
;
.export _BlockProcess .export _BlockProcess
.export _UnBlockProcess .export _UnBlockProcess
@@ -17,9 +14,9 @@
.include "jumptab.inc" .include "jumptab.inc"
_BlockProcess: _BlockProcess:
tax tax
jmp BlockProcess jmp BlockProcess
_UnBlockProcess: _UnBlockProcess:
tax tax
jmp UnBlockProcess jmp UnBlockProcess

View File

@@ -1,13 +1,10 @@
; ;
; Maciej 'YTM/Alliance' Witkowiak ; Maciej 'YTM/Alliance' Witkowiak
; ;
; 27.10.99 ; 27.10.99
;
; void FreezeProcess (char number); ; void FreezeProcess (char number);
; void UnFreezeProcess (char number); ; void UnFreezeProcess (char number);
;
.export _FreezeProcess .export _FreezeProcess
.export _UnFreezeProcess .export _UnFreezeProcess
@@ -15,9 +12,9 @@
.include "jumptab.inc" .include "jumptab.inc"
_FreezeProcess: _FreezeProcess:
tax tax
jmp FreezeProcess jmp FreezeProcess
_UnFreezeProcess: _UnFreezeProcess:
tax tax
jmp UnFreezeProcess jmp UnFreezeProcess

View File

@@ -1,14 +1,11 @@
; ;
; Maciej 'YTM/Alliance' Witkowiak ; Maciej 'YTM/Alliance' Witkowiak
; ;
; 27.10.99 ; 27.10.99
;
; void InitProcesses (char number, struct process* proctab); ; void InitProcesses (char number, struct process* proctab);
; void RestartProcess (char number); ; void RestartProcess (char number);
; void EnableProcess (char number); ; void EnableProcess (char number);
;
.import popa .import popa
.export _InitProcesses .export _InitProcesses
@@ -19,16 +16,15 @@
.include "geossym.inc" .include "geossym.inc"
_InitProcesses: _InitProcesses:
sta r0L
sta r0L stx r0H
stx r0H jsr popa
jsr popa jmp InitProcesses
jmp InitProcesses
_RestartProcess: _RestartProcess:
tax tax
jmp RestartProcess jmp RestartProcess
_EnableProcess: _EnableProcess:
tax tax
jmp EnableProcess jmp EnableProcess

View File

@@ -1,37 +1,34 @@
; ;
; Maciej 'YTM/Elysium' Witkowiak ; Maciej 'YTM/Elysium' Witkowiak
; ;
; 30.10.99, 15.8.2003 ; 30.10.99, 15.8.2003
;
; void Sleep (int jiffies); ; void Sleep (int jiffies);
;
.importzp ptr1
.importzp tmp1
.export _Sleep .export _Sleep
.include "jumptab.inc" .include "jumptab.inc"
.include "geossym.inc" .include "geossym.inc"
.importzp ptr1
.importzp tmp1
_SleepExit: _SleepExit:
jsr Sleep ; call Sleep jsr Sleep ; call Sleep
ldx tmp1 ldx tmp1
txs ; restore stack pointer txs ; restore stack pointer
jmp (ptr1) ; when timeouts control will reach here jmp (ptr1) ; when timeouts control will reach here
_Sleep: _Sleep:
sta r0L ; store data sta r0L ; store data
stx r0H stx r0H
pla pla
sta ptr1 sta ptr1
pla pla
sta ptr1+1 ; preserve return address sta ptr1+1 ; preserve return address
inc ptr1 inc ptr1
bne @L0 bne @L0
inc ptr1+1 ; fix return address inc ptr1+1 ; fix return address
@L0: tsx @L0: tsx
stx tmp1 ; preserve stack pointer stx tmp1 ; preserve stack pointer
jsr _SleepExit ; call Sleep jsr _SleepExit ; call Sleep
jmp MainLoop ; immediate return here - go to idle loop jmp MainLoop ; immediate return here - go to idle loop