Kevin,

My best guess is that your local variable definitions are VERY wrong - you 
might want to try:

void putchar( char ch )
{
    unsinged char *pScreen;
    unsinged char *pX;
    unsinged char *pY;
    char           x;
    char           y;

    pScreen = (unsigned char *)video;
    pX      = (unsigned char *)caratx;
    pY      = (unsigned char *)caraty;

    x = *pX;
    y = *pY;

..... etc etc etc

As this seems to be what you want to achieve.  (Please note I don't have access 
to the compiler itself at the moment - so I can't test this)

PeterT 

-----Original Message-----
From: Kevin Zee [mailto:psy...@hughes.net] 
Sent: Tuesday, 5 May 2009 11:35 AM
To: Sdcc-user@lists.sourceforge.net
Subject: [Sdcc-user] Simple question for someone

I have gotten the libraries to build an am trying (unsuccessfully) to 
make a custom putchar.c (I removed the putchar.s file). This is what I 
have so far:

#include "memory.h"
void putchar(char ch) {
    *(unsigned char *)pScreen = video;
    *(unsigned char *)pX = caratx;
    *(unsigned char *)pY = caraty;

    char x;
    char y;
   
    x = pX;
    y = pY;
   
    pScreen += y * 160;
    pScreen += x * 2;
   
    if (ch = 0x0d) {
        // Adjust the cursor position, checking to see if we need to 
scrool the screen

        return;
    }
   
    return;
}


It gets errors on just about every line. The first error says syntax 
error: token 'char' where I declare x. Then, everywhere that a variable 
is mentioned, it says undefined identifier - even when I declare a variable

the .h file is.
#ifndef MEMORY_H
#define MEMORY_H

#define caratx 0x1FFE
#define caraty 0x1FFF
#define video  0x2000

#endif

I simply use "sdcc putchar.c" without quotes to compile.

I have been trying for hours to get this thing to work. What am I doing 
wrong?

------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

---------------------------------------------------------------------
CONFIDENTIALITY NOTE: Please consider our environment before printing this 
email.This email and any attachments are confidential and may be subject to 
copyright, legal or some other professional privilege. They are intended solely 
for the attention and use of the named addressee(s). They may only be copied, 
distributed or disclosed with the consent of the copyright owner. If you have 
received this email by mistake or by breach of the confidentiality clause, 
please notify the sender immediately by return email and delete or destroy all 
copies of the email. Any confidentiality, privilege or copyright is not waived 
or lost because this email has been sent to you by mistake.
---------------------------------------------------------------------


------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to