1
0
mirror of https://github.com/cc65/cc65.git synced 2025-02-23 03:29:00 +00:00

functions that do not modify data take const char* as argument

git-svn-id: svn://svn.cc65.org/cc65/trunk@848 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
izydorst 2001-08-15 16:09:35 +00:00
parent 9346c3fbac
commit 2a57280a11
11 changed files with 46 additions and 88 deletions

View File

@ -2,7 +2,7 @@
GEOS functions from disk driver GEOS functions from disk driver
ported to small C on 21.12.1999 ported to small C on 21.12.1999
by Maciej 'YTM/Alliance' Witkowiak by Maciej 'YTM/Elysium' Witkowiak
*/ */
#ifndef _GDISK_H #ifndef _GDISK_H
@ -16,10 +16,10 @@ char __fastcall__ ReadBuff(struct tr_se *myTrSe);
char __fastcall__ WriteBuff(struct tr_se *myTrSe); char __fastcall__ WriteBuff(struct tr_se *myTrSe);
char __fastcall__ GetBlock(struct tr_se *myTrSe, char *buffer); char __fastcall__ GetBlock(struct tr_se *myTrSe, char *buffer);
char __fastcall__ PutBlock(struct tr_se *myTrSe, char *buffer); char __fastcall__ PutBlock(struct tr_se *myTrSe, const char *buffer);
char __fastcall__ ReadBlock(struct tr_se *myTrSe, char *buffer); char __fastcall__ ReadBlock(struct tr_se *myTrSe, char *buffer);
char __fastcall__ WriteBlock(struct tr_se *myTrSe, char *buffer); char __fastcall__ WriteBlock(struct tr_se *myTrSe, const char *buffer);
char __fastcall__ VerWriteBlock(struct tr_se *myTrSe, char *buffer); char __fastcall__ VerWriteBlock(struct tr_se *myTrSe, const char *buffer);
int __fastcall__ CalcBlksFree(void); int __fastcall__ CalcBlksFree(void);
char __fastcall__ ChkDkGEOS(void); char __fastcall__ ChkDkGEOS(void);

View File

@ -9,18 +9,18 @@
#ifndef _GDLGBOX_H #ifndef _GDLGBOX_H
#define _GDLGBOX_H #define _GDLGBOX_H
char __fastcall__ DoDlgBox(char *dboxstring); char __fastcall__ DoDlgBox(const char *dboxstring);
char __fastcall__ RstrFrmDialogue(void); char __fastcall__ RstrFrmDialogue(void);
/* These are custom, predefined dialog boxes, I'm sure you'll find them usable /* These are custom, predefined dialog boxes, I'm sure you'll find them usable
Most of them show 2 lines of text */ Most of them show 2 lines of text */
char __fastcall__ DlgBoxYesNo(char *line1, char *line2); char __fastcall__ DlgBoxYesNo(const char *line1, const char *line2);
char __fastcall__ DlgBoxOkCancel(char *line1, char *line2); char __fastcall__ DlgBoxOkCancel(const char *line1, const char *line2);
void __fastcall__ DlgBoxOk(char *line1, char *line2); void __fastcall__ DlgBoxOk(const char *line1, const char *line2);
char __fastcall__ DlgBoxGetString(char *myString, char strLength, char __fastcall__ DlgBoxGetString(char *myString, char strLength,
char *line1, char *line2); const char *line1, const char *line2);
char __fastcall__ DlgBoxFileSelect(char *classtxt, char ftype, char __fastcall__ DlgBoxFileSelect(const char *classtxt, char ftype,
char *fname); char *fname);
/* Now the command string type */ /* Now the command string type */

View File

@ -15,21 +15,21 @@
struct filehandle *__fastcall__ Get1stDirEntry(void); struct filehandle *__fastcall__ Get1stDirEntry(void);
struct filehandle *__fastcall__ GetNxtDirEntry(void); struct filehandle *__fastcall__ GetNxtDirEntry(void);
char __fastcall__ FindFTypes(char *buffer, char ftype, char fmaxnum, char *classtxt); char __fastcall__ FindFTypes(char *buffer, char ftype, char fmaxnum, const char *classtxt);
char __fastcall__ FindFile(char *fname); char __fastcall__ FindFile(const char *fname);
char __fastcall__ ReadFile(struct tr_se *myTrSe, char *buffer, int flength); char __fastcall__ ReadFile(struct tr_se *myTrSe, char *buffer, int flength);
char __fastcall__ SaveFile(struct fileheader *myHeader); char __fastcall__ SaveFile(struct fileheader *myHeader);
char __fastcall__ FreeFile(struct tr_se myTable[]); char __fastcall__ FreeFile(struct tr_se myTable[]);
char __fastcall__ DeleteFile(char *fname); char __fastcall__ DeleteFile(const char *fname);
char __fastcall__ RenameFile(char *source, char *target); char __fastcall__ RenameFile(const char *source, const char *target);
char __fastcall__ ReadByte(void); char __fastcall__ ReadByte(void);
char __fastcall__ FollowChain(struct tr_se *startTrSe, char *buffer); char __fastcall__ FollowChain(struct tr_se *startTrSe, char *buffer);
char __fastcall__ GetFHdrInfo(struct filehandle *myFile); char __fastcall__ GetFHdrInfo(struct filehandle *myFile);
char __fastcall__ OpenRecordFile(char *fname); char __fastcall__ OpenRecordFile(const char *fname);
char __fastcall__ CloseRecordFile(void); char __fastcall__ CloseRecordFile(void);
char __fastcall__ NextRecord(void); char __fastcall__ NextRecord(void);
char __fastcall__ PreviousRecord(void); char __fastcall__ PreviousRecord(void);
@ -38,7 +38,7 @@ char __fastcall__ DeleteRecord(void);
char __fastcall__ InsertRecord(void); char __fastcall__ InsertRecord(void);
char __fastcall__ AppendRecord(void); char __fastcall__ AppendRecord(void);
char __fastcall__ ReadRecord(char *buffer, int flength); char __fastcall__ ReadRecord(char *buffer, int flength);
char __fastcall__ WriteRecord(char *buffer, int flength); char __fastcall__ WriteRecord(const char *buffer, int flength);
char __fastcall__ UpdateRecordFile(void); char __fastcall__ UpdateRecordFile(void);
/* GEOS filetypes */ /* GEOS filetypes */

View File

@ -12,22 +12,22 @@
#include <geos/gstruct.h> #include <geos/gstruct.h>
#endif #endif
void __fastcall__ CopyString(char *dest, char *source); void __fastcall__ CopyString(char *dest, const char *source);
char __fastcall__ CmpString(char *dest, char *source); char __fastcall__ CmpString(const char *dest, const char *source);
void __fastcall__ CopyFString(char len, char *dest, char *source); void __fastcall__ CopyFString(char len, char *dest, const char *source);
char __fastcall__ CmpFString(char len, char *dest, char *source); char __fastcall__ CmpFString(char len, char *dest, const char *source);
int __fastcall__ CRC(char *buffer, int len); int __fastcall__ CRC(const char *buffer, int len);
void __fastcall__ ClearRam(char *dest, int len); void __fastcall__ ClearRam(char *dest, int len);
void __fastcall__ FillRam(char *dest, char what, int len); void __fastcall__ FillRam(char *dest, char what, int len);
void __fastcall__ MoveData(char *dest, char *source, int len); void __fastcall__ MoveData(char *dest, const char *source, int len);
void __fastcall__ InitRam(char *myInitTab); void __fastcall__ InitRam(char *myInitTab);
void __fastcall__ StashRAM(char REUBank, int len, char *reuaddy, char *cpuaddy); void __fastcall__ StashRAM(char REUBank, int len, char *reuaddy, const char *cpuaddy);
void __fastcall__ FetchRAM(char REUBank, int len, char *reuaddy, char *cpuaddy); void __fastcall__ FetchRAM(char REUBank, int len, const char *reuaddy, char *cpuaddy);
void __fastcall__ SwapRAM(char REUBank, int len, char *reuaddy, char *cpuaddy); void __fastcall__ SwapRAM(char REUBank, int len, char *reuaddy, char *cpuaddy);
char __fastcall__ VerifyRAM(char REUBank, int len, char *reuaddy, char *cpuaddy); char __fastcall__ VerifyRAM(char REUBank, int len, const char *reuaddy, const char *cpuaddy);
#endif #endif

View File

@ -2,7 +2,7 @@
GEOS processes (~multitasking) functions GEOS processes (~multitasking) functions
ported to small C on 27.10.1999 ported to small C on 27.10.1999
by Maciej 'YTM/Alliance' Witkowiak by Maciej 'YTM/Elysium' Witkowiak
*/ */
#ifndef _GPROCESS_H #ifndef _GPROCESS_H
@ -22,20 +22,4 @@ void __fastcall__ UnFreezeProcess(char number);
void __fastcall__ Sleep(int jiffies); void __fastcall__ Sleep(int jiffies);
/* Process control variable
these probably should be removed from here, as they are
internal GEOS information which is updated by functions above
*/
/* bit numbers */
#define RUNABLE_BIT 7
#define BLOCKED_BIT 6
#define FROZEN_BIT 5
#define NOTIMER_BIT 4
/* bit masks */
#define SET_RUNABLE 0x80
#define SET_BLOCKED 0x40
#define SET_FROZEN 0x20
#define SET_NOTIMER 0x10
#endif #endif

View File

@ -2,7 +2,7 @@
GEOS mouse and sprite functions GEOS mouse and sprite functions
ported to small C on 27.10.1999 ported to small C on 27.10.1999
by Maciej 'YTM/Alliance' Witkowiak by Maciej 'YTM/Elysium' Witkowiak
*/ */
#ifndef _GSPRITE_H #ifndef _GSPRITE_H
@ -14,7 +14,7 @@ void __fastcall__ MouseUp(void);
void __fastcall__ MouseOff(void); void __fastcall__ MouseOff(void);
char __fastcall__ IsMseInRegion(struct window *region); char __fastcall__ IsMseInRegion(struct window *region);
void __fastcall__ DrawSprite(char spritenum, char *spritepic); void __fastcall__ DrawSprite(char spritenum, const char *spritepic);
void __fastcall__ PosSprite(char spritenum, struct pixel *position); void __fastcall__ PosSprite(char spritenum, struct pixel *position);
void __fastcall__ EnablSprite(char spritenum); void __fastcall__ EnablSprite(char spritenum);
void __fastcall__ DisablSprite(char spritenum); void __fastcall__ DisablSprite(char spritenum);

View File

@ -69,37 +69,6 @@
#define r15 *(unsigned int*)0x20 #define r15 *(unsigned int*)0x20
#define r15L *(char*)0x20 #define r15L *(char*)0x20
#define r15H *(char*)0x21 #define r15H *(char*)0x21
/* WARNING - these are used by C as temporary registers! */
#define a0 *(unsigned int*)0xfb
#define a0L *(char*)0xfb
#define a0H *(char*)0xfc
#define a1 *(unsigned int*)0xfd
#define a1L *(char*)0xfd
#define a1H *(char*)0xfe
#define a2 *(unsigned int*)0x70
#define a2L *(char*)0x70
#define a2H *(char*)0x71
#define a3 *(unsigned int*)0x72
#define a3L *(char*)0x72
#define a3H *(char*)0x73
#define a4 *(unsigned int*)0x74
#define a4L *(char*)0x74
#define a4H *(char*)0x75
#define a5 *(unsigned int*)0x76
#define a5L *(char*)0x76
#define a5H *(char*)0x77
#define a6 *(unsigned int*)0x78
#define a6L *(char*)0x78
#define a6H *(char*)0x79
#define a7 *(unsigned int*)0x7a
#define a7L *(char*)0x7a
#define a7H *(char*)0x7b
#define a8 *(unsigned int*)0x7c
#define a8L *(char*)0x7c
#define a8H *(char*)0x7d
#define a9 *(unsigned int*)0x7e
#define a9L *(char*)0x7e
#define a9H *(char*)0x7f
#define curPattern *(unsigned int*)0x22 #define curPattern *(unsigned int*)0x22
#define string *(unsigned int*)0x24 #define string *(unsigned int*)0x24
@ -107,15 +76,12 @@
#define currentMode *(char*)0x2e #define currentMode *(char*)0x2e
#define dispBufferOn *(char*)0x2f #define dispBufferOn *(char*)0x2f
#define mouseOn *(char*)0x30 #define mouseOn *(char*)0x30
#define RAM_64K *(char*)0x30
#define msePicPtr *(unsigned int*)0x31 #define msePicPtr *(unsigned int*)0x31
#define curWindow (*(struct window*)0x33) #define curWindow (*(struct window*)0x33)
#define pressFlag *(char*)0x39 #define pressFlag *(char*)0x39
#define mousePos (*(struct pixel*)0x3a) #define mousePos (*(struct pixel*)0x3a)
#define returnAddress *(unsigned int*)0x3d #define returnAddress *(unsigned int*)0x3d
#define graphMode *(char*)0x3f #define graphMode *(char*)0x3f
/*#define TURBO_DD00 *(char*)0x8e
#define TURBO_DD00_CPY *(char*)0x8f*/
#define STATUS *(char*)0x90 #define STATUS *(char*)0x90
#define curDevice *(char*)0xba #define curDevice *(char*)0xba
@ -200,9 +166,6 @@
#define firstBoot *(char*)0x88c5 #define firstBoot *(char*)0x88c5
#define curType *(char*)0x88c6 #define curType *(char*)0x88c6
#define ramBase *(char*)0x88c7 #define ramBase *(char*)0x88c7
/*Original:
#define inputDevName *(char*)0x88cb
#define memBase *(char*)0x88cf*/
#define inputDevName ((nameBuf)0x88cb) #define inputDevName ((nameBuf)0x88cb)
#define DrCCurDkNm ((nameBuf)0x88dc) #define DrCCurDkNm ((nameBuf)0x88dc)
#define DrDCurDkNm ((nameBuf)0x88ee) #define DrDCurDkNm ((nameBuf)0x88ee)

View File

@ -111,7 +111,7 @@ cbm610lib:
# GEOS on the C64/128 # GEOS on the C64/128
geoslib: geoslib:
CC=$(CC) \ CC=../$(CC) \
AS=../$(AS) \ AS=../$(AS) \
AR=../$(AR) \ AR=../$(AR) \
CFLAGS="-Osir -g -t geos -I../../include" \ CFLAGS="-Osir -g -t geos -I../../include" \

View File

@ -4,7 +4,18 @@
; Maciej 'YTM/Elysium' Witkowiak, 15.07.2001 ; Maciej 'YTM/Elysium' Witkowiak, 15.07.2001
; ;
.export _memset .export _memset
.import _FillRam .import popa, popax
_memset = _FillRam .include "../inc/jumptab.inc"
.include "../inc/geossym.inc"
_memset:
sta r0L
stx r0H
jsr popax
sta r2L
jsr popax
sta r1L
stx r1H
jmp FillRam

View File

@ -1,6 +1,6 @@
;GeosConst - various system constans sorted by function ;GeosConst - various system constans sorted by function
;reassembled by Maciej 'YTM/Alliance' Witkowiak ;reassembled by Maciej 'YTM/Elysium' Witkowiak
;4-2-99, 18-3-99 ;4-2-99, 18-3-99
NULL = 0 NULL = 0
@ -306,6 +306,7 @@ O_GHP_FNAME = 117
O_GHINFO_TXT = $a0 O_GHINFO_TXT = $a0
; values for CPU_DATA - C64 memory config ; values for CPU_DATA - C64 memory config
RAM_64K = $30 ;64K RAM
IO_IN = $35 ;60K RAM, 4K I/O space in IO_IN = $35 ;60K RAM, 4K I/O space in
KRNL_IO_IN = $36 ;kernal and I/O mapped into memory KRNL_IO_IN = $36 ;kernal and I/O mapped into memory
KRNL_BAS_IO_IN = $37 ;kernal, I/O and basic mapped into memory KRNL_BAS_IO_IN = $37 ;kernal, I/O and basic mapped into memory

View File

@ -1,6 +1,6 @@
;GEOS variable memory locations sorted by address ;GEOS variable memory locations sorted by address
;reassembled by Maciej 'YTM/Alliance' Witkowiak ;reassembled by Maciej 'YTM/Elysium' Witkowiak
;4-2-99 ;4-2-99
zpage = $0000 zpage = $0000
@ -101,7 +101,6 @@ cardDataPntr = $2c
currentMode = $2e currentMode = $2e
dispBufferOn = $2f dispBufferOn = $2f
mouseOn = $30 mouseOn = $30
RAM_64K = $30
msePicPtr = $31 msePicPtr = $31
windowTop = $33 windowTop = $33
windowBottom = $34 windowBottom = $34