Search found 368 matches

by lb3361
Today, 22:34
Forum: Hardware and software hacking
Topic: SYS functions cycles problem
Replies: 2
Views: 27

Re: SYS functions cycles problem

Here is how this is written in GLCC. The idea is that the byte that follows the SYS opcode should be a negative number whose magnitude is the number of additional ticks needed by the SYS function (in addition to the maxTicks ticks given to all vCPU ops). Therefore the number of cycles given to SYS m...
by lb3361
21 Apr 2024, 23:30
Forum: Hardware and software hacking
Topic: Toledo chess program
Replies: 12
Views: 792

Re: Toledo chess program

Using petersieg's zip of April 9th (above in this thread), compiled for dev7, run in mode 3 in gtemuAT67: Screenshot 2024-04-21 at 7.27.04 PM.png Toledo has answered e2e4 after only a few hours. It also work inside http://www.gigatron128k.com, but the problem was that the emulation is suspended when...
by lb3361
21 Apr 2024, 17:47
Forum: Hardware and software hacking
Topic: Toledo chess program
Replies: 12
Views: 792

Re: Toledo chess program

Using petersieg's zipped sources from April 9th in this thread: $ glcc -rom=dev7 -map=sim -o toledos.gt1 toledo.c toledo.c:14: warning: missing return value toledo.c:79: warning: missing return value $ gtsim -rom=../gigatron/gigatron-rom/dev7.rom -vmode=1975 toledos.gt1 A B C D E F G H 8 r n b q k b...
by lb3361
20 Apr 2024, 16:47
Forum: Hardware and software hacking
Topic: Toledo chess program
Replies: 12
Views: 792

Re: Toledo chess program

I added some printf() into the code to debug. Looking at the output and comparing with the same on a PC, I realized that the Gigatron would take about 12 hours to answer an initial e2e4. (compiled for the dev7 rom). Then I compiled a gtsim version because gtsim runs faster than real hardware. It pla...
by lb3361
10 Apr 2024, 11:36
Forum: Hardware and software hacking
Topic: Toledo chess program
Replies: 12
Views: 792

Re: Toledo chess program

The main difference is the size of integers, two bytes vs four bytes. The faq says that it can work, but that might be old information. It might also be possible that glcc has a bug but this is not the right way to isolate it (obfuscation does not help debugging).
by lb3361
09 Apr 2024, 08:03
Forum: Hardware and software hacking
Topic: Toledo chess program
Replies: 12
Views: 792

Re: Toledo chess program

Replacing all the 1e4, 2e4, 3e4 by integers 10000,20000,30000 should make it run a bit faster.
Otherwise the expression is promoted to floating point which is emulated in software.
Still waiting ... is something wrong?
by lb3361
06 Apr 2024, 09:50
Forum: Hardware and software hacking
Topic: Toledo chess program
Replies: 12
Views: 792

Re: Toledo chess program

Thanks! I just did the required changes for modern C++ compiler. But now I replaced all occurrences of 1e5 with 2e4, and 1e9 with 3e4 and it runs fine now. Now we just need to figure out, how to have computer play black ;-) best, Peter According to the web page, one has to invoke it with one dummy ...
by lb3361
05 Apr 2024, 06:03
Forum: Hardware and software hacking
Topic: Toledo chess program
Replies: 12
Views: 792

Re: Toledo chess program

From the FAQ
Screenshot 2024-04-05 at 08.02.18.png
Screenshot 2024-04-05 at 08.02.18.png (549.29 KiB) Viewed 583 times
Checked on ROMv6.
by lb3361
26 Mar 2024, 10:55
Forum: Hardware and software hacking
Topic: ROMv1.asm.py
Replies: 2
Views: 3120

Re: ROMv1.asm.py

A little bit before your screenshot, you'll see this piece of code: # vCPU reset handler vReset = videoTable + 240 # we have 10 unused bytes behind the video table ld((vReset&255)-2); C('Setup vCPU reset handler') st([vPC]) adda(2, X) ld(vReset>>8) st([vPC+1], Y) st('LDI', [Y,Xpp]) st('SYS_Reset...
by lb3361
22 Mar 2024, 02:11
Forum: Hardware and software hacking
Topic: New size coding contest "ZX Spectrum effect"
Replies: 17
Views: 5462

Re: New size coding contest "ZX Spectrum effect"

Found a devious way to save two bytes (execution starts in 0x8b) Code = 21 bytes. GT1 = 27 bytes * file: phib_chess_d.gt1 0081 ff 07 0083 fc 82 XORW $82 ||.| 0085 82 01 ANDI 1 |..| 0087 e3 3f ADDI $3f |c?| 0089 f0 81 POKE $81 |p.| 008b 59 01 LDI 1 |Y.| 008d 99 81 ADDW $81 |..| 008f 2b 81 STW $81 |+....