Search the Community
Showing results for tags 'assembly programming'.
-
I've been gone for a long while but I'd like to revisit my plans for an Atari 2600 Tetris game (eventually becoming a 2-player co-op version as I was working on in the past.) I've recently been looking at ChatGPT-4 for AI-assisted game development, and have been utterly blown away by how coherent this tool actually is! Here is a snippet of a GPT-4 prompt asking for a general code outline to work from as boilerplate or a template for the Tetris game. Let's see if we can finally finish this thing! Me: Can you generate a brief outline of the program code structure showing how the game functions might be organized in a concise and logical way? Omit the actual code blocks, simply commenting them out with an ellipsis (...). Include functions that we have not fully written yet. ChatGPT: Here's an outline of the program code structure for your Tetris game on the Atari 2600: ; Constants and variables ... ; Initialization code ... ; Main game loop GameLoop: ; Read and handle user input JSR HandleInput ; ... ; Update game logic (gravity, collisions, etc.) JSR UpdateGameLogic ; ... ; Check for line clears JSR CheckLineClear ; ... ; Update game level and input delay JSR UpdateGameLevel ; ... ; Draw the game elements JSR DrawPlayfield JSR DrawTetromino JSR DrawScore ; ... ; Wait for the next frame (VBLANK handling) ; ... JMP GameLoop ; Subroutines ; HandleInput HandleInput: ; ... RTS ; UpdateGameLogic UpdateGameLogic: ; ... RTS ; CheckLineClear CheckLineClear: ; ... RTS ; UpdateGameLevel UpdateGameLevel: ; ... RTS ; DrawPlayfield DrawPlayfield: ; ... RTS ; DrawTetromino DrawTetromino: ; ... RTS ; DrawScore DrawScore: ; ... RTS ; Additional functions ; RotateTetromino RotateTetromino: ; ... RTS ; CheckCollision CheckCollision: ; ... RTS ; DropTetromino DropTetromino: ; ... RTS ; ClearLine ClearLine: ; ... RTS ; GenerateNewTetromino GenerateNewTetromino: ; ... RTS ; RandomNumberGenerator RandomNumberGenerator: ; ... RTS Chat-GPT: This outline shows a logical organization of the game functions, including some functions that we haven't fully written yet. The main game loop calls each of the necessary subroutines to handle user input, update game logic, check for line clears, update the game level, and draw game elements.
- 31 replies
-
- 5
-
- homebews
- artificial intelligence
-
(and 2 more)
Tagged with:
-
Hi All, I had intended on learning assy for drawing on the 8-bits but I need to focus elsewhere. Sorry but I am not interested in trades. EDIT: I had asked for offers but I didn't receive any, so I will do some research and come up with a price. Since I don't have a price I feel like I should remove (or ask to have removed) this post. I will ask Al to do so. Cheers, thank you for your interest. KB
-
Hi, I playing with P/M graphics in assembly code (here is my demo) and very often when I run the program I'm getting a disturbing black stripe (for about 0.1 sec) just before player (green square) is turned on. I tested it in emulators Altirra and also in atari800. The issue happens in both. Is it a known behavior or could I prevent it somehow? I know it's a triviality, just wondering if anything is wrong in my code. I think that when I had a real Atari HW (Atari 800XE) a saw the glitch several times too, but not quite sure as it's a long time ago.
-
I want to write a EA5 program loader in Assembly and hoping for a bit of guidance. While I could leverage code from another application, I would prefer writing from scratch, so I fully understand the process. I also don't want to rely on the internal EA loader so as to keep access to all of low memory. It's not all that hard to read the program header, push it into memory, read the next program header, push it into memory, etc, then point the program counter the starting address of the program, but then what next? So, if anyone is aware of any articles or sources that I could refer to I would appreciate it. Thanks, Ernie
-
I was cleaning up my desk at work today and came across this cartoon a friend of mine gave me years ago after discovering I enjoyed programming assembly language on the TI. It was in fun and I certainly didn't take any offense but it got me thinking about structure in assembly language programming. So, do we have examples of what "good" assembly language programming looks like? And, why is it "good?" If you do, I'd love to see it and hear your philosophies about it.
-
How important is the GROM address? Will the computer crash or "go nuts" if it's corrupted? A while ago, I had asked the forum about a DSR call that was giving me problems. I was just duplicating the code that Tom Bentley used in his TCIO routines, to see how to do a DSR call. Before the BLWP @DSRLNK I saved the GROM address, then restored it afterward. Not knowing any better, I did it "because Tom Bentley" did it," assuming everyone knows more about DSR calls than me. One of the responses advised that it was unnecessary to save and restore the GROM address, so I removed that part. A few days ago I was poking through a PDF file of Molesworth's "Intro To TI Assembly", which said that DSR calls will trash the GROM address, so it should be saved. I assume that things like GPLLNK (obviously) or XMLLNK use it but my programs do not directly use it. I also assume that I "know enough to be dangerous" at this point. K-R.
- 10 replies
-
- assembly programming
- dsr
-
(and 1 more)
Tagged with:
-
When I was working on my "L23Dump" package I noticed some strange behavior. I placed my PABs at the top of free VDP RAM, to avoid interfering with any PABs that the calling programs had set-up. For example, C99 sets theirs at 0x1B00-1FFF, if I recall, and Tom Bentley's TCIO uses 0x2000-2500. Anyway, I took the value at CPU RAM 8370 and subtracted the amount I used for buffers and PABs, then saved these VDP pointers in my program. Upon exit I restored the original top-of-free-VDP-RAM pointer to CPU RAM 8370. Sometimes the program would crash for no reason I could tell. Everything looked OK, until I realized that I had not set 8370 to the new top-of-free value. After that everything was okay. Naive me, I figured that the disk DSR would not stray outside the addresses that Thierry Nouspikel said they used. Obviously, I had not "reserved" the region of VDP RAM I had used for my buffers, and so I can see it getting nuked at some point. K-R.
-
- 3
-
- assembly programming
- vdp
-
(and 1 more)
Tagged with:
-
Here are a couple of modules I put together to, hopefully, help with debugging DSR calls. Log output is specified in the calling program, and can be to a disk file or serial/parallel port. They replace DSR calls and log caller parameters and results for Level-2 and Level-3 DSR calls. There are four object files: L2DUMP;O Logs Level-2 DSR calls to a log file or device with descriptions. L2RDUMP;O Logs Level-2 DSR calls to a log file or device as raw hex data. L3DUMP;O Logs Level-3 DSR calls to a log file or device with descriptions. L3RDUMP;O Logs Level-3 DSR calls to a log file or device as raw hex data. The only Ed/Assem dependencies should be DSRLNK and the loader. The object files are rather large, for a TI- 2.5K to 6.5K bytes. I hope these will prove useful. K-R. L23Dump.zip
- 3 replies
-
- 4
-
- assembly programming
- dsr
-
(and 1 more)
Tagged with:
-
I was initially going to start to learn Assembly, to program with my 800XL. But a lot of the books I see on 6502 for Atari have BASIC mixed into them, and also suggest that you know Atari BASIC to be able to follow along with it. More often than not, reading through them, I don't know enough about BASIC to know what they are talking about. So I decided I would take a step back, and try to learn Atari BASIC first. But there are so.....many.....books..... on this subject that I don't know where to start. I'd like to simply start from the beginning, learning as if I knew nothing of BASIC(even though I know little tidbits of it - enough to make small text-based programs, but nothing fancy with graphics or sound). So I am wondering if anyone has any recommendations on what book I should start with to learn Atari BASIC. And then once I learn most or all I can of BASIC, where to go from there to begin to learn 6502 Assembly for the Atari(since, there's almost as many books about this as there are for learning BASIC). EDIT: Just for clarification, I want to be able to use my 800XL for these things. I don't have any access to the new BASICs like Turbo BASIC XL, or FastBasic, or anything like that. For now all I have is the Atari BASIC Rev. B(will soon be C) that's built into my machine. So that's what recommendations should be built upon.
- 5 replies
-
- books
- atari basic
-
(and 1 more)
Tagged with:
-
I made my own clock on for the Atari and provide the executable and the Assembly listing. I name it the cheater clock because all it does is look at the rtclock adress 20 ($14) and advance the Counter one second up til 99 minutes and 59 Seconds. It adjust timing for PAL and NTSC machines. It seem to be fairly accurate , but not exactly real time clock.. Cheaterclock.XEX The Listing in Assembler: ; Cheater clock *=12288 ; set adress for program SDMCTL = 559 ; Can turn on and off Antic (needed when creating display list) SDLSTL = 560 ; Shadow display list pointer low - Antic må vite hvor den nye display listen er SDLSTH = 561 ; Shadow display list pointer high ; Here is some equates SECONDS = 1600 TENSEC = 1601 MINUTES = 1602 TENMIN = 1603 LDX #1 STX TENMIN ; set 1 here or the ten minute number get out of sync LDA #0 STA SDMCTL ;TURN ANTIC OFF LDA #0 ; LOW BYTE STA SDLSTL ; store low byte of display list adress LDA #144 ; HIGHBYTE STA SDLSTH ;store high byte of display list adress LDA #34 STA SDMCTL ; ... Turn on Antic again ; set some colors LDX #12 STX 710 LDX #24 STX 708 LDX #34 STX 709 LDX #58 STX 711 LDX #60 STX 712 ;put the clock on screen before it starts LDX #16 STX 40220 STX 40219 STX 40217 STX 40216 LDX #26 STX 40218 START LDX 53268 ; check for pal atari CPX #1 BEQ PAL LDX 20 CPX #60 ;check rtclock to advance time 1 second ntsc BCC START JMP NTSC PAL LDX 20 CPX #50 ; check rtclok to advance time 1 second pal BCC START NTSC LDX #0 STX 20 ;reset rtclock when wanted number is reached LDX TENSEC ;check if tenseconds is = 5 to advance minute counter CPX #5 BEQ CHTENSEC CONT LDX SECONDS CPX #10 BEQ TENSEC2 LDA SECONDS CLC ADC #16 STA 40220 INC SECONDS JMP START TENSEC2 LDA TENSEC ADC #16 STA 40219 INC TENSEC LDX #1 STX SECONDS LDX #16 STX 40220 JMP START CHTENSEC LDX SECONDS ; check if seconds = 9 to advance minute counter CPX #10 BEQ SETZ JMP CONT MINUTE2 LDA MINUTES ADC #16 STA 40217 INC MINUTES LDX #0 STX TENSEC JMP CONT SETZ LDX MINUTES CPX #9 BEQ MINUTEC CONTR LDX #1 ;reset seconds counter STX SECONDS LDX #0 ; SLOPPY CODE ADJUSTMENT STX TENSEC LDX #16 STX 40220 ; put zeroes on screen STX 40219 INC MINUTES CLC LDA MINUTES ADC #16 STA 40217 ; put minutes on screen JMP START MINUTEC LDX #16 STX 40217 INC TENMIN CLC LDA TENMIN ADC #15 STA 40216 ; put tenminutes on screen LDX #0 STX MINUTES DEC MINUTES ; decrease one for sloppy coding JMP CONTR ; The Display list for GR.0 *=36864 Mylist .Byte 112,112,112 ; three blank lines .byte 66,64,156 ; first is lms command two other is for screen adress (Adress off display list) high byte,lowbyte = low byte,highbyte = 39936 .byte 2,2,2,2,2,2,2,2,2,2,2,2 .byte 2,2,2,2,2,2,2,2,2,2,2 ; 23 times antic mode 2 lines = Basic mode 0 .byte 65,144,0 ; first is jump on vertical blank instructions,2 other is the adress low byte first. the adress for the display list itself
-
Creative computing October 1979 Thoughts? BASIC is always talked about as a stepping stone to Assembly language but it can work the othe way around with Assembly programmers inspired to do ports of creative BASIC games. The 2018 BASIC programing contest is a good recent example with inspiring games and amazing programming techniques.
- 6 replies
-
- Sky Diver
- BASIC Programming
-
(and 2 more)
Tagged with: