Commit Graph

56 Commits

Author SHA1 Message Date
Irmen de Jong
2e37f5dee3 IR: support for multi-returnvalue function calls (asmsubs)
note: the VM can't execute these though as it has no CPU hardware registers
2024-03-23 00:30:17 +01:00
Irmen de Jong
4db4a5f1b2 vm: txt.width() and height() now return the actual console terminal width and height if possible. 2024-03-16 22:40:08 +01:00
Irmen de Jong
5a0524ff4d various fixes 2024-03-16 18:48:06 +01:00
Irmen de Jong
3a9919a377 implemented a couple more diskio routines for the VM target 2024-03-09 17:36:39 +01:00
Irmen de Jong
bdfb01f6a0 VM: implemented a few core routines in diskio (load/save)
textelite can now load and save your progress like it already could in the real version
2024-03-06 23:21:01 +01:00
Irmen de Jong
88458f5355 faster array copy and fix for length 256 2024-02-11 23:57:38 +01:00
Irmen de Jong
d7f72056fc rest of the array copying 2024-02-10 17:16:06 +01:00
Irmen de Jong
6eacf1bddd added a few more IR syscalls for often used copy routines 2024-02-09 23:56:44 +01:00
Irmen de Jong
0a356ba73a added containment check of float arrays 2024-01-14 14:14:09 +01:00
Irmen de Jong
d91ca8b197 vm: added floats.str_f() 2023-12-07 23:10:27 +01:00
Irmen de Jong
ee782e92ac fix cast error and vm float parsing 2023-12-05 22:51:15 +01:00
Irmen de Jong
1509de390e various fixes
print_f() no longer prints a leading space.
Better error message if using float in for loop.
Fix crash when using non-const as when choice value.
VM print_f() more closely resembles the CBM version.
2023-12-02 18:23:54 +01:00
Irmen de Jong
af5ca2d0b8 vm: treat floats as 64 bits doubles. 0.0 printed as "0". 2023-11-21 00:57:56 +01:00
Irmen de Jong
cd40088636 vm: added math.mul16_last_upper() 2023-09-28 03:18:49 +02:00
Irmen de Jong
77f3852cdc added floats.parse_f() 2023-08-16 14:47:20 +02:00
Irmen de Jong
fea297e409 cleanup some compilation warnings 2023-07-22 23:44:26 +02:00
Irmen de Jong
90c4b00f74 ir: fix any() all() reverse() sort() on memory mapped arrays and on byte arrays 2023-07-07 17:25:32 +02:00
Irmen de Jong
02e51d8282 ir: fix initial chunk linking 2023-07-07 00:30:56 +02:00
Irmen de Jong
ff7f3484e4 atan 2023-06-17 23:01:47 +02:00
Irmen de Jong
c0b398e0ce add various math.atan() routines 2023-06-17 00:43:33 +02:00
Irmen de Jong
b43223cb7a added clamp() builtin function and floats.clampf() 2023-05-17 23:12:58 +02:00
Irmen de Jong
905921a684 IR: new (sys)call instructions that encapsulate the full subroutine call
to fix the bugs resulting from nesting subroutine calls (as param to another call etc)
2023-05-14 15:20:25 +02:00
Irmen de Jong
efd7d6f0c0 tweak IR call args setting now via special SETPARAM instruction 2023-04-14 02:10:39 +02:00
Irmen de Jong
7c1d5cadd7 fix sort and reverse on strings on 6502 codegen 2023-04-10 19:33:24 +02:00
Irmen de Jong
dd1592b03b ir syscalls args via stack instead of fixed r65500+ 2023-04-10 18:02:37 +02:00
Irmen de Jong
9b37ac483f vm fix str to word conversion
ir SYSCALL puts result(s) on value stack,  instead of on hardcoded r0, r1
2023-04-10 16:26:42 +02:00
Irmen de Jong
92a07b87d2 clearer 2023-02-20 02:32:36 +01:00
Irmen de Jong
5d4bfffc7e float.rndseedf() now takes float seed value and is consistent for all CBM compilation targets 2022-11-06 22:53:57 +01:00
Irmen de Jong
38efaae7b2 ir/vm: syscall params in high base register to avoid push/pop 2022-11-06 12:52:09 +01:00
Irmen de Jong
469e042216 vm: replaced prog8_lib.string_compare and others with syscalls 2022-11-04 23:12:13 +01:00
Irmen de Jong
0f1a4b9d8f fixed certain type check error when passing boolean value to ubyte function parameter
fixed virtual machine string comparison syscall
2022-11-03 23:06:03 +01:00
Irmen de Jong
00afa1ce52 ir: replace RND opcode by syscalls 2022-10-22 17:20:46 +02:00
Irmen de Jong
ec5adffdc2 rnd()/rndf() routines can now be seeded with new rndseed()/rndseedf() routines. fixes #80 2022-10-22 13:34:22 +02:00
Irmen de Jong
7b722a0001 ir: fix count register uses 2022-10-04 00:25:55 +02:00
Irmen de Jong
dda19c29fe vm: fix symbols to be case sensitive properly in p8virt assembler 2022-09-25 15:51:50 +02:00
Irmen de Jong
00b717cde8 tweak 2022-08-04 18:35:10 +02:00
Irmen de Jong
cc41218d37 added nicer vm example 2022-07-03 00:41:04 +02:00
Irmen de Jong
ba614801ee cleanup 2022-05-22 23:11:22 +02:00
Irmen de Jong
4dc9b45297 vm: fixed string comparisons, added missing vm string module 2022-05-13 23:10:13 +02:00
Irmen de Jong
da01a5b4dc vm: implement float to integer cast, any, all, reverse 2022-05-04 22:08:21 +02:00
Irmen de Jong
86cc2f1075 vm: implementing more fp instructions 2022-05-02 21:06:14 +02:00
Irmen de Jong
b32641db87 remove syscall() builtin functions
vm code can do this via inline assembly
2022-05-01 00:41:30 +02:00
Irmen de Jong
7844ace934 vm: implementing floating-point 2022-04-29 22:27:02 +02:00
Irmen de Jong
625d5b2313 vm: some preparations for floating point 2022-04-26 21:08:32 +02:00
Irmen de Jong
ee36d47c27 vm: added cmp() and most of the status-branch instructions 2022-04-18 19:59:48 +02:00
Irmen de Jong
349e5a15e9 min/max give proper error for string args
als implmented more vm builtin functions/syscalls
2022-04-13 23:09:25 +02:00
Irmen de Jong
bf7f4bba7b doc 2022-04-13 20:43:07 +02:00
Irmen de Jong
51bf33040a vm: add many builtin functions 2022-04-11 22:39:33 +02:00
Irmen de Jong
a8cf9f5cc4 vm: syscalls can now return value 2022-04-05 20:46:34 +02:00
Irmen de Jong
8e4c0f7c22 vm: add sorting and reverse functions, fix value arg out of range errors 2022-04-05 17:48:49 +02:00