Shop OBEX P1 Docs P2 Docs Learn Events
FlexProp: a complete programming system for P2 (and P1) - Page 56 — Parallax Forums

FlexProp: a complete programming system for P2 (and P1)

1505152535456»

Comments

  • pik33pik33 Posts: 2,402

    However, my Basic interpreter doesn't compile with 7.0.0 The error reported is

    ffunicode.c:15565: error: bad cast of cvt1

    ?????

  • pik33pik33 Posts: 2,402
    edited 2025-01-24 10:24

    FlexBasic also accepts recv. So I prepared getchar() function that waits for a keypress and returns an ASCII code.

    Then this "program" in bf:

    +[,.]

    prints on the screen a character that was pressed.

  • pik33pik33 Posts: 2,402

    @pik33 said:
    However, my Basic interpreter doesn't compile with 7.0.0 The error reported is

    ffunicode.c:15565: error: bad cast of cvt1

    ?????

    I edited the line 15565 of ffunicode.c to

    p = uc < 0x1000 ? (WORD*) cvt1 : (WORD *) cvt2;

    Now it compiles. However I don't know if this is a proper way to correct this and why the C compiler cannot do the assign without a manual added cast.

  • ersmithersmith Posts: 6,102

    @pik33 said:
    However, my Basic interpreter doesn't compile with 7.0.0 The error reported is

    ffunicode.c:15565: error: bad cast of cvt1

    ?????

    Aargh, that's a new bug in the ?: parsing code. It's fixed in github now, but your work-around of adding explicit casts is a good one.

  • RaymanRayman Posts: 14,865

    @ersmith Can you do muldiv64 in C? Not seeing it... Maybe need to include a helper.spin2 type object in C to get that?

  • ersmithersmith Posts: 6,102

    @Rayman said:
    @ersmith Can you do muldiv64 in C? Not seeing it... Maybe need to include a helper.spin2 type object in C to get that?

    unsigned _muldiv64(unsigned m1, unsigned m2, unsigned d);
    

    It doesn't seem to be documented, I need to update the docs.

Sign In or Register to comment.