kervinck / gigatron-rom

System, apps and tooling for the Gigatron TTL microcomputer
BSD 2-Clause "Simplified" License
231 stars 80 forks source link

SYS_CopyMemoryExt now copies across arbitrary banks #201

Closed lb3361 closed 3 years ago

lb3361 commented 3 years ago

This is an improved version of SYS_CopyMemoryExt that copies memory across arbitrary memory banks. The previous version used to copy from the current bank to another bank. This one copies from the bank specified by bits 4 and 5 of [vAC+1] to the bank specified by bits 6 and 7 of [vAC+1], regardless of the currently selected bank. Note that, because of the way the RAM and IO expansion works, the high addresses (0x8000-0xffff) are mapped the selected bank, and the low addresses (0x0000-0x7fff) remain always mapped to bank 0.

In order to make this work, I had to find an unused byte. I did this by reducing the burst size to 5 bytes instead of 6 bytes, reducing the peak copy bandwidth by 17%. This should not matter in practice.

lb3361 commented 3 years ago

There is a new test file at https://github.com/lb3361/gigatron-lcc/blob/master/stuff/TSTmemcpyext.c. Attaching the gt1 file. This will not work with ROMv5a!

TSTmemcpyext.zip

at67 commented 3 years ago

Looks good, cheers.