Jump to content
IGNORED

Mad Pascal


Recommended Posts

i have not yet understood the relationship between the colors in multicolor mode.

 

 

have you ever seen why one of my programs is not running on the yape?
how do you know that yape is better than winvice?
what test experience did you have?

 

Thank you.

 

Edited by funkheld
Link to comment
Share on other sites

Another C+4 simple example (can be easy converted to A8) for beginners.

 

const
  ATTRIBUTE_ADDR = $0800; SCREEN_ADDR = $0c00; OFFSET = SCREEN_ADDR - ATTRIBUTE_ADDR;
  CHARSET = $d000; EMPTY = $20;

var
  BACKGROUND                         : byte absolute $ff15;
  BOREDER                            : byte absolute $ff19;

//-----------------------------------------------------------------------------

procedure printBigCharXY(x, y, ch, c: byte);
var
  curPoint, charRow     : word;
  tmp, i0b, i1b         : byte;
begin
  curPoint := SCREEN_ADDR + x + (y * 40);
  charRow := CHARSET + (8 * ch);

  for i0b := 0 to 7 do begin
    tmp := Peek(charRow + i0b);
    for i1b := 7 downto 0 do begin
      if (tmp and 1) = 1 then begin
        poke(curPoint + i1b, $a0);
        poke(curPoint - OFFSET + i1b, c);
      end;
      tmp := tmp shr 1;
    end;
    Inc(curPoint,40);
  end;
end;

//-----------------------------------------------------------------------------

procedure printBigXY(x, y, c: byte; s: string);
var
  i0b : byte;
begin
  for i0b := 1 to length(s) do printBigCharXY(x + (8 * (i0b - 1)), y, ord(s[i0b]), c);
end;

//-----------------------------------------------------------------------------

begin

  FillChar(pointer(SCREEN_ADDR), 24 * 40, EMPTY);
  FillChar(pointer(ATTRIBUTE_ADDR), 24 * 40, 0);

  printBigXY(3, 3, $11, 'tron'~);
  printBigXY(11, 12, $11, '+4'~);

  repeat until false;

end.

Screenshot_2021-02-27_12-24-21.thumb.png.59b5820dc4c3cdfac457c6793347a5a5.png

Edited by zbyti
add screen
  • Like 1
Link to comment
Share on other sites

From changelog

Quote

02/23/2021
- added PETSCII character conversion for strings ended with ''~

About fill ATTRIBUTE_ADDR area... Its a part of my screen init routine. C+4 have screen memory and colour map.

 

Stop asking so much questions, as always I recommend to read documentation for Mad Pascal and microcomputer are you now interested in.

Edited by zbyti
typo
Link to comment
Share on other sites

Hello Mad Pascal Community,

 

in my project i'd like to - at some certain conditions, for initialization purposes - start another binary located on the disk; like a binary load. 

Could this be done easily in Mad Pascal?

 

Currently i'm using the xBootDos by @XXL, which by description should support such a call - like XIO 40, #1,0,0,"D:FILE.EXE" 

(btw, thx again for xBootDOS, gives me so much RAM i don't have to despair :) )

 

Best regards to everybody -   and thank you very much @TeBe for that great great compiler!

 

Link to comment
Share on other sites

hello, good day you specialist.

 

I'll try the c64 and madpascal.
have a first problem with this asm:
can you please do the procedure with data transfer for me
madpascal?

I can then use them later as a procedure sample.

Thank you.


please transfer data to the asm procedure:
befehl:  !byte 10,0
puffer:  !byte 0

------------------------------------
madpascal-procedure:
asm:
    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

waitforchar:
    lda $029d
    cmp $029e
    bne waitforchar
    ldx #50

loop:
    jsr $eeb3  
    dex
    bne loop

    lda #2
    jsr $ffc3

end-asm
-------------------------------------

Edited by funkheld
Link to comment
Share on other sites

DIY

 

if you see:

    lda #2
    ldx #2
    ldy #0
    jsr $ffba

you can write:

procedure someCall(a ,x, y : byte); assembler;
asm {
  lda a
  ldx x
  ldy y
  jsr $ffba
};
end;

for lda/sta use poke, or poke and peek, or absolute variables.

 

for branch instructions use pascal loops with proper conditions or if/else statement.

 

and so on...

Edited by zbyti
typo
Link to comment
Share on other sites

On 3/3/2021 at 4:39 PM, Atlan_Roland said:

Hello Mad Pascal Community,

 

in my project i'd like to - at some certain conditions, for initialization purposes - start another binary located on the disk; like a binary load. 

Could this be done easily in Mad Pascal?

 

Currently i'm using the xBootDos by @XXL, which by description should support such a call - like XIO 40, #1,0,0,"D:FILE.EXE" 

(btw, thx again for xBootDOS, gives me so much RAM i don't have to despair :) )

 

Best regards to everybody -   and thank you very much @TeBe for that great great compiler!

 

To answer my own question:


There actually is a XIO call procedure in MP, unit CIO !  

 

procedure XIO(cmd, chn, ax1, ax2: byte; device: PByte); assembler;

 

Thanks @Tebe :)

 

 

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...