6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 10:45 pm

All times are UTC




Post new topic Reply to topic  [ 87 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: Re: Beginners cc65
PostPosted: Sat Jun 09, 2012 11:10 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
It looks as if the path's are not being stored in the environment. When you installed cc65, did you uncheck the two recommended options for saving the path and environment variables? They should remain checked. I have run this on two xp boxes and one Win7 box and it works. I may need to give more details on the installation and compiling processes, however.

Daryl


Top
 Profile  
Reply with quote  
 Post subject: Re: Beginners cc65
PostPosted: Sat Jun 09, 2012 11:53 pm 
Offline
User avatar

Joined: Mon Aug 08, 2011 2:48 pm
Posts: 808
Location: Croatia
I didn't uncheck them. If you wish i can let you in my pc via teamviewer.
Edit: I mean if you wish to see the problem yourself...


Top
 Profile  
Reply with quote  
 Post subject: Re: Beginners cc65
PostPosted: Sun Jun 10, 2012 5:07 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
I think I see the problem, and like I thought, my documentation was not very clear.

I see this from your post:
C:\cc65\CC65\SIM Demos\hello1

There should not be a CC65 subdirectory inside the cc65 folder. If you drag the CC65 folder to c:\, it will drop it's contents into the cc65 folder and then all should be good. You may need to run the copysim.bat file that is now in the c:\cc65\sim folder, as opposed to the c:\cc65\CC65\sim folder. I hope that makes sense.

Give it a try and I think all will work.

Daryl


Top
 Profile  
Reply with quote  
 Post subject: Re: Beginners cc65
PostPosted: Sun Jun 10, 2012 2:34 pm 
Offline
User avatar

Joined: Mon Aug 08, 2011 2:48 pm
Posts: 808
Location: Croatia
I tried that, but there are some folders in both C:\cc65 and C:\cc65\CC65 that would get overwritten when i would try to copy its content to C:\cc65. When i tried that, i said to skip instead of overwriting the files, and then i tried to run copysim.bat again, but i still wouldn't work.

Edit: I got it working, i had to overwrite the files...


Top
 Profile  
Reply with quote  
 Post subject: Re: Beginners cc65
PostPosted: Sun Jun 10, 2012 2:55 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
Yes, some files will get overwritten but they should be the same versions. Glad hear its working now.

Daryl


Top
 Profile  
Reply with quote  
 Post subject: Re: Beginners cc65
PostPosted: Sun Jun 10, 2012 3:03 pm 
Offline
User avatar

Joined: Mon Aug 08, 2011 2:48 pm
Posts: 808
Location: Croatia
Ok now when i got it working, i loaded the 65.b file in disassembly and it starts from address 0, that is page zero, and the reset vector also points to address 0. When i run it nothing happens. To which address printf writes characters?


Top
 Profile  
Reply with quote  
 Post subject: Re: Beginners cc65
PostPosted: Sun Jun 10, 2012 6:44 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
The load and start address should be $0200. When loading a *.65b file, it should prompt you for a load address. Enter $0200. You can choose the 'Erase all memory" option or not, it does not matter.

Clicking the Run Icon should start up and run the program.

Daryl


Top
 Profile  
Reply with quote  
 Post subject: Re: Beginners cc65
PostPosted: Sun Jun 10, 2012 7:04 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
Another Oops.

First time running the Simulator, you need to set the IO address to $F000. The default is $E000. Also, set the IO window resolution to 80x25.

Set those and try again - it will work!


Sorry to all - I have been trying to get this done quickly but have had 100+ interruptions at home and my documentation made way too many assumptions.

I'll try to get the docs updated to include more details and all of the steps.

Daryl


Top
 Profile  
Reply with quote  
 Post subject: Re: Beginners cc65
PostPosted: Sun Jun 10, 2012 7:40 pm 
Offline
User avatar

Joined: Mon Aug 08, 2011 2:48 pm
Posts: 808
Location: Croatia
Wee, it works!
Now i need to figure out how to change the programs star location to C000, ram top to 8000, and I/O to 8200 with a read/write delay, because every read/write causes an interrupt to the pic mcu to clear the output register or to accept input data. And some way in which i can set for writing characters my crtc routine.


Top
 Profile  
Reply with quote  
 Post subject: Re: Beginners cc65
PostPosted: Sun Jun 10, 2012 7:52 pm 
Offline
User avatar

Joined: Mon Aug 08, 2011 2:48 pm
Posts: 808
Location: Croatia
I see the putc.s and getc.s filse. can i modify them to suit my sbc?
And also if you could comment the sim.cfg file, why does it have a 2k stack and zero page to D0, ect.
And where do i specify the rom?


Top
 Profile  
Reply with quote  
 Post subject: Re: Beginners cc65
PostPosted: Sun Jun 10, 2012 9:31 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
Dajgoro wrote:
I see the putc.s and getc.s filse. can i modify them to suit my sbc?
And also if you could comment the sim.cfg file, why does it have a 2k stack and zero page to D0, ect.
And where do i specify the rom?


Yes, you can modify any file in the Sim folder to suit your needs. I believe the 2k stack is a data stack, not the 6502 return stack. I wish I could document the cfg file. Like I said before, I am not an expert on cc65. I got it to work for my needs, mostly by trial and error.

The best I can suggest is to download all of the cc65 source files. Read them all. Look at the Atari, C-64, Apple2, and other sources, and their cfg files and see how they work. Don't forget my cc65 files for my SBC-3. The sim.inc (or sbc3.inc) contains pointers to all of the built-in ROM routines supported by the Host platforms OS.

I spent months trying to figure out how it all works and only just understand enough to make it work. I'm afraid I wouldn't know how to explain anything clearly and I just don't have the free time to devote to it.

Using the setup I provided will be a great starting point to learn from.

Also, you can try to contact the cc65 author for help. (webmaster at cc65 dot org)

Daryl


Top
 Profile  
Reply with quote  
 Post subject: Re: Beginners cc65
PostPosted: Sun Jun 10, 2012 11:33 pm 
Offline
User avatar

Joined: Mon Aug 08, 2011 2:48 pm
Posts: 808
Location: Croatia
I changed the .PC02 to .P02 since i have a nmos cpu. Now i get errors in read.s and write.s.
Where can i find the files for the nmos C64 or Apple II?


Top
 Profile  
Reply with quote  
 Post subject: Re: Beginners cc65
PostPosted: Sun Jun 10, 2012 11:53 pm 
Offline
User avatar

Joined: Mon Aug 08, 2011 2:48 pm
Posts: 808
Location: Croatia
When i run makesim i get this errors:
Code:
C:\cc65\sim>echo off
SIM
The system cannot find the path specified.
read.s(58): Error: Illegal addressing mode
write.s(64): Error: Illegal addressing mode
common
The system cannot find the path specified.
read.s(58): Error: Illegal addressing mode
write.s(64): Error: Illegal addressing mode
conio
The system cannot find the path specified.
read.s(58): Error: Illegal addressing mode
write.s(64): Error: Illegal addressing mode
dbg
The system cannot find the path specified.
read.s(58): Error: Illegal addressing mode
write.s(64): Error: Illegal addressing mode
runtime
The system cannot find the path specified.
read.s(58): Error: Illegal addressing mode
write.s(64): Error: Illegal addressing mode
Build library
ar65.exe: Warning: Library `sim.lib' not found - will be created
ar65.exe: Error: Could not open `common\*.o': No such file or directory
ar65.exe: Warning: Library `sim.lib' not found - will be created
ar65.exe: Error: Could not open `runtime\*.o': No such file or directory
ar65.exe: Warning: Library `sim.lib' not found - will be created
ar65.exe: Error: Could not open `conio\*.o': No such file or directory
ar65.exe: Warning: Library `sim.lib' not found - will be created
ar65.exe: Error: Could not open `dbg\*.o': No such file or directory
ar65.exe: Warning: Library `sim.lib' not found - will be created
Move library files
Cleanup
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
Press any key to continue . . .




But it kinda still works...

I also modified my sim.cfg and now some routines are missing, and jmp in hello1(the first instruction) points to address 0000.

sim.cfg
Code:
#
#  kawalski Simulator
#
MEMORY {
   HEADER:  start = $C000, size = $0004, file = %O;
   ZP:      start = $0000, size = $00D0, type = rw, define = yes;
   RAM:     start = $0200, size = $7E00, file = %O, define = yes;
   ROM:     start = $C010, size = $3FE0, type = ro, define = yes;
}
SEGMENTS {
   EXEHDR:   load = HEADER,          type = ro;
   STARTUP:  load = ROM, type = ro;
   LOWCODE:  load = ROM, type = ro,               optional = yes;
   INIT:     load = ROM, type = ro, define = yes, optional = yes;
   CODE:     load = ROM, type = ro;
   RODATA:   load = ROM, type = ro;
   DATA:     load = RAM, type = rw;
   BSS:      load = RAM, type = bss, define = yes;
   HEAP:     load = RAM, type = bss, optional = yes; # must sit just below stack
   ZEROPAGE: load = ZP,  type = zp;
}
FEATURES {
   CONDES: segment = INIT,
      type = constructor,
      label = __CONSTRUCTOR_TABLE__,
      count = __CONSTRUCTOR_COUNT__;
   CONDES: segment = RODATA,
      type = destructor,
      label = __DESTRUCTOR_TABLE__,
      count = __DESTRUCTOR_COUNT__;
   CONDES: type = interruptor,
      segment = RODATA,
      label = __INTERRUPTOR_TABLE__,
       count = __INTERRUPTOR_COUNT__;
}
SYMBOLS {
   __STACKSIZE__ = $800;   # 2K stack
}


SBC map:
0-32k ram
32k- 48k i/o stuff
48k-64k ram


Top
 Profile  
Reply with quote  
 Post subject: Re: Beginners cc65
PostPosted: Mon Jun 11, 2012 12:30 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
You need to take some time and read the http://www.cc65.org pages. Everything I learned was from there, except the files I got from Chris Ward ( http://www.chrisward.org.uk/6502/downloads.shtml be sure to read his system description to see how his library works).


cc65:
http://www.cc65.org/index.php

The download link takes you here:

ftp://ftp.musoftware.de/pub/uz/cc65/

You have the cc65-2.13.3-1.exe file from my zip.

If you download the cc65-sources-2.13.3.tar.bz2 file and get it decompressed (I use jzip), you will have ALL of the source files for not only the compiler programs, but the target platforms as well. Those get installed over the existing folders, just like my sim files did. (I used this exact file, but deleted out all the unneccessary stuff that was not needed for the Kawalski Simulator). You will now have all of the files for all of the targets. You can look at the older targets for NMOS compatible code.

Read...read...read

Daryl


Top
 Profile  
Reply with quote  
 Post subject: Re: Beginners cc65
PostPosted: Mon Jun 11, 2012 3:03 am 
Offline
User avatar

Joined: Mon Aug 08, 2011 2:48 pm
Posts: 808
Location: Croatia
I modified an existing editor to compile with the cc65 compiler.
I used Pawno, usually it is used to compile gamemodes for sa-mp, a gta San Andreas mod for multiplayer, for which i had a server. Anyway i modified it so that when you open a c file, you can edit it, and when you hit compile it will look for make.bat in the same directory as the c file, and it will run it, and display the result in a separate window(intended for the pawn compiler). The c file must not be located in a directory that contains spaces , ie "SIM Demos" needs to be renamed to "SIM_Demos".
I left the pawncc.c file that imitates the original compiler, so you can modify it...


Attachments:
cc65 pawno.rar [297.69 KiB]
Downloaded 73 times
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 87 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: