2025-01-07 12:19:42 well, this is frustrating... as some of you know, I spent several days working on an interpreter for the Jupiter ACE flavour of Forth. That interpreter is now feature-complete, save for SAVE (sorry for the pun) which I will complete next. But... 2025-01-07 12:21:31 I need to validate the results, and typing on a real or emulated Juppy is cumbersome, and checking the results is prone to mistakes. So it occurred to me to write a JA emulator that traps the ROM line input and display output routines, and redirects them to a file. 2025-01-07 12:21:49 congratulations! that sounds sensible 2025-01-07 12:22:50 Now that emulator is written. It cost me about an hour to write. But... it does basically all that my interpreter does, just with 100% guaranteed accuracy. So it makes me wonder, why did I bother to write the interpreter in the first place? *facepalm* 2025-01-07 12:25:03 thanks xentrac 2025-01-07 12:28:54 Learning exercise I guess 2025-01-07 12:29:01 Or fun 2025-01-07 12:29:06 incidentally, I was quite surprised that the Z80 emulation core I'm using (jgz80) runs at about 8,5 real CPU cycles per Z80 cycle. So in my 3600 MHz machine it's a Z80 running at 425 MHz. 2025-01-07 12:29:12 Both sound cool to me either way 2025-01-07 12:29:51 My favourite Z80 emulator is what fuse (emulator) uses 2025-01-07 12:30:41 veltas: Yes, it was both, I give you that :) I got a much better understanding of indirect threading, for one. It also has two advantages, 1) it does not need to be compiled for every target machine, it just needs a Python interpreter; and 2) it does not need the ROM so no copyright issues 2025-01-07 12:30:45 I think 425MHz is a normal speed for interpreting machine code, so I'm assuming it interprets it rather than doing any JIT magic 2025-01-07 12:31:04 yeah, totally interpreted 2025-01-07 12:31:34 CPU's are so good that you still get >400MHz easily, which is really cool 2025-01-07 12:32:03 400MHz Z80 to take over the world lol 2025-01-07 12:34:04 I chose this core because it was announced to be fast, and because it turned out to be very simple - monolithic (only 1 header and 1 C file), written in C instead of C++, and just needs 4 callbacks (memory R/W and I/O) to get started. What are the advantages of fuse's core? 2025-01-07 12:35:15 fuse is very mature and runs damn well on even old hardware, all the new speccy emulators don't fit this bill 2025-01-07 12:35:39 But for sake of just the CPU emulation I wouldn't move away from jgz80, if it works 2025-01-07 12:36:07 my only "problem" with the jgz80 is that it's too accurate for this purpose (WZ, Q and whatnot), and I could well trade accuracy for speed 2025-01-07 12:36:29 If you want that tradeoff you probably need to write your own 2025-01-07 12:36:39 Everyone emulating Z80 is primarily interested in realism 2025-01-07 12:37:57 yeah, you're right, there may be some exceptions (thinking simh for example) but those probably don't care much about speed either 2025-01-07 12:38:45 I think rather than writing my own, I could modify jgz80 to remove the extra bloat 2025-01-07 12:39:25 Theoretically 400MHz is already quite good 2025-01-07 12:39:58 pgimeno: the interpreter is probably more comprehensible, and you can do things like add single-step debugging and stuff 2025-01-07 12:40:02 yeah it's about 125 times faster than a juppy 2025-01-07 12:40:02 IMO if you want faster execution, the obvious route is to port the dialect to AMD64 or whatever your CPU is 2025-01-07 12:40:16 veltas: heh, a 425MHz Z80 sounds great 2025-01-07 12:41:28 http://www.chrisfenton.com/the-zedripper-part-1/ "the ZedRipper – a 16-core, 83 MHz Z80" 2025-01-07 12:41:30 for the purpose I'm targeting, I'm happy with how it runs, I'm just a bit too perfectionist when it comes to unnecessary bloat, but if I can get over that, it's pretty fine as is 2025-01-07 12:41:45 pgimeno: does your interpreter work in PyPy? that might make it a lot faster 2025-01-07 12:41:46 oh that sounds cool GeDaMo 2025-01-07 12:42:01 Built in an FPGA 2025-01-07 12:42:09 I got a kick out of rewriting the konilo VM in AMD64 2025-01-07 12:42:38 xentrac: sorry, there may be a confusion. My interpreter will probably work in PyPy, but we're talking about the Z80-based Jupiter emulator that I wrote for validating the interpreter. 2025-01-07 12:43:36 right, I understand 2025-01-07 12:44:18 the goal of my interpreter was to enable Jupiter users with the ability to write programs in a PC with modern editors and stuff, and compile them to a tape file for use in emulators or in the real Jupiter. For that purpose, actually not much speed is necessary. 2025-01-07 12:44:56 more speed always opens up new uses for software 2025-01-07 12:59:05 Lots of stuff opens up new uses, but we don't have infinite time for development! 2025-01-07 13:00:21 nope, which is why PyPy is so nice :)