+Random Terrain Posted March 8, 2019 Share Posted March 8, 2019 I'd like to display a sprite in RAM using the standard kernel and let the user draw a pixel or erase a pixel when the fire button is pressed. The current pixel would slowly flash on and off, but the official off/on state of the pixel would be remembered when the user moves the joystick to select another pixel. Holding down the fire button and moving left or right would change the NUSIZ width (normal/double/quad) like you can do here. Could the score be adapted to show the 8 bits of the current row that the flashing pixel is on? If the score can't be used, can something else be used? Update Finished version is here: atariage.com/forums/topic/289171-draw-sprites-on-your-atari-2600/ Quote Link to comment Share on other sites More sharing options...
Trip2018 Posted March 9, 2019 Share Posted March 9, 2019 (edited) Not sure if it's possible in bb alone might wanna try asm. Have thought about it myself Edited March 9, 2019 by Trip2018 Quote Link to comment Share on other sites More sharing options...
Mr SQL Posted March 9, 2019 Share Posted March 9, 2019 I'd like to display a sprite in RAM using the standard kernel and let the user draw a pixel or erase a pixel when the fire button is pressed. The current pixel would slowly flash on and off, but the official off/on state of the pixel would be remembered when the user moves the joystick to select another pixel. Holding down the fire button and moving left or right would change the NUSIZ width (normal/double/quad) like you can do here. Could the score be adapted to show the 8 bits of the current row that the flashing pixel is on? If the score can't be used, can something else be used? This is a cool concept RT and an awesome question because it is imo a limitation where you would need a kernel designed to read RAM sprites and not RAM pointers to ROM. Flashback BASIC and SuperCharger BASIC allow what you described and the kernels are portable if anyone would like to implement them for bB. You can manipulate each row of the sprites as RAM array variables or print binary strings on them using the print command: print %11111111(player0,0):rem print binary on top row of player 1 sprite. player0(0)=%11111111:player0(1)=255: rem or control the rows of the sprite via array assignment The background playfield camera view is 20x10 and could be used to mirror what is going on in the sprite. You can control the sprite rows RAM based colors the same way player0colors(0)=$ff:player0colors(1)=100: color the first two rows of sprite 0 rowcolors(0)=$ff:rem color the top row of the playfield CAM If you like these features and want to try these BASIC's you could enter the 10 line programming contest with a small BASIC game, maybe one that utilizes that kind of sprite manipulation: http://atariage.com/forums/topic/288999-ideas-for-10-line-basic-games-for-the-atari-2600/ Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted March 9, 2019 Author Share Posted March 9, 2019 If you like these features and want to try these BASIC's you could enter the 10 line programming contest with a small BASIC game, maybe one that utilizes that kind of sprite manipulation: Thanks, but it doesn't work on my Windows 8 computer without a bunch of hassles. I tried a few years ago and gave up. I need something that I can simply download and run after a few easy setup options. Quote Link to comment Share on other sites More sharing options...
RevEng Posted March 9, 2019 Share Posted March 9, 2019 This is easiest using SC RAM. Here's a program that displays a RAM sprite in the standard kernel, and updates the score from a value. SC_RAM_player_and_value_to_score.bas I used an assembly subroutine for the latter, because it was more cycle efficient and compact than the equivalent bB code would be. I didn't do any of that cursor stuff, or NUSIZ changes. With the sample code as a start, you can probably figure that out. I think I'd punt on the cursor and use a missile instead, but it's your cake to bake. 1 Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted March 9, 2019 Author Share Posted March 9, 2019 Thanks. I think I should have explained better. Say I draw an image in the RAM sprite that looks like this: If I move my flashing "cursor" or missile or ball to the top row, the score (or something else) would display this: 00111100 If I move down one row, this would be displayed: 01111110 Down again: 11011011 And so on. If I move to the top row and draw a pixel in the top left, the number would change from 00111100 to 10111100. Quote Link to comment Share on other sites More sharing options...
Mr SQL Posted March 9, 2019 Share Posted March 9, 2019 Thanks, but it doesn't work on my Windows 8 computer without a bunch of hassles. I tried a few years ago and gave up. I need something that I can simply download and run after a few easy setup options. The BASIC should work fine on any Windows Machine with nothing to install as long as the PowerShell ISE is present, that's what it uses as the IDE. The quickstart guide should help you setup, there's only a single step to enable the compiler. Quote Link to comment Share on other sites More sharing options...
RevEng Posted March 9, 2019 Share Posted March 9, 2019 Ah, in my case I'm outputting the Sprite line contents in decimal. The score is only 6 digits, so binary representation is more complicated. For starters you'd need custom score graphics. Any reason why you couldn't use playfield instead? The on off pattern would correspond to 1s and 0s. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted March 9, 2019 Author Share Posted March 9, 2019 The BASIC should work fine on any Windows Machine with nothing to install as long as the PowerShell ISE is present, that's what it uses as the IDE. The quickstart guide should help you setup, there's only a single step to enable the compiler. Nope: atariage.com/forums/topic/251729-try-a-fun-programming-language-tiny-basic/?p=3496817 Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted March 9, 2019 Author Share Posted March 9, 2019 Ah, in my case I'm outputting the Sprite line contents in decimal. The score is only 6 digits, so binary representation is more complicated. For starters you'd need custom score graphics. Any reason why you couldn't use playfield instead? The on off pattern would correspond to 1s and 0s. I could also use pfscore bars, but it would be hard to tell many zeros in a row or many ones in a row. There soon might be, but at this time, there is no sprite editor that lets you draw a sprite in the three different widths that also shows you exactly what it will look like on the Atari. I'd like to draw directly on the Atari 2600 screen in any of the 3 widths and get the 8 ones and zeroes to type into my batari Basic program. Looks like the screen is wide enough to make eight readable zeroes and ones with the playfield: So I could basically "print" the 8 numbers on the screen whenever I move to a new row or change a pixel. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted March 9, 2019 Author Share Posted March 9, 2019 The most important thing is happening so far. I'm drawing inside of the sprite. It's pretty fun. I think people will like playing around with this when I get done adapting your program. 1 Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted March 9, 2019 Author Share Posted March 9, 2019 Here's a goofy question. I'm working on that single sprite program, but it might also be good to make a version that has two sprites next to each other. If the sprites aren't as tall, is it possible to have two sprites in RAM? I'm not sure how to change the pointers. Quote Link to comment Share on other sites More sharing options...
RevEng Posted March 9, 2019 Share Posted March 9, 2019 This would give player0 the first half of the SC ram, and player1 the second half... rem ** get lo and hi address of the last read address of the SC RAM... const rpoint0lo = <r000 const rpoint0hi = >r000 const rpoint1lo = <r064 const rpoint1hi = >r064 rem ** set player0 pointer to the last read address of the SC RAM... player0pointerlo=rpoint0lo player0pointerhi=rpoint0hi player1pointerlo=rpoint1lo player1pointerhi=rpoint1hi You'd need to modify the Y position of the sprites higher up the screen, and set the player#height's to 64. 1 Quote Link to comment Share on other sites More sharing options...
bogax Posted March 9, 2019 Share Posted March 9, 2019 (edited) here's one I flickered the pixel if you hold the fire button for couple seconds you cycle NUSIZE when the fire button is released (unless you hold it too long then the timer will roll over ) other wise you flip the pixel sprite_in_RAM.bas sprite_in_RAM.bas.bin Edited March 9, 2019 by bogax 3 Quote Link to comment Share on other sites More sharing options...
Mr SQL Posted March 10, 2019 Share Posted March 10, 2019 Nope: atariage.com/forums/topic/251729-try-a-fun-programming-language-tiny-basic/?p=3496817 Took a look at that thread and you're really close - you actually compiled the program to a binary that would run on the 2600. The red error message was because you hadn't copied Stella.exe to c:\vwbasic\Stella\Stella.exe Thanks for pointing that out, I should modify the quickstart guide to make it clear you need to copy Stella or write a routine to find and map a path to Stella the 1st time around. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted March 10, 2019 Author Share Posted March 10, 2019 Finished version is here: http://atariage.com/forums/topic/289171-draw-sprites-on-your-atari-2600/ 2 Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted March 11, 2019 Author Share Posted March 11, 2019 Finished version is here: http://atariage.com/forums/topic/289171-draw-sprites-on-your-atari-2600/ Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted March 11, 2019 Author Share Posted March 11, 2019 Finished version is here: http://atariage.com/forums/topic/289171-draw-sprites-on-your-atari-2600/ 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.