bitfixer / bf-romulator

Romulator - RAM/ROM replacement and debug for 6502 CPU systems
146 stars 21 forks source link

65c02 Apple IIe Enhanced #20

Open Velkas opened 1 year ago

Velkas commented 1 year ago

Not sure if this is the right place but I just got my romulator put together and tested as working. I was hoping to use this to dig into my Apple IIe (enhanced). I noticed there are through holes for a jumper with the board silk screen showing to connect for a 65c02 which I have done. However there seems to only be a rom entry for the Apple II+ in the default enable and memory mapping.

I was hoping to get some help figuring out how to add an Apple IIe Enhanced entry since I have the system with upgraded rom that's been tested and working 100%,.

My understanding is that the dip switches on the romulator are for selecting the rom / memory map to load. So I would imagine I need to dump the rom from the machine, then somehow figure out a mapping. After that I would need to get those added into the firmware for the fpga?

To be honest I'm new to all this and part of why I want to get this working is to just learn more about the 6502 era of computing. This started with ben eater's fantastic 6502 breadboard computer kit which I also intend to program into the romulator eventually.

Anyways, some advice, steps, or general information would be helpful as I'm still getting oriented.

dennowiggle commented 1 year ago

I have an Apple IIe Platinum and this is what I use for configuration. It probably needs tweaking some more but it's a good start. In my case the ROM overlaps the I/O area, but that is not the case in earlier models.

I did not need to use a jumper for the 65c02 that my machine has. I have managed to see code I loaded from disk at address 0x6000 using the D1-mini tool.

I found it best to remove all other configs for now to remove chance of errors. In my case having a line consisting of multiple spaces caused an issue as such a line with more that 2-3 spaces will be treated as a valid line. Also, avoid very long comments as they will overflow the buffer.

############################################## File "enable_table_default.csv"

1,0x0000,0x03FF,"readwrite" 1,0x0400,0x07FF,"writethrough" 1,0x0400,0x07FF,"vram",characters-2.901447-10.bin 1,0x0800,0x0BFF,"writethrough" 1,0x0C00,0x1FFF,"readwrite" 1,0x2000,0x5FFF,"writethrough" 1,0x6000,0xBFFF,"readwrite" 1,0xC000,0xCFFF,"passthrough" 1,0xD000,0xFFFF,"readonly"

For now I'm using the PET character ROM for which Mike has code working. I have yet to get the remote screen fully working in 40 col mode on the Apple IIe as more code changes are needed but it will be possible given time. Basically the screen is mapped in a non linear way on the Apple II and is loacted at address 0x0400-0x07FF.

############################################# File "enable_table_default.csv"

1,IIeP_C0-FF-342-0349-B.bin,0xc000

Find the ROM that your system uses on the interwebs and then in file "memory_set_default.csv" add a line for config 1. Place the ROM file in the ROM's directory. ROM's can be found here: https://mirrors.apple2.org.za/Apple%20II%20Documentation%20Project/Computers/Apple%20II/Apple%20IIe/ROM%20Images/

############################################# Hope that helps.

dennowiggle commented 1 year ago

I just looked at the schematic and the CPU jumper you talk about in the first post is attached to pin 36 of the CPU which is Bus Enable on the WD65C02. If you are using that manufacturer (WDC) it is recommended to tie pin 36 to VDD on the IIe. The romulator jumper connects 36 to RW which is different. https://www.westerndesigncenter.com/wdc/AN-002_W65C02S_Replacements.php

Please note that this instruction is only needed for certain newer versions of the 65C02 such as the one currently sold by WDC. The WDC link above includes a comparison table for the different versions of 6502. So if you have an original Rockwell 65C02 then pin 36 is NC on that chip too and you don't need the jumper on the Romulator.

bitfixer commented 1 year ago

Thanks very much for the fixes and contributions! I'm away from the computer for a few days but will take a closer look as soon as I'm back.

On Sat, Dec 10, 2022 at 10:08 AM dennowiggle @.***> wrote:

I just looked at the schematic and the CPU jumper you talk about in the first post is attached to pin 36 of the CPU which is Bus Enable on the WD65C02. If you are using that manufacturer (WDC) it is recommended to tie pin 36 to VDD on the IIe.

The romulator jumper connects 36 to RW which is different.

https://www.westerndesigncenter.com/wdc/AN-002_W65C02S_Replacements.php

Please note that this instruction is only needed for certain newer versions of the 65C02 such as the one currently sold by WDC. The WDC link above includes a comparison table for the different versions of 6502. So if you have an original Rockwell 65C02 then pin 36 is NC on that chip too and you don't need the jumper on the Romulator.

— Reply to this email directly, view it on GitHub https://github.com/bitfixer/bf-romulator/issues/20#issuecomment-1345351275, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANYKOIXQLZAWBB4P3RYILDWMTBIHANCNFSM6AAAAAASZ4HP6Y . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Velkas commented 1 year ago

This is fantastic!

Thank you so much. I'm going to start looking into it later today.

I do have the IIe platinum as well, and the chip is actually labeled 6503 but everything I could find online was that it is still just a 6502 from the enhanced chipset originally offered by Apple.

And the info for the WDC 6502 (which I'm using for my breadboard computer) will also be very useful.

I also got the D1 mini tool with the hopes to utilize the remote video.

I'll take a look for a rom online but I'm also trying to get my hands dirty here so I'll try dumping the rom myself soon too, assuming I'm on the right path by pulling it and using a my rom flasher to back it up (as far as I can tell with tests it has not degraded yet).

Thank you again!

Velkas commented 1 year ago

Just wanted to follow up and say thank you! With your help I was able to get the memory map and rom mapping to work and my d1 can now halt the iie enhanced and can successfully interrogate the memory. I ended up using your map as a starting point and landed here:

1,0x0000,0x00FF,"readwrite"         # RAM Zero Page
1,0x0100,0x01FF,"readwrite"         # RAM 6502 Stack
1,0x0200,0x02FF,"readwrite"         # RAM Input Buffer
1,0x0300,0x03FF,"readwrite"         # RAM Vectors
1,0x0400,0x07FF,"writethrough"      # RAM Text/Lo-Res Gfx Page 1 Display
1,0x0800,0x0BFF,"writethrough"      # RAM Text/Lo-Res Gfx Page 2 Display
1,0x0C00,0x1FFF,"readwrite"         # RAM
1,0x2000,0x3FFF,"writethrough"      # RAM Hi-Res Gfx Page 1 Display
1,0x4000,0x5FFF,"writethrough"      # RAM Hi-Res Gfx Page 2 Display
1,0x6000,0xBFFF,"readwrite"         # RAM
1,0xC000,0xCFFF,"passthrough"       # IO (Default ROM)
1,0xD000,0xFFFF,"readonly"          # ROM

I was able to run multiple diagnostic and test programs to run and verify all the hardware and slots including the 80 col and double high-res display functions are working. Including the startup display of //e instead of the dreaded ][

dennowiggle commented 1 year ago

I'm happy to hear of your progress. Thank you for sharing the refined config with meaningful comments.

I did get the remote screen working in 40 column mode. Here is a temporary link for the changes to the D1-mini code that I made. Files are placed inside the romulator-programmer-debugger directory. I have forwarded these to the developer. https://drive.google.com/file/d/1gBQpiDwRtNSAMiSr1gJthNIEoZKr36gh/view?usp=share_link

Instructions:

EDIT : I added the romulator.bin image file to the zip. That has improvements to the verilog if needed that are detailed on other recent Issue threads. I didn't retest the Apple remote screen without these changes. The config switches need to be set to 5.