1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-30 16:29:58 +00:00
Commit Graph

8428 Commits

Author SHA1 Message Date
Jesse Rosenstock
9858e47dfd Pad bit-fields only to the next byte
Fixes #1054.

Previously, bit-fields followed by another field were aligned
to two bytes.  Bit-fields ending the struct were (and continue
to be) aligned only to a single byte.

```
struct s {
  unsigned int x : 4;
};

struct t {
  unsigned int x : 4;
  unsigned int y;
};
```

Before: `sizeof(struct s) == 1`, sizeof(struct t) == 4`
After: `sizeof(struct s) == 1` sizeof(struct t) == 3`
2020-07-08 16:46:34 +02:00
Jesse Rosenstock
9e881a497e Fix formatting 2020-07-08 16:45:00 +02:00
Jesse Rosenstock
c273c90bf2 Fix formatting 2020-07-08 16:45:00 +02:00
Jesse Rosenstock
527df094ca Use xrealloc in cl65
Previously, xmalloc and xfree were used.
2020-07-08 16:45:00 +02:00
Jesse Rosenstock
416adbce82 Add blank line 2020-07-08 16:44:06 +02:00
Jesse Rosenstock
021362fb75 cl65: Remove temporary .o files 2020-07-08 16:44:06 +02:00
Greg King
410e4502ee Added a 160x192x2 TGI (graphics) driver to the VIC-20 library.
The driver requires a special linker configuration: "vic20-tgi.cfg".
The VIC-20 computer needs at least 8K of expansion RAM!

"tgidemo.c" needed to be adjusted because the VIC-20's vertical (y) range is greater than its horizontal (x) range -- the opposite of most other platforms.  Also, the circle demo would jam on the VIC-20.
2020-07-08 05:55:30 -04:00
mrdudz
d1833cc441 Fix handling of charcodes 254 and 255, fixes issue #988 2020-07-08 00:48:39 +02:00
acqn
539924249b More complete fix for Issue #1071. 2020-07-07 18:28:56 +02:00
acqn
286da30a26 Quick fix for Issue #1071. 2020-07-07 18:28:56 +02:00
Daniel Serpell
17c5504129 In Atari XEX output format, join memory areas if possible.
This makes executables shorter if two memory areas are consecutive.
2020-07-04 23:28:10 +02:00
Oliver Schmidt
0f8b587bc2 Added directory for currently failing regression tests. 2020-07-01 00:13:55 +02:00
Jesse Rosenstock
8891a896b5 test/ref: Use separate .out files
Use different .out files for different options / targets.
This allows make -j N to work.

Previously all test.*.*.prgs would use the same test.out file.
Now test.*.*.out is also used.
2020-06-29 22:34:44 +02:00
Jesse Rosenstock
d31171164e Fix formatting 2020-06-29 14:49:36 -04:00
Jesse Rosenstock
fae25bc459 CHECK we have at most a partial byte 2020-06-29 14:49:36 -04:00
Jesse Rosenstock
f4a6d08847 Fix full bytes vs full word in comment 2020-06-29 14:49:36 -04:00
Jesse Rosenstock
a00611798d Output bit-field data as chars instead of ints
This prepares for #1058, which will pad bit-fields only to
the next byte, instead of the next sizeof(int) (two bytes).

OutputBitFieldData now outputs chars instead of ints, and
calls to this function loop until there is less than one byte
to output.  A final partial byte is written out with zero padding
as a final partial int was previously.
2020-06-29 14:49:36 -04:00
Jesse Rosenstock
90d1c89bff
Allow overlap of bit-field storage units (#1055)
* Allow overlap of bit-field storage units

Previously,
struct s {
    unsigned int x : 10;
    unsigned int y : 10;
};
had sizeof(struct s) == 4.

With this change, allow the storage units of x and y to overlap,
so sizeof(struct s) == 3, with y stored immediately after x,
with no padding between them.

An int bit-field (the only type currently supported) will still
never occupy more than two bytes.

* ParseStructInit: Fix typo and expand comment

Explain why there are at most 30, not 32 bits.

* ParseStructDecl: Rewrite AddBitFieldCall

No behavior change.

Co-authored-by: Jesse Rosenstock <jmr@users.noreply.github.com>
2020-06-27 15:02:11 +02:00
Oliver Schmidt
5277ea0b73 Add test license description. 2020-06-27 02:23:40 +02:00
Jesse Rosenstock
18246278c5 switch2.c: Remove use of REFCC and UNSIGNED_CHARS
Explicitly use `signed char` or `unsigned char`, rather than
```

signed char k;
char k;

signed char k;
char k;
```
This should have resulted in the same thing; however, note that
`REFCC` was never defined, and `common.h` was not included, so
the old code in fact tested `char` then `unsigned char`,
which are the same.

The only difference is that a switch using plain `char` is not
tested, but since this is the same as either `signed char` or
`unsigned char`, the lack of test coverage seems relatively safe.
2020-06-25 13:18:08 +02:00
Jesse Rosenstock
8fe317e7fa Remove REFCC_UNSIGNED_CHARS from test/ref/
Explicitly use signed char or unsigned char for REFCC.
2020-06-25 13:18:08 +02:00
Jesse Rosenstock
86ba877a99 Define REFCC and REFCC_UNSIGNED_CHARS in reference
switch2.c uses these macros.  With them unset, signed chars
are not tested.
2020-06-25 13:18:08 +02:00
mrdudz
6e6ce4e5ee added various tests related to bug #1045 2020-06-23 00:46:12 +02:00
Dirk Jagdmann
aaecf3cfec replace JMP with BEQ to save 1 byte. 2020-06-22 23:55:45 +02:00
Dirk Jagdmann
3cbe485b94 fix description of Kerberos memory 2020-06-22 23:55:45 +02:00
Dirk Jagdmann
6465c3b687 change order of declarations. 2020-06-22 23:55:45 +02:00
Dirk Jagdmann
9227b0ccaf sort items 2020-06-22 23:55:45 +02:00
Dirk Jagdmann
def27ed4e2 change whitespace 2020-06-22 23:55:45 +02:00
Dirk Jagdmann
070264acc4 remove tab characters. 2020-06-22 23:55:45 +02:00
Dirk Jagdmann
ba79b2db9b add kerberos em driver variable. 2020-06-22 23:55:45 +02:00
Dirk Jagdmann
cb26766651 add C64 documentation 2020-06-22 23:55:45 +02:00
Dirk Jagdmann
76091b96d4 C64 Kerberos extended memory driver 2020-06-22 23:55:45 +02:00
acqn
e9307ce58e Moved test/ref/cc65141011.c to test/val/cc65141011.c. 2020-06-22 23:23:39 +02:00
acqn
8a166ac82f Fixed register usage tracking interfered by CE_SetArg. 2020-06-22 23:23:39 +02:00
acqn
2220c58f51 If the previous insn may be skipped, we cannot simply predict the output values of the registers. 2020-06-22 23:23:39 +02:00
acqn
53eb6a948d No more duplicated stores by Opt_tosshift which could result in worse optimizations. 2020-06-22 23:23:39 +02:00
acqn
49c5cfd65b Improved fix for Issues #167 and #784 and somehow #781. 2020-06-22 23:23:39 +02:00
acqn
48d3578c24 Fixed Issue #784. 2020-06-22 23:23:39 +02:00
acqn
b2268765bf The ref test cc65141011.c now passes. 2020-06-22 23:23:39 +02:00
acqn
a7a8426a90 Just keep Lhs loads in OptStackOps and leave them to OptUnusedLoads,
whilst Rhs loads must be removed for OptStackOps to work right.
Fixed Issue #167 as well as similar issues with tosshift.
2020-06-22 23:23:39 +02:00
Jesse Rosenstock
1c2edc5434 AddBitField: Rename Width arg to BitWidth
This makes the arg consistent with the SymEntry field name.
2020-06-21 01:08:44 +02:00
Jesse Rosenstock
4afc552e17 ParseStructDecl: Make BitOffs unsigned
This makes it consistent with SymEntry and removes the need for
some casts that were added to avoid warnings about signed vs
unsigned comparison.
2020-06-21 01:07:45 +02:00
Oliver Schmidt
37107174c6 Added waitvsync() for the Enhanced Apple //e.
The implementation is a bit tricky as it requires to take different code paths for the //e, the //c and the IIgs. Additionally the //c only provides a VBL IRQ flag supposed to be used by an IRQ handler to determine what triggered the IRQ. However, masking IRQs on the CPU, activating the VBL IRQ, clearing any pending VBL IRQs and then polling for the IRQ flag does the trick.
2020-06-18 21:44:57 +02:00
mrdudz
baa5d051e4 use same description as in the docs 2020-06-16 00:11:07 +02:00
mrdudz
349a84d972 remove superfluous TAB 2020-06-16 00:08:55 +02:00
mrdudz
98c7186221 Add description for --debug-opt-output to the --help output 2020-06-15 23:39:50 +02:00
Oliver Schmidt
e0a0b2dc25 Streamlined machine detection. 2020-06-15 19:31:18 +02:00
Oliver Schmidt
6adf175691 Optimized get_ostype() return values for asm usage.
Making sure that all but //c machines have bit 6 clear allows to use BIT/BVS to detect the //c machines.
2020-06-15 19:31:18 +02:00
Greg King
2acb3b153b Added some "See also" links to the TGI color-count descriptions. 2020-06-08 20:09:45 -04:00
Greg King
87144a15dd Fixed the "verbatim" tags in the TGI document. 2020-06-08 17:22:02 -04:00