2 Codegen for sm83 could generate an "ex de, hl" (a Z80 instruction not supported on SM83) when passing a struct as function argument while register hl holds another variable.
3 This would then result in an error message from the assembler.
8 #pragma disable_warning 85
10 #if !defined(__SDCC_pdk14) && !(defined(__SDCC_mcs51) && defined(__SDCC_MODEL_SMALL)) // Lack of memory
13 #define POINT_AMOUNT 14
14 #define SIDE_AMOUNT 22
23 void render(Point3D p1
, Point3D p2
)
29 unsigned int angles
[3] = {47, 10, 0};
30 const unsigned char sides
[][2] = {
54 Point3D points
[POINT_AMOUNT
] = {
55 {LINE_SIZE
, LINE_SIZE
, 0}, //0
56 {0, LINE_SIZE
, 0}, //1
57 {0, LINE_SIZE
, LINE_SIZE
}, //2
58 {LINE_SIZE
, LINE_SIZE
, LINE_SIZE
}, //3
59 {0, 0, LINE_SIZE
}, //4
60 {LINE_SIZE
, 0, LINE_SIZE
}, //5
61 {LINE_SIZE
, 0, 0}, //6
63 {LINE_SIZE
/ 4, 0, 0}, //8
64 {(LINE_SIZE
/ 4) + (LINE_SIZE
/4), 0, 0}, //9
65 {LINE_SIZE
/ 4, 0, LINE_SIZE
/2},//10
66 {(LINE_SIZE
/ 4) + (LINE_SIZE
/4), 0, LINE_SIZE
/2},//11
67 {(LINE_SIZE
/ 2), 0, LINE_SIZE
+ (LINE_SIZE
/2)}, //12
68 {(LINE_SIZE
/ 2), LINE_SIZE
, LINE_SIZE
+ (LINE_SIZE
/2)}}; //13
72 for (unsigned char i
= 0; i
< SIDE_AMOUNT
; i
++)
74 render(points
[sides
[i
][0]], points
[sides
[i
][1]]); // Invalid assembler instruction generated here.