abqlewis wrote:
Andrew,
If you don't mind, I have a few questions/discussions/rambles :
1) To anyone else trying this on Linux, I had to add myself to the dialout group, AND restart to get it to work.
On Linux the standard is to add yourself to the dialout group. Other *NIX flavours have more accessible permisions on the device itself.
abqlewis wrote:
2) Do I have to do anything special to the code I load, to make sure that I returns to your monitor when it's done? In other words, if I load a program with the 'S' command and then run it with the 'G' command, HOW does it get back to the monitor, or DOES it get back?
The monitor traps software interrupts generated by the BRK instruction. Just add one at the location you want to stop at. In fact thats what actually starts the monitor in the first place. The reset routine initialises the vectors, prints the title string then executes a BRK to enter the monitor.
Code:
RESET:
00:0091' 78 : sei
00:0092' D8 : cld ; Ensure binary mode
00:0093' A2FF : ldx #$ff ; Reset the stack
00:0095' 9A : txs
repeat ; Setup vectors
00:0096' BD???? : lda VECTORS,x
00:0099' 9D707E : sta IRQV,x
00:009C' E8 : inx
00:009D' E004 : cpx #4
00:009F' D0F5 : until eq
00:00A1' 20???? : jsr NewLine
00:00A4' A200 : ldx #TTL_STR
00:00A6' 20???? : jsr ShowString
00:00A9' 20???? : jsr NewLine
repeat
00:00AC' 0000 : brk #0 ; And enter monitor
00:00AE' 80FC : forever
abqlewis wrote:
3) My plan for now is to find a cross-assembler/compiler that runs in Linux (thinking cc65) that can make an S19 file (or something I can script into it), and loading through your monitor until I get something that works. Does this fit into what your monitor is meant for?
The JAR file contains my 65xx assembler and linker which is used to build the monitor itself but could be used for anything. If you want a C compiler then CC65 will generate 6502 code which doesn't make use of the additional 65C02 instructions. I'm working on a port of WDC's tools to gcc but it going to take time.
The monitor can load S19 files but the uploader itself handles S19, S28 or WDC's binary format. The monitor is good for loading and debugging small programs but a if you need to use all the memory then the uploader is a better option for getting code in memory and starting it.
abqlewis wrote:
4) A sub-discussion in the thread is about re-programing the flash. One of my theories is that I can dump the contents of ROM with your monitor and write a little script to make it into an SRecord file as a backup to the existing TIDE ROM. Does this make sense? I don't have a programmer (with adapters) yet, but that's next. I need to investigate more, because this level of detail in hardware is a little out of my realm.
You can dump the rom using the uploader
Code:
java -cp "Dev65.jar;jSerialComm-2.6.2.jar" com.wdc65xx.sxb.Uploader -port COM6 savebin 8000 8000 rom.bin
java -cp "Dev65.jar;jSerialComm-2.6.2.jar" com.wdc65xx.sxb.Uploader -port COM6 save 8000 8000 rom.s28
Looks like there is a bug in the S28 save command. I'll fix it.
abqlewis wrote:
5) I copied your run.sh command but removed the "term" parameter. This allows your program to just load your monitor into RAM, and then I can just run the Linux "screen" anytime I want to connect to the board.
Thats fine but you can lose some of the output generated between the program starting and your new terminal program starting.
abqlewis wrote:
6) As far as the ROM is concerned, I think I could continue to uses the old TIDE ROM where it is and add my rom-program to a different "page" of the ROM. The docs mention changing ROM banks, but don't really say how. I've gleaned from the schematic that it involves the CA and CB ports of VIA2. I'm not quite there yet, but I will be.
Yes. A program running in RAM can switch banks by changing the VIA settings then erase and reload the flash. As the lines have external pullup resistors you flip the pins (CA2 & CB2) between being inputs (the initial setting) and low outputs by changing the control settings in the PCR register.
My 816/265 hacker programs have commands to change ROM and XMODEM download into flash but I haven't done 134/02 versions yet.
I've been discussing revising the boot ROM with another developer who is also working with WDC on the FPGA versions. The upgrade would include a flash programming option as this is already provided on the C165.
You should check the speed of the CPU oscillator Y2 next to the USB socket. It should be 8MHz but the latest batch of boards have the same 1.8432MHz oscillator used for the ACIA chip (Y1) mounted by mistake. (Someone put the wrong reel in the pick and place machine). I might try to fix my board myself but the oscillator is a bit too close to the VIA socket and I don't want to melt it.