Search the Community
Showing results for tags '6502 programming'.
-
I'm trying to get back to writing for Atari 8 bit. However, using the emulator on my laptop seems to be a bit silly. In this day and age I should be able to just write code on my laptop and run it on simulator. It's possible to run Atari800MacX from CLI, to fire up a piece of code - or even run its generic - non macOS specific version (yay true opensource) atari800. But I don't know what workflow folks use for making software under such conditions. What compiler would you use? Are there scripts out there already? Please share. Windows users seem to be using VSCode and Altirra , but the latter is very much a monolithic piece of software that cannot be easily made cross platform. Not to mention it's not developed in the open, even tho its source code is available. So it's clearly not the right avenue to pursue. And no, I am not going back to using windows, thanksverymuch
- 14 replies
-
- 1
-
- macos
- development
-
(and 6 more)
Tagged with:
-
The following tutorial walks through the steps of building a simple program in assembler to be deployed to a cartridge for Atari 8 bit computer using the CA65 assembler. Source The newest and all historic version of the source code can be downloaded from SourceForge. Main source Complete source code: HelloWorld.s. Header The header of an contains the includes as well as the exports and imports. The main source for cartridges needs to export the cartstart and cartinit procedures. cartinit is called before the OS is initialised and should return with an RTS. cartstart is jumped to after the OS is initialised and either should not return or exit with jmp (DOSVEC). .FILEOPT compiler, "ca65 V2.19 - N/A" .FILEOPT author, "Martin Krischik «krischik@users.sourceforge.net»" .FILEOPT comment, "this Atari assembly CAR program will print the “hello world” message to the screen" .INCLUDE "atari.inc.s" .INCLUDE "OS.inc.s" .MACPACK atari .SETCPU "6502" .DEBUGINFO off .EXPORT cartstart, cartinit Read only data When using the CA65 you don't need to set absolute addresses for your data. You just specify which data your want to store and how long the data is. RODATA will be stored in the ROM itself. ;; ; Our message ; .SEGMENT "RODATA" Message: .BYTE "Hello World!",EOL .BYTE "(using a cartridge in assember)",EOL Message_Len = * - Message Read/Write data If you want to write to the data you use the DATA segment which will be place in ram staring at address $2000. ;; ; Text returned from keyboard ; .SEGMENT "DATA" Input: .RES 1 Input_Len = * - Input If you want to store data in the zero page you can use the ZEROPAGE segment. Program The actual program consist of a put string which write the text „Hello World!“ and a get string to wait for a key press. It ends with a jump to DOSVEC. Put_String and Get_String are macros explained later. ;; ; main procedure ; .SEGMENT "CODE" .ORG OS::LC_8K ;; ; the main method of a cartridges does not return. ; .proc cartstart: near Put_String Message,Message_Len Get_String Input,Input_Len jmp (DOSVEC) .endproc ;; ; cartridges have an init function which is called ; before the operating system is initialized. ; .proc cartinit: near RTS ; Continue with initialisation .endproc OS macro include Complete source code: OS.inc.s Put_String This is setting all the parameters for an PUTCHR operation using I/O block 0 which by default uses the "E:" editor device. .macro Put_String Text,Len LDX #CIO::Console ;Use IOCB 0 / Console LDA #PUTCHR ; Command Put Text Record STA ICCOM,X LDA #<(Text) ; Set low byte of message STA ICBAL,X LDA #>(Text) ; Set high byte of message STA ICBAH,X LDA #<(Len) ; Set low byte of message length STA ICBLL,X LDA #>(Len) ; Set high byte of message length STA ICBLH,X JSR CIOV ;Call cio .endmacro Get_String This is setting all the parameters for an `GETCHR` operation using I/O block 0. .macro Get_String Buffer,Len LDX #CIO::Console ;Use IOCB 0 / Console LDA #GETCHR ; Command Get Text Record STA ICCOM,X LDA #<(Buffer) ; Set low byte of buffer STA ICBAL,X LDA #>(Buffer) ; Set high byte of buffer STA ICBAH,X LDA #<(Len) ; Set low byte of buffer length STA ICBLL,X LDA #>(Len) ; Set high byte of buffer length STA ICBLH,X JSR CIOV ;Call cio .endmacro Cartridge Header Complete source code: CAR_Header.s: The cartridge header are a few bytes at the end of the cartridge. This file tells the linker what to put into the header. The header is exported as __CART_HEADER__ so the linker know that this is indeed the cartridge header. .EXPORT __CART_HEADER__: absolute = 1 .IMPORT __CARTSIZE__, __CARTFLAGS__, cartinit, cartstart ;; ; set init and main run addresses ; .SEGMENT "CARTHDR" .ORG CARTCS ; cartridge start address .WORD cartstart .ORG CART ; cartridge present indicator .BYTE $00 .ORG CARTFG .BYTE <(__CARTFLAGS__) ; Init and start cartridge, no disk, no diagnostic. .ORG CARTAD ; cartridge initialise vector .WORD cartinit .assert (__CARTSIZE__ = $2000 || __CARTSIZE__ = $4000), error, "Cartridge size must either be $2000 or $4000" Makefile Complete source code: Makefile Variables A few variables describing the current project. Package_Name := Hello_World App_Name := HELLO_A Exe_File := target/$(App_Name).CAR Object_Files := target/obj/HelloWorld.o target/obj/CAR_Header.o Map_File := target/$(App_Name).MAP Include_Dir := ../../Library Assemble The assemble command needs are passed the following options: The platform you assemble for: --target atari Where include files are located: --include-dir $(Include_Dir) Creating a listing of actual code is always helpful: --listing $(basename $(@)).lst The current output file -o $(@) And the first input file $(<) target/obj/%.o: src/main/asm/%.s ca65 \ --target atari \ --include-dir $(Include_Dir) \ --listing $(basename $(@)).lst \ -o $(@) \ $(<) Link The link command needs are passed the following options: The size of the cartridge, 8k in our case: -D__CARTSIZE__=0x2000 The cartridge flags: -D__CARTFLAGS__=0x4 The platform you assemble with indication that we want a cartridge: -C atari-cart.cfg Creating a memory mapp file of linked code is always helpful: --mapfile ${Map_File} The current output file -o $(@) All the input file $(+) $(Exe_File): ${Object_Files} ld65 \ -D__CARTSIZE__=0x2000 \ -D__CARTFLAGS__=0x4 \ -C atari-cart.cfg \ --mapfile ${Map_File} \ -o $(@) \ $(+) Run on Emulator For testing and debugging the use of an emulator like the Atari800 is recommended. Deploying is much faster and can be automated inside the makefile so a simple `make run` will start the application. Note that you need to adjust the directory and file names to your system. Atari800_System := /opt/local/share/atari800 Atari800_User := "$(HOME)/Library/Application Support/Atari800" Atari800_Exe := "/usr/local/bin/atari800" Atari800_Window := -video-accel -pal -win-height 1120 -win-width 1680 Atari800_Cart = -cart-type 1 -cart "$(Exe_File)" Atari800_Option = -autosave-config -320xe -nobasic -config "$(CURDIR)/target/$(App_Name).cfg" -xlxe_rom "$(Atari800_System)/ATARIXL.ROM" run: $(Exe_File) $(Atari800_Exe) \ $(Atari800_Cart) \ $(Atari800_Option) \ $(Atari800_Window) The Atari800 emulator also has a system monitor with single step debugger and disassembler included which makes debugging that much easier. Run on device To run the application on a real Atari a hardware cartridge is needed. The best option is a modern cartridge like Side3 which uses SD cards and flash memory as ROM storage. A Side3 cost a little more then $€£100. A classic cartridge using EEPROMs will also work but is more work to setup and only slightly cheaper. For the Side3 all you need to do is to copy the CAR file onto the SD card. This operation which can be automated using make. Side3_Deploy := /Volumes/SIDE3 side3: $(Exe_File) mkdir -p "${Side3_Deploy}/${Package_Name}" cp "$(<)" "${Side3_Deploy}/${Package_Name}"
- 2 replies
-
- 5
-
- development
- assembler
-
(and 5 more)
Tagged with:
-
I recently dug out my Atari 7800 7800 Monitor Cartridge that I bought from Video 61 in August 2000. It's been quite a few years since I've messed around with it. I was showing a friend of mine how it worked. We looked at the three demo programs that are on it (Bumper Tanks, Hex Demo and Color Display), plus we typed in a couple of the very short demonstration programs and tried those too. I suppose that after nearly 20 years the battery in the cartridge that saves the RAM is dead, but I'd still like to play around with this rare cartridge and maybe make a video of it in use since I can't even find video of anyone using it (not even pictures or screenshots of the three demo programs on it). I know that the manual for the 7800 Monitor Cart isn't freely available. This is a shame, as this certainly would get more people interested in the program. I wonder if Video 61 would allow, at least, the manual to be released as a pdf? Did anyone ever write any short subroutines that I could type into this machine language monitor using those trusty keyboard controllers? Are there any generic 7800 programs that I could use with the Monitor carts? Adam
- 4 replies
-
- 1
-
- atari 7800
- monitor cart
-
(and 2 more)
Tagged with:
-
I made a video overview of the "7800/2600 Machine Language Monitor Cartridge" (Version 2) for the Atari 7800 game console. Version 1, of the Monitor was published by Harry Dodgson in 1993. Version 2 was published by Video 61 in 2000. I posted about this in the 7800 programming subforum-- but this video is of a general nature and I think many Atari 7800 fans will enjoy learning more about this rare cartridge. This video shows how to use this Atari 7800 6502 machine language monitor program to communicate with the 6502. Like the monitor itself, this video is aimed at someone who knows a little about 6502 of programming. However, even someone without such knowledge should be able to gain some insight into the inner workings of this humble and early homebrew Atari 7800 utility program that was released on cartridge when the Atari console homebrew scene was in its earliest infancy. You can view it on YouTube, here: You an view and/or download it from Archive.org, here: https://archive.org/details/Atari78002600MonitorCartridgeHomebrewOverview The three demonstration programs included on the cartridge (Bumper Tanks, Hex Demo and Color Display) are run and the hexadecimal program listings are shown in the monitor. Also, a few of the example programs are typed into the monitor and run. Finally, a few of the monitor's built-in subroutines are used to show how to generally program the 2600 and 7800 using this cartridge. I'm sorry about the fuzziness of the close-up video of the TV screen in the later part of the video; it was the best that I could do with my camera. I may remake and expand the later part of the video that is fuzzy by using an Atari 7800 with a direct video capture connection. This would dramatically clear up the video. For now, this is the best that I can do under the circumstances. There is an interview with Harry Dodgson on the Good Deal Games website. In the interview, Harry explains how the development of the Monitor cart came about in 1993 and the release of the second version in 2000: http://www.gooddealgames.com/interviews/int_Harry Dodgson.html The following information is from the over 200-pages of documentation for the Monitor cartridge. "7800/2600 Monitor Cartridge" Overview The 7800 Monitor cartridge contains a 32K byte EPROM, an 8K byte RAM chip, a lithium battery for the RAM, and a few miscellaneous parts to make them all work together. The EPROM is logically divided into two sections; one half for 2600 VCS mode and the other half for 7800 Pro System mode. The battery provides power to the RAM chip allowing the programs and data on it to be retained when the power to the 7800 is turned off. The battery is not user-replaceable. The EPROM on the cartridge is socketed however and can be exchanged with updated software without having to replace the entire cartridge. The 16K of EPROM allocated for 7800 mode contains: - Version 2.0 of the 7800 Monitor (includes 8 new commands). - Three graphic demonstration programs. - Five example programs to help learn the monitor commands. There is some unused space on the 7800 half of the EPROM which is reserved for future upgrades of the monitor. The 7800 Monitor allows you to enter programs for either 7800 mode or 2600 mode. You can also run and debug programs for 7800 mode easily. To run programs for 2600 mode, you must change to the 2600 mode of the cartridge. The 16K of EPROM allocated for 2600 mode contains: - Three classic Atari video games - Combat, Space War, and Slot Racers. - Three video display demonstration programs. - A menu program. The menu program allows you to choose between all the programs on the ROM or a program loaded into RAM. The Atari games have been modified slightly for inclusion on the ROM. Enjoy the video! Adam
-
- 2
-
- atari 7800/2600 monitor cartridge
- homebrew
- (and 9 more)