This commit is contained in:
Irmen de Jong
2025-09-02 00:42:46 +02:00
parent 28df08eea8
commit 52a757ea78
2 changed files with 8 additions and 4 deletions

View File

@@ -59,10 +59,10 @@ STRUCTS and TYPED POINTERS (6502 codegen specific)
- implement the remaining TODO's in PointerAssignmentsGen.
- fix code size regressions (if any left)
- update structpointers.rst docs with 6502 specific things?
- 6502: optimize deref() to not always add the field offset to the pointer value but using it in the Y register instead
- 6502: optimize operatorDereference() to not always add the field offset to the pointer value but using it in the Y register instead
- 6502 and IR: optimize deref() and operatorDereference() when field offset is 0, don't use a temporary at all if the var is in zp already (maybe already solved by the previous one?)
- optimize operatorDereference() (deref() too?) so that it doesn't load a pointer in AY and then use ADC to add the field offset
- 6502: optimize deref() to not always add the field offset to the pointer value but using it in the Y register instead (DONE?)
- 6502: optimize operatorDereference() to not always add the field offset to the pointer value but using it in the Y register instead (DONE?)
- 6502 and IR: optimize deref() and operatorDereference() when field offset is 0, don't use a temporary at all if the var is in zp already (DONE?)
- optimize operatorDereference() (deref() too?) so that it doesn't load a pointer in AY and then use ADC to add the field offset (DONE?)
- optimize the float copying in assignIndexedPointer() (also word?)
- implement some more struct instance assignments (via memcopy) in CodeDesugarer (see the TODO) (add to documentation as well, paragraph 'Structs')
- try to optimize pointer arithmetic used in peek/poke a bit more so the routines in sorting module can use typed pointers without increasing code size, see test.p8 in commit d394dc1e

View File

@@ -2,6 +2,10 @@
; This is NOT necessarily the most efficient or idiomatic Prog8 way to do this!
; But it is just an example for how you could allocate and use structs dynamically.
; It uses a linked list to store all active particles.
; NOTE: this example uses the X16's kernal graphics routines to plot the pixels.
; those are relatively slow, and the program will run a lot faster if you use
; the gfx_lores or monogfx prog8 library instead. However those increase the
; PRG size by a lot because they embed a large multiplication lookup table.
%import math