sehugg / 8bitworkshop

web-based IDE for 8-bit programming and Verilog development
http://8bitworkshop.com/
GNU General Public License v3.0
516 stars 84 forks source link

Apple ][+ Language Card Memory? #185

Open seanwiththebeard opened 5 months ago

seanwiththebeard commented 5 months ago

I apologize if this is by design, but the default CC65 configs have space for an LC segment using some of the top 12K of the address space which doesn't seem to be currently accessible in the 8bitworkshop IDE. Is it possible to use the memory that would usually be in the language card? When I use the #pragma code-name (push, "LC") macro to move a section of code into that segment (and end the section with #pragma code-name (pop)), it shows my function names in the memory viewer at those locations but the actual bytes are zeroed out. It behaves as expected when I compile my code in CC65 locally and test in AppleWin so I'm maybe this is a web emulator limitation?

sehugg commented 5 months ago

I think there are two things that mess up CC65: Bad emulation code (it doesn't register reads in $c080-c08f, just writes) and also the alternate ROM that 8bitworkshop uses doesn't have the memory copy routine at $D39A.

I fixed the emulation bug on the dev site (https://sehugg.github.io/8bitworkshop/) and you uploading your own ROM to "apple2.rom" in the IDE should fix the second problem.

seanwiththebeard commented 5 months ago

Thanks, that does work! It's functional in current v3.11.0 on the main site as well, I just had to upload an Apple ][+ rom in my project and reference it with //#resource "apple2.rom", now the top 12k is available and I'm playing tetris with my functions to make everything fit

I thought I saw something about including a rom in the documentation or maybe on the blog and now I can't find it again, but it would be cool if this was referenced on the platform description page

Probably unrelated to this issue but while we're talking about CC65 configs and making the most of the memory space, where can I find each 8bitworkshop platform's compiler/linker/assembler optimization config (or makefile?)? I'm compiling locally with -Osir -Cl compiler flags and getting code generated roughly 10% longer, so if something runs up to the end of a segment in 8bitworkshop and runs fine my local compiled output will just barely overrun the segment