Jump to content
IGNORED

Mad Pascal


Recommended Posts

hello, this is seriell send , baud2400 :

 


program seriel;

var 
  i : byte;
  
  baud  : word absolute $fb;
  ascii : byte absolute $fd;

procedure seriell(); assembler;
asm {

  befehl = $fb
  puffer = $fd
  
  lda #2
    ldx #2
    ldy #0
    jsr $ffba

    lda #2
    ldx #<(befehl)
    ldy #>(befehl)
    jsr $ffbd

    jsr $ffc0

    ldx #2
    jsr $ffc9

    ldy #0
    lda puffer,y
    jsr $ffd2

    jsr $ffcc

loop:
    lda $029d
    cmp $029e
    bne loop

    ldx #50
loop1:
    jsr $eeb3  
    dex
    bne loop1

    lda #2
    jsr $ffc3
};
end;

begin

  baud:=$000a;
  
     for i:=64 to 90 do begin
      ascii:=i;
    seriell;
    end; 
   
end.

 

seriellaz.jpg

Edited by funkheld
Link to comment
Share on other sites

with open , send and close is ok , baud2400 :

 


//   KERNAL_SETLFS = $FFBA;
//   KERNAL_SETNAM = $FFBD;
//   KERNAL_OPEN   = $FFC0;
//   KERNAL_CLOSE  = $FFC3;
//   KERNAL_CHKIN  = $FFC6;
//   KERNAL_CHKOUT = $FFC9;
//   KERNAL_CLRCHN = $FFCC;
//   KERNAL_CHRIN  = $FFCF;
//   KERNAL_CHROUT = $FFD2;
//   KERNAL_LOAD   = $FFD5;
//   KERNAL_READST = $FE07;

program seriel;

var 
  i : byte;
  
  num  : word absolute $fb;
  ascii : byte absolute $fd;

procedure seriell_open(); assembler;
asm {
   num = $fb
 
   lda #2
   ldx #<(num)
     ldy #>(num)
   jsr $ffbd          
   lda #$02
   ldx #$02
   ldy #$00
   jsr $ffba            
   jsr $ffc0           
 };
end;
 
procedure send(); assembler;
asm { 
   buffer = $fd
   
   ldx #$02
   jsr $ffc9
   lda #$00
   ldx buffer
   txa
   jsr $ffd2 
   jsr $ffcc
};
end;

procedure seriell_close(); assembler;
asm { 
   lda #$02  
   jsr $ffc3
};
end;

begin  
    poke($fb,10);
    poke($fc,0);
    seriell_open;
    
    pause;
   
    for i:=64 to 90 do begin
        ascii:=i;
      pause;
      send;
      end; 
    
    pause;
    seriell_close;
end.
Edited by funkheld
Link to comment
Share on other sites

hello, this is open , send , empfang , close mit madpas for c64.

 

greeting

 

seriell_send  to A - Z , 2400baud :

 


//   KERNAL_SETLFS = $FFBA;
//   KERNAL_SETNAM = $FFBD;
//   KERNAL_OPEN   = $FFC0;
//   KERNAL_CLOSE  = $FFC3;
//   KERNAL_CHKIN  = $FFC6;
//   KERNAL_CHKOUT = $FFC9;
//   KERNAL_CLRCHN = $FFCC;
//   KERNAL_CHRIN  = $FFCF;
//   KERNAL_CHROUT = $FFD2;
//   KERNAL_LOAD   = $FFD5;
//   KERNAL_READST = $FE07;

program seriel;

var 
  i,z : byte;
  
  num  : word absolute $fb;
  ascii : byte absolute $fd;

procedure seriell_open(); assembler;
asm {
   num = $fb
 
   lda #2
   ldx #<(num)
     ldy #>(num)
   jsr $ffbd          
   lda #$02
   ldx #$02
   ldy #$00
   jsr $ffba            
   jsr $ffc0           
 };
end;
 
procedure seriell_send(); assembler;
asm { 
   buffer = $fd
   
   ldx #$02
   jsr $ffc9
   lda #$00
   ldx buffer
   txa
   jsr $ffd2 
   jsr $ffcc
};
end;

procedure seriell_empfang(); assembler;
asm { 
    buffer = $fd
   
    jsr $ffcc
    ldx #$02
    jsr $ffc6
    bcs error
    jsr $ffcf
    tax
    jsr $fe07
    cmp #$00
    bne error
    stx buffer
    jsr $ffcc  
error:
 };
 end;

procedure seriell_close(); assembler;
asm { 
   lda #$02  
   jsr $ffc3
};
end;

begin  
    poke($fb,10);
    poke($fc,0);
    seriell_open;
    pause;
    
    while True do begin
    
      for i:=1 to 26 do begin
          ascii:=i;
        for z:=0 to 30 do begin
         pause;
        end; 
        seriell_send;
        end;
      
      end; 
    
    pause;
    seriell_close;
end.

 

seriell_empfang A - Z , 2400baud :

char is the screen adresse $0400

 


 

//   KERNAL_SETLFS = $FFBA;
//   KERNAL_SETNAM = $FFBD;
//   KERNAL_OPEN   = $FFC0;
//   KERNAL_CLOSE  = $FFC3;
//   KERNAL_CHKIN  = $FFC6;
//   KERNAL_CHKOUT = $FFC9;
//   KERNAL_CLRCHN = $FFCC;
//   KERNAL_CHRIN  = $FFCF;
//   KERNAL_CHROUT = $FFD2;
//   KERNAL_LOAD   = $FFD5;
//   KERNAL_READST = $FE07;

program seriel;

var 
  i : byte;
  
  num  : word absolute $fb;
  ascii : byte absolute $fd;

procedure seriell_open(); assembler;
asm {
   num = $fb
 
   lda #2
   ldx #<(num)
     ldy #>(num)
   jsr $ffbd          
   lda #$02
   ldx #$02
   ldy #$00
   jsr $ffba            
   jsr $ffc0           
 };
end;
 
procedure seriell_send(); assembler;
asm { 
   buffer = $fd
   
   ldx #$02
   jsr $ffc9
   lda #$00
   ldx buffer
   txa
   jsr $ffd2 
   jsr $ffcc
};
end;

procedure seriell_empfang(); assembler;
asm { 
    buffer = $fd
   
    jsr $ffcc
    ldx #$02
    jsr $ffc6
    bcs error
    jsr $ffcf
    tax
    jsr $fe07
    cmp #$00
    bne error
    stx buffer
    jsr $ffcc  
error:
 };
 end;

procedure seriell_close(); assembler;
asm { 
   lda #$02  
   jsr $ffc3
};
end;

begin  
    poke($fb,10);
    poke($fc,0);
    seriell_open;
    pause;
    
    while True do begin
      seriell_empfang;
      pause;
        poke($0400,ascii);
      end; 
    
    pause;
    seriell_close;
end.

 

send-empfang.jpg

Edited by funkheld
Link to comment
Share on other sites



Syntax: mp <inputfile> [options]
-diag           Diagnostics mode
-define:symbol  Defines the symbol
-ipath:<x>      Add <x> to include path
-target:<x>     Target system: a8 (default), c64, c4p
-code:address   Code origin hex address
-data:address   Data origin hex address
-stack:address  Software stack hex address (size = 64 bytes)
-zpage:address  Variables on the zero page hex address (size = 26 bytes)

[code]

 

-code 2000

Link to comment
Share on other sites

@tebe BIG THX for resource implementation for C64/C+4.

 

Below example code which shows mutlipaint multicolour gfx on Plus/4.

 

gfx.rc

TRON_TITLE_SCREEN rcdata 'tron.prg' 2

main.pas

{$r gfx.rc}

const
  TRON_TITLE_SCREEN = $5800;

var
  SETBITMAP                          : byte absolute $ff06;
  SETMCOLOR                          : byte absolute $ff07;
  BITMAPADDR                         : byte absolute $ff12;
  VIDEOMATRIX                        : byte absolute $ff14;
  BACKGROUND                         : byte absolute $ff15;
  COLOUR1                            : byte absolute $ff16;
  BORDER                             : byte absolute $ff19;

begin
  SETBITMAP := SETBITMAP or $20;
  SETMCOLOR := (SETMCOLOR and $40) or $18;

  // (01011xxx) $5800 = 11 * $800;
  VIDEOMATRIX := %01011000;
  // (xx011xxx) $6000 = 3 * $2000; bit 2 set to 0 means reading from RAM
  BITMAPADDR := %00011000 or (BITMAPADDR and %00000011);

  BORDER := 0;
  BACKGROUND := 0;
  COLOUR1 := 1;

  repeat until false;
end.

Screenshot_2021-03-16_16-43-25.thumb.png.05d3a8ebad0aa8db85d97c362b7f024e.png

 

GFX made by Carrion.

Edited by zbyti
gfx author
  • Like 2
Link to comment
Share on other sites

How to play TEDzakker tunes?

 

msx.rc

MUSIC rcdata 'demo.tzp.prg' 2

music-irq.pas

 

{$r msx.rc}

// TEDzakker demo music

const
  MUSIC = $4000;


var
  DETIRQSRC                          : byte absolute $ff09;  //detect IRQ source, and clear IRQ flag
  SETIRQSRC                          : byte absolute $ff0a;  //set IRQ source
  RC                                 : byte absolute $ff0b;  //raser counter bits 0-7
  BACKGROUND                         : byte absolute $ff15;
  BORDER                             : byte absolute $ff19;
  VCOUNT                             : byte absolute $ff1d;  //vertical line bits 0-7
  IRQVEC                             : word absolute $fffe;


procedure myRasterIrq; assembler; interrupt;
asm {
  phr

  lda DETIRQSRC \ sta DETIRQSRC

  inc BORDER;
  jsr $4003;
  dec BORDER;

  plr
};
end;

begin
  pause;

  asm {
    sei
    sta $ff3f
    phr \ lda #0 \ jsr $4000 \ plr
  };

  RC := 4; SETIRQSRC := 2;
  DETIRQSRC := DETIRQSRC and %01111111;

  IRQVEC := word(@myRasterIrq);

  asm { cli };

  repeat until false;
end.

or simply:

{$r msx.rc}

// TEDzakker demo music

const
  MUSIC = $4000;

begin
  asm { phr \ lda #0 \ jsr MUSIC \ plr };

  repeat
    pause;
    asm { phr \ jsr MUSIC+3 \ plr };
  until false;
end.

Edited by zbyti
subtune
Link to comment
Share on other sites

25 minutes ago, danwinslow said:

 I keep looking at this thread thinking I'll see something cool for atari with MP but, nope...

Solution is very simple :P If you want to see something fancy for Atari and Mad Pascal take your time and write something cool. I don't remember I learn something from your code, where I can find your wisdom?

 

I am trying present newbies Mad Pascal syntax with simple examples not Atari hardware specific code.

 

If you were more careful, you would have noticed that I present new Mad Pascal resource feature: offset for resources :P

 

---

 

Ok. Enough of this, I don't need to waste my time to pass the knowledge on to others, I can keep it for myself.

 

over :]

Edited by zbyti
typo
Link to comment
Share on other sites

51 minutes ago, zbyti said:

Ok. Enough of this, I don't need to waste my time to pass the knowledge on to others, I can keep it for myself.

What a dumb attitude... hopefully you are sharing and promoting Mad Pascal stuff in a Commodore forum somewhere and all power to you if you are.

 

But were we to trot over there and post VBXE examples I image we'd get a lukewarm response.

Edited by Wrathchild
  • Like 2
Link to comment
Share on other sites

Now now, don't get your feathers ruffled and start calling us 'not programmers'. I've been programming my whole life. Programmers are almost always fanatics of one sort or another. I was just saying that it's very common for people to not like a bunch of off-the-forum topic posting, especially since there *is* a forum here for the subject. You can do what you want.

  • Like 1
Link to comment
Share on other sites

hello zbyti.

 

Thanks for your new work for the new plus4 demos.
Wonderful how you can do that.


have already learned a lot.

what I'm looking for is a key query, which key was pressed,
which works in plus4.

i can already receive data for rs232 from plus4.

Thank you.
greeting

Link to comment
Share on other sites

  • 2 weeks later...

@Gury beware, some part of this documentation is useful on other 8-bit platforms too!

 

I asked someone for help in English documentation but I can't see any progress. As far as I know Polish documentation is up to date and covers new features added by @tebe. Your contribution is also significant, I like your games examples :]

 

But In this thread I see guys who not contribute to the language but have contribution to my enthusiasm :P You know... Every time they see example not for Atari little panda dies :D

Edited by zbyti
Polish
  • Thanks 1
  • Sad 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...