3b8c906d75
Store ASM-FUNCTIONs in a hash table keyed on name
...
TODO: Populate the table based on the asm source code declaration
comments and signal an error when a named function is missing.
2025-07-03 16:51:47 +02:00
094f01d258
Ensure IBLOCK names are unique
2025-07-03 15:59:41 +02:00
7171398c07
Fix broken IR graph flow with merge iblocks
2025-07-03 15:58:56 +02:00
235ca8c07e
Rename EMIT-STORE-RESULT's parameter to match similar functions
2025-07-03 10:54:21 +02:00
54d2341ce3
Add code-generator.lisp to ASD
2025-07-03 10:30:14 +02:00
f1cf8ad488
Add alexandria dependency
2025-07-03 10:30:14 +02:00
4899d888aa
Add COMPILE-IR method for IR-RETURN
2025-07-03 10:30:14 +02:00
c41fb46457
Make assembly program representation smarter
...
Storing assembly instructions in a list felt nice since that lets me
just fire and forget, but if we want to properly optimize short
branches (i.e. branches that do not require a full JMP) we'll need to
be able to rewrite assembly after linking, and I feel that's best done
by making assembly instructions hold a NEXT rather than poking at a
list clumsily.
The first linking pass was also moved out to a separate function since
we may want to run the first pass twice, first after the initial
assembling and second after expanding optimistic short branches (those
that turned out to be longer branches than 127/128 bytes) into a long
branch snippet (branch with inverted condition skipping over a JMP).
2025-07-03 10:30:14 +02:00
hugova
0ceb455031
Add more more minute optimisations of circle draw
2025-07-02 02:15:06 +02:00
hugova
0ed8359f66
more minute optimisations of circle draw
2025-07-02 01:17:08 +02:00
hugova
913a6ba072
optimize circle draw (more code cleanup)
2025-07-02 00:45:41 +02:00
hugova
5bb62aed88
optimise circle using lookup table
2025-07-01 23:49:35 +02:00
7d55bc9ed8
Add extremely unfinished 6502 code generator to user-side compiler
2025-07-01 23:12:20 +02:00
f8f5892d98
Somewhat clunky optimization for reusing temporary variable slots
2025-07-01 20:39:09 +02:00
hugova
3f470688a4
make line drawing slightly faster, and make it a bit smaller
2025-07-01 20:11:18 +02:00
hugova
e0314e8530
added more extensive testing on circle draw and found a bug that depends on the circle x-pos
2025-07-01 15:16:59 +02:00
hugova
5f1558ce22
fix circle issues by adding propper offsets to circle half quarters.
2025-07-01 14:47:30 +02:00
a18c13a86e
Add value allocator (typically called register allocator)
...
It's unfinished and doesn't optimize space used by temporary
variables. Every temporary gets its own memory slot right now.
2025-07-01 13:38:31 +02:00
bdb2a901ca
Add more optimization passes to a test snippet
2025-07-01 13:27:24 +02:00
7aff9db800
Add compiler optimization to get rid of IR-FETCHVARs when unneeded
...
It replaces the IR-FETCHVAR's result with the variable being
fetched. This only works when the only use is in an operation that
does not require a separate fetch be performed, such as those
implemented as CPU instructions.
2025-07-01 13:25:42 +02:00
b7c4a37483
Make data keep track of their last use
2025-07-01 13:22:24 +02:00
hugova
c1846e35bd
add more circle testing and remove none working offsets
2025-07-01 01:19:21 +02:00
hugova
7196992043
Add last part to circle, still a bit buggy
2025-07-01 00:06:04 +02:00
hugova
6c962befa2
optimise circle draw by redusing instructions
2025-06-30 23:41:55 +02:00
hugova
ba2db967c4
use unsafe flag in macros to make circle draw faster
2025-06-30 23:09:14 +02:00
hugova
bdca0cd82a
Do some renaming and change the code structure for circle-draw
2025-06-30 22:18:45 +02:00
hugova
fd587ea440
do some code cleanup (still ugly) in circle drawing code
2025-06-30 21:38:13 +02:00
hugova
55ab7e367d
add more parts of circle now 7/8 of them renders (though buggy looking)
2025-06-30 21:15:29 +02:00
hugova
e01684254f
add other parts of circle. Now 6/8 of the circle renders. (A bit buggy looking)
2025-06-29 18:50:35 +02:00
hugova
7a50de832e
remove duplicate code for circle_draw
2025-06-29 15:22:30 +02:00
hugova
c4add9a62c
draw 1/2 of circle by circle-help-subroutine
2025-06-29 13:12:01 +02:00
hugova
219f8c155d
Optimization by redusing 2 compare operations (now other part of circle is renderd but still 1/4 of it is renderd.)
2025-06-29 10:36:50 +02:00
hugova
c5b0d5f64b
Remove set flag instruction to optimize circledraw from 5846 to 5640 cpu cycles
2025-06-29 10:23:41 +02:00
hugova
b7f04d1fcb
make circledraw faster by using lookup table
2025-06-29 02:51:34 +02:00
hugova
380728a80a
add another part of the circle. now 1/4 circle done
2025-06-29 02:04:08 +02:00
hugova
c2a5af481f
rewrote the circle code to use relative position for pixel draw. This made it 2 orders of magnitudes faster!
2025-06-28 22:25:55 +02:00
hugova
484bafa828
Fix quartercircle offset isse (before the circle had the offset (0,0) always!)
2025-06-28 21:10:59 +02:00
hugova
363e3907ff
Fix circle-code (wip) Now the test renders the forth quarter of a circle!
2025-06-28 21:05:25 +02:00
hugova
50a17ad691
rewrote circle code (still not working)
2025-06-28 20:53:39 +02:00
hugova
07e12696e5
Fix bugg where screen do not properly clear on startup
2025-06-28 20:14:22 +02:00
hugova
846d792aee
Add extended testing of pixel_draw and fix a pixel_draw bugg (error of max 8px)
2025-06-28 20:12:58 +02:00
hugova
d691d692b9
more pritty circle bugs
2025-06-26 22:38:11 +02:00
hugova
8b955a5007
very cool but not working circle.
2025-06-26 22:05:08 +02:00
9e643e6c6d
Add compiler middle stage
...
The compiler middle stage takes high level nodes and produces code in
an intermediate representation more closely resembling assembly code.
Optimizations and the tools for making those are also included. It's
significantly easier to optimize IR than syntax trees or assembly.
Several things need cleaning up, in particular there are things in
jigs.lisp that really should be documented tools, not
jigs (specifically the compilation setup and finalization).
2025-06-26 13:41:43 +02:00
7703c71141
Add tool for quickly defining common PRINT-OBJECT methods
2025-06-26 12:44:43 +02:00
2c529c368a
Reorder parsing so calls get properly parsed inside expressions
2025-06-21 21:04:26 +02:00
4011e3b0db
Reorder loading of high-level.lisp
2025-06-21 21:02:58 +02:00
61ea8b3773
Move NODE-CONDITIONAL definition to proper place
2025-06-19 15:07:23 +02:00
2b94745734
Some little cleanup
2025-06-13 09:19:00 +02:00
928cdfd318
Add user-side compiler's parser
...
It ingests tokens via a "token stream", and feeds out a node
tree. It's a mostly handwritten recursive descent parser with the
occasional Lisp macros for convenience.
2025-05-22 13:14:55 +02:00