News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

How is the address of: symbol_data and symbol_buffer determined at ccz80 ++ so I

Started by cpcuser, 19:54, 15 November 16

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

cpcuser


How is the address of: symbol_data and symbol_buffer determined at ccz80 ++ so I can pass the?




thank you.
greeting



include Indirections6128.ccz80++
include GameScreen.ccz80++
include GameSprite.ccz80++
include Text.ccz80++
include sym.ccz80++


class Test
{
  static void main()
  {
   static short symbol_data[] = { 0, 56, 64, 64, 48, 8, 8, 112 ,255, 129,129,129,129,129,129,255 };
   short symbol_buffer[1128];
     
     sym.symbolafter(115, symbol_buffer);


    sym.symbol(115, symbol_data);
    sym.symbol(116, symbol_data+8);
     
   Text.PrintString("\n\ra s t");
           
  }
}





sym.ccz80

class sym
{
  public static void symbol(short argument1, int argument2)
    asm (Indirections.Values())
    {
       ld   hl,2
       add  hl,sp
       ld   e,(hl)
       inc  hl
       ld   d,(hl)                             ; DE = 2nd parameter",
       inc  hl
       inc  hl
       ld   a,(hl)                             ; A = 1st parameter",
       ex   de,hl                              ; HL = 2nd parameter",
       jp   __txt_set_matrix
    }
     
  public static void symbolafter(short argument1, int argument2)
    asm (Indirections.Values())
    {
      ld   hl,2
      add  hl,sp
      ld   e,(hl)
      inc  hl
      ld   d,(hl)                             ; DE = 2nd parameter",
      inc  hl
      inc  hl
      ld   l,(hl)
      ld   h,0                                ; HL = 1st parameter",
      ex   de,hl                              ; E =first character to change, HL = table address",
      jp   __txt_set_m_table
    }
   }   
   

arnoldemu

does ccz80 output a listing (.lst) or a map file (.map)?

I don't think "symbol_buffer" will have an address. You defined it inside the function, I think it will be stored on the stack.

symbol data is "static" so it should have an address.


For C, the common way is to take label and add __.

e.g.

static char *buffer;

is __buffer in map/listing file and you can use this name in asm.

For ccz80, I don't know. C++ on normal compilers adds lots of "decoration" with @ etc with parameters and things.

Map file will tell you the names and if they can be used.

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Powered by SMFPacks Menu Editor Mod