Jump to content

Pengwin

Members
  • Posts

    856
  • Joined

  • Last visited

Posts posted by Pengwin

  1. Time for a bit of necromancy...I'm going to resurrect this thread ;)

     

    Just thought I'd mention that I have added a sub-site to the Krazy Pengwin site, this is to help promote and record the progress for a couple of projects I have on the go.

     

    I haven't quite completed the sub-site yet, but I wanted to show it off anyway. any comments would be appreciated.

     

    Oh...the link...The Tripods Project

  2. I just voted that I played games on and used my Atari for non-gaming activities today, although this isn't strictly true. My A8 is in storage as I don't have the room for it right now, so I am using Atari800MacX. But if I did have the room, then I would have been using my 800XL.

     

    But I buy stuff to use. If it's still wrapped in cellophane, I'm afraid the cellophane comes off.

  3. Thanks for the simple explanation Mark :D

     

    I'll look again tomorrow, after the Merlot has worn off.

     

    I think using CC65 will be beneficial to expediting the development process, although it may mean a small compromise in performance.

     

    However, as I also develop for the Oric Atmos, CC65 is looking more and more desirable.

  4. Hi Pengwin,

     

    The header file "atari.h" declares the function as _graphics

    and has a #define for replacing 'graphics' with '_graphics'

    but only when ATARI_COMPAT_PRE_2_11 is defined.

     

    Probably best of if you change your call to:

    	_graphics(8);

    rather than enable the compatability.

     

    Regards,

    Mark

     

    Thanks Mark. I'll have a read through the header files and check the statements I need.

     

    Another quick question...how does the speed of compiled programs compare to assembly, Action!, Quick, etc

  5. I'm starting to see what you mean by "IMHO there is not enough room for any greater game project".

    I have just had to relocate a lot of data to get it to fit in the available memory. I still think I will manage to get a substantial project complete, but it looks to be more work than I first envisioned.

  6. I'm sure this must have been asked before, but is there a way to integrate CC65 into the XCode environment on MacOSX?

     

    Also, when I compile and link the following code, I get an error, which I will quote at the end. Any ideas to the cause? As far as I know, everything appears to be installed correctly.

     

    #include <stdlib.h>
    #include <string.h>
    #include <atari.h>
    #include <peekpoke.h>
    #include "tripods.h"
    
    void init(void)
    {
    graphics(8);
    POKE(709,1);
    POKE(710,191);
    }
    
    void startup(void)
    {
    unsigned char c, d;
    unsigned char* s;
    
    cleartext();
    ppos=1;
    cmp=0;
    
    do
    {
    	outtext(1,"DO YOU WANT TO CONTINUE YOUR");
    	outtext(2,"LAST GAME OR START A NEW ONE?");
    	outtext(4,"PRESS S - START A NEW GAME");
    	outtext(5,"	  C - RELOAD AN OLD GAME");
    	outtext(7,"	  ENTER YOUR CHOICE");
    	dispscreen();
    	while(!kbhit())
    	{
    		/* NULL assignment */
    	}
    } while(1==1);
    	
    }
    
    void dispscreen(void)
    {
    
    }
    
    void outtext(const unsigned char x, const char* s)
    {
    strcpy(h1[x-1],s);
    }
    
    void cleartext(void)
    {
    unsigned char x;
    for(x = 1; x <10; x++)
    {
    	outtext(x,BLANK);
    }
    }
    
    int main(void)
    {
     init(); 
    while(!kbhit())
    {
    	startup();
    }
    
    /* Done */
    return EXIT_SUCCESS;
    }

     

    tripods.c(9): Warning: Function call without a prototype

    tripods.c(31): Warning: Function call without a prototype

    tripods.c(37): Warning: `c' is defined but never used

    tripods.c(37): Warning: `d' is defined but never used

    tripods.c(37): Warning: `s' is defined but never used

    Unresolved external `_graphics' referenced in:

    tripods.s(21)

    ld65: Error: 1 unresolved external(s) found - cannot create output file

  7. I prefer to code directly onto my 800XL, using either Kyan Pascal or Quick and SIO2PC (with Serial2USB) connected to my Mac using SIO2OSX software. Unfortunately, my A8 is in storage at the moment, so I am using Atar800MacX with the above programs at the moment.

     

    I do however, have CC65 installed and if I ever decide to use it, I will be using Text Wrangler (BBEdit's little brother) for coding.

  8. The project I am working on, which I am keeping under wraps for now, is quite large, but that is mainly the data area, so I am using the memory otherwise used by the compiler for that.

     

    One thing I am finding is that I get some odd effects with the .TEXT function, which displays text in graphics mode 8, sometimes. Did you find any problems with this?

  9. Not sure if this has been asked before, but does anyone have any experience of using the Quick programming language?

     

    I have recently started a project and I am amazed at the power of this, what appears to be simple, language.

  10. procedure Box(x,y,w,h : integer);
    var
     scrpos, OFFSET : integer;
    (*
    x = (_sp)+15
    y = (_sp)+13
    w = (_sp)+11
    h = (_sp)+9
    offset = (_sp)+7
    scrpos = (_sp)+5
    *)
    begin
     scrpos:=-7236-((y*40)+x);
     offset:=40-w;
    ...

     

    Good morning Pengwin,

     

    after a first short look on the code i had the idea that the stack offset to _SP could be in wrong order. I thought, the variables are stored as follows:

     

    0-4 ; used by Kyan

     

    offset 5,6

    scrpos 7,8

    h 9,10

    w 11,12

    y 13,14

    x 15,16

     

    (first L then H byte)

     

    That would mean, "offset" has an offset of 5 and 6, "scrpos" of 7 and 8. Please correct me if i'm wrong. Maybe you could check that first...

     

    You should test your proc step by step. First try to put one single character to pos 0,0 of the screen to test, if you have calculated the right address. Then try to draw a line and so on. You can take of look on the "InvertXY" Proc posted above wich also calculates the upper left corner and ads an offset according to x and y position required for inverting.

     

    Greets, Michael

     

    Good call Michael. You're absolutely right!

     

    I also spotted that the initial value of scrpos is incorrect. It should be -25535 (40000 - 65535)

     

    Thanks for the spot, I'll give it a try now.

  11. thanks for the additional codes and of course ;) for the box-routine. Give me some time with it, i will try to help you but can not promise success, because asm code isn't easy to read especially when uncommented...

    I'll add the comments for what it's supposed to do later and repost the routine.

     

    Is your nickname related to the Pengo game on XL/XE ;)?

    Erm, no. The name Krazy Pengwin came about a few years ago due to an ex-girlfriend (long story).

  12. Michael, you said you used to do assembler, I was wondering if you could help me with this. I am really an assembler newbie.

    The routine is supposed to display a box on a graphics mode 0 screen, with the x and y parameters indicating the top left corner and the w and h parameters indicating the height and width respectively.

    For some reason, I am not getting anything to appear on screen.

     

    Can you help? (sorry about the lack of comments)

     

    procedure Box(x,y,w,h : integer);
    var
     scrpos, OFFSET : integer;
    (*
    x = (_sp)+15
    y = (_sp)+13
    w = (_sp)+11
    h = (_sp)+9
    offset = (_sp)+7
    scrpos = (_sp)+5
    *)
    begin
     scrpos:=-7236-((y*40)+x);
     offset:=40-w;
    #a
    txa; Store off the X register
    pha
    
    ldy #$05; Store tl of box
    lda (_sp),y
    sta _t
    iny
    lda (_sp),y
    sta _t+1  
    
    iny; Store offset
    lda (_sp),y
    sta _t+2
    
     
    ldy #11
    lda (_sp),y
    tax
    sta _t+4
    ldy #9
    lda (_sp),y
    tay
    sta _t+5 
    
    box00
    cpx _t+4
    bne box10
    cpy _t+5
    bne box01
    lda #$11
    jmp box39
    box01
    cpy #$01
    bne box02
    lda #$05
    jmp box39
    box02
    lda #$12
    jmp box39
    
    box10
    cpx #$01
    bne box20
    cpy _t+5
    bne box11
    lda #$1a
    jmp box39
    box11
    cpy #$01
    bne box02
    lda #$03
    jmp box39
    
    box20
    cpy _t+5
    beq box21
    cpy #$01
    beq box21
    lda #$20
    jmp box39
    box21
    lda #$7c
    
    box39 
    sta _t+6
    txa
    pha
    ldx #$0
    lda _t+6
    sta (_t,x)
    pla
    tax
    dey
    beq box40
    lda _t
    clc
    adc #$01
    sta _t
    bcc box41
    inc _t+1
    jmp box00
    box40
    dex
    beq box50
    ldy _t+5
    lda _t
    clc
    adc _t+2
    sta _t
    bcc box41
    inc _t+1
    box41
    jmp box00
    
    box50
    
    pla; Restore the X register
    tax 
    #
    end;

  13. Just realised, the routines also require this one. Again quick and dirty, but it does the job.

     

    (* 
    Requires 
    LENGTH.I
    *)
    
    function StrToInt(s : string): integer;
    var x,m,v,c : integer;
    begin
    x:=Length(s);
    v:=0;
    m:=1;
    while x>0 do
    begin
     c:=Ord(s[x])-48;
     if (c<0) or (c>9) then
     begin
      v:=-1;
      x:=0;
     end
     else begin
      v:=v + (c*m);
      m:=m*10;
      x:=x-1;
     end;
    end;
    StrToInt:=v;
    end;

  14. Hi Michael,

     

    Thanks for the nice comment about my site.

     

    I have created DIR and FileExists routines, although they are a bit quick and dirty :

     

    (* 
    Requires 
    CIOLIB.I
    SUBSTRIN.I
    LENGTH.I
    CONCAT.I
    STRTOINT.I
    *)
    
    function OpenDir(IOCB_Num : integer; d : Device_String) : boolean;
    begin
    OpenDir:=(Open(IOCB_Num,6,0,d)=1);
    end;
    
    function GetDir(IOCB_Num : integer; var fn : string; var sz : integer; var ro : boolean) : boolean;
    var
    gb,x : integer;
    done,ok : boolean;
    tfn,ext : string;
    begin
    for x:=1 to MAXSTRING DO
     tfn[x]:=' ';
    x:=0;
    ok:=false;
    repeat
     done:=Get_Byte(IOCB_Num,gb)<>1;
     if not done then
     begin
      if gb=155 then
      begin
    ok:=True;
    done:=true
      end
      else begin
    x:=x+1;
    tfn[x]:=Chr(gb);
      end;
     end;
    until done;
    if (tfn[1]<>' ') and (tfn[1]<>'*') then  ok:=false;
    if ok then
    begin
     Substring(tfn,fn,3,8);
     Substring(tfn,ext,11,3);
     if(Length(ext)>0) then
     begin
      fn[Length(fn)+1]:='.';
      Concat(fn,ext,fn);
     end;
     ro:=tfn[1]='*'; 
     Substring(tfn,ext,15,3);
     sz:=StrToInt(ext);
    end;
    GetDir:=ok;
    end;
    
    function FileExists(IOCB_Num : integer; d : Device_String) : boolean;
    var
    found : boolean;
    fn : string;
    sz : integer;
    ro : boolean;
    begin
    if OpenDir(IOCB_Num,d) then
     found:=GetDir(IOCB_Num,fn,sz,ro)
    else
     found:=False;
    sz:=Close(IOCB_Num);
    FileExists:=found;
    end;

×
×
  • Create New...