User Activity

  • Modified a comment on ticket #1030 on Small Device C Compiler (SDCC)

    To compile the above C this could work struct MyObj { u8 lx; // Logical x u8 x0,x1,x2; // Physical x's in the 3 pages i16 ly; // Logical Y u16 y0,y1,y2; // Physical y's in the 3 pages u16 frame; i8 dx; // x direction i8 dy; // y direction }; #define TotDem (32) #define TotSprt (32+6) struct MyObj SwSprite[TotSprt]; void main() { SwSpPntr = &SwSprite[0]; for (u8 i=0; i<TotSprt;i++) { SwSpPntr->x1 = SwSpPntr->lx; SwSpPntr->y1 = SwSpPntr->ly; SwSpPntr++; } }

  • Posted a comment on ticket #1030 on Small Device C Compiler (SDCC)

    To compile the above C you need struct MyObj { u8 lx; // Logical x u8 x0,x1,x2; // Physical x's in the 3 pages i16 ly; // Logical Y u16 y0,y1,y2; // Physical y's in the 3 pages u16 frame; i8 dx; // x direction i8 dy; // y direction }; #define TotDem (32) #define TotSprt (32+6) struct MyObj SwSprite[TotSprt];

  • Posted a comment on ticket #1030 on Small Device C Compiler (SDCC)

    This is with current version 4.6, as you can see the issue is unchanged ;./AdrianLift.c:707: SwSpPntr = &SwSprite[0]; ld hl, #_SwSprite ld (_SwSpPntr), hl ;./AdrianLift.c:708: for (u8 i=0; i<TotSprt;i++) { ld c, #0x00 00143$: ld a, c sub a, #0x26 jr nc, 00112$ ;./AdrianLift.c:709: SwSpPntr->x1 = SwSpPntr->lx; ld de, (_SwSpPntr) inc de inc de ld hl, (_SwSpPntr) ld a, (hl) ld (de), a ;./AdrianLift.c:604: SwSpPntr->ly = (Field.ly + MyY ); ld hl, (_SwSpPntr) ;./AdrianLift.c:710: SwSpPntr->y1 = SwSpPntr->ly;...

  • Created ticket #1030 on Small Device C Compiler (SDCC)

    Pointers to struct

  • Posted a comment on ticket #452 on Small Device C Compiler (SDCC)

    For msxgl this could be a very useful function. It would simplify the configuration of projects and allow optimal size for the generated asm

  • Posted a comment on ticket #1018 on Small Device C Compiler (SDCC)

    And it would save also a register, as it would use onl A instead of HL

  • Modified a comment on ticket #984 on Small Device C Compiler (SDCC)

    Considering that n=5, you could also replace srl a by rra (saving 1 byte and some cycles). _gg:: ld b, #0x05 00103$: bit 0, a jr Z, 00102$ ld a, (de) ret 00102$: rra inc de djnz 00103$ ld a, b ret

  • Posted a comment on ticket #984 on Small Device C Compiler (SDCC)

    Consiering that n=5, you culd also replace srl a by rra. _gg:: ld b, #0x05 00103$: bit 0, a jr Z, 00102$ ld a, (de) ret 00102$: rra inc de djnz 00103$ ld a, b ret

View All

Personal Data

Username:
artrag
Joined:
2022-02-20 18:01:59.496000

Projects

  • No projects to display.

Personal Tools

MongoDB Logo MongoDB