Lillapojkenpåön
-
Content Count
486 -
Joined
Posts posted by Lillapojkenpåön
-
-
34 minutes ago, Pat Brady said:Check out Appendix 3 of the Software Guide, if you haven't already.
I checked it out but I didn't understand much, I don't even know what DMA or a DMA hole is?
-
This was the most problematic zone with both characters and sprites.
Only sprites seems to be a huuge advantage in this case, I'm not even using doublebuffer.
-
1
-
-
The hybrid solution couldn't draw the last character in some zones when I made level 5, the biggest level in the demo.
To bad since I made a pretty dope level loading loop that plotted both sprites and characters from the tiled map.
incgraphic tiles0.png 160A 0 1 2 3 0 rem empty incgraphic tiles1.png 160A 0 1 2 3 2 rem dot incgraphic tiles2.png 160A 0 1 2 3 0 rem blue tile incgraphic tiles3.png 160A 0 1 2 3 1 rem purple tile characterset tiles1 incmapfile level5_offset.tmx ; contains both sprites and characters to plot dim tileMap = $2200 memcpy tileMap level5_offset 208 ;copy tilemap to RAM const _emptyTile = #<(tiles0+0) const _dot = #<(tiles1+0) const _mazeTile1 = #<(tiles2+0) const _mazeTile2 = #<(tiles3+0) const screenYoffset = 16 const screenXoffset = 16 clearscreen for tileMapY = 0 to 12 ; 13 horisontal rows for tileMapX = 0 to 15 ; 16 vertical columns charValue = peekchar( tileMap, tileMapX, tileMapY, 16, 13 ) spriteTileX = tileMapX * 8 + screenXoffset ; convert character column to pixel x pos spriteTileY = tileMapY * 16 + screenYoffset ; convert character row to pixel y pos ; plot tiles from tiled map as sprites if charValue = _mazeTile1 then plotsprite tiles2 0 spriteTileX spriteTileY 0 1 if charValue = _mazeTile2 then plotsprite tiles3 1 spriteTileX spriteTileY 0 1 ; remove those tiles from tiled map if charValue <> _dot then pokechar tileMap tileMapX tileMapY 16 13 _emptyTile next next ; plot remaining dot characters plotmapfile level5_offset.tmx tileMap screenXoffset 1 16 13 savescreen
All sprites works so far, gonna test how many more sprites I can add.
-
1
-
-
1 hour ago, RevEng said:Clearing and redrawing will be too slow. Check out the under the hood demo, which has easy'ish assembly routines to update the Nth plotted sprite in any given zone.
Ah, that's usefull for replacing one tile at a time, but if I wanted all the dots to bounce, is there no other way than to make a nested for loop, look up every tile, and if it's a dot change it? Seems like it would take alot of time? how much time do you have for logic on the 7800 compared to 2600 btw?
And I'm also wondering if since the dot tiles use the same palette, if it would be better to keep them as characters and just use sprites for the palette changing maze tiles?
You have allready mentioned that as one suggestion, but mentioned it could lead to dma problems when adding more enemy sprites or more complex levels, but then you also said this
22 hours ago, RevEng said:If your character graphics didn't change palettes so very frequently, they'd win out over sprites-as-tiles.
So I don't know what's best, I don't think I will add more than one or two more enemies.
I'm gonna experiment with the hybrid approach.
-
Ok, I got a display using only sprites instead, but how do I change it during gameplay?
Do I jump to a routine that clearscreen, update entire screen and savescreen again?
Or how do I remove or change a sprite that has been plotted without just adding sprites on top of sprites, or is that ok?
-
Could an 78b extension be added to the "save as" file types? I believe I have seen a 7800basic in the list once but I think it's only availabe when you open a 78b file, if you open a bas and change the language to 7800basic down in the corner, you still only have the option to save as batari basic.
-
1
-
-
7 minutes ago, RevEng said:There's no hard and fast rule here, but rather some finer grained rules you need to consider for a given game design.
Got it.
7 minutes ago, RevEng said:The problem is that you have more than 256 characters in collisionMap. temp5 is only a byte (0-255) and array lookups are limited to 256 bytes max. It's an efficiency thing.
But you can use peekchar with your collisionMap array if you like. Matt has an example of that in his 7800basic tips, tricks, and examples thread.
Yeah I realized and changed it before you replied, but the peekchar usage is awesome!
-
1
-
-
So the best would be if everything was sprites? Mhm.. here I thought I was being smart avoiding using sprites as much as possible.
I wonder if instead of this..
y = (playerY - screenYoffset) / tileHeight
x = playerX / tileWidth
charValue = peekchar( tilemap, x, y, 20, 27 ) ; top left
if charValue > bgTile then...
..this would work for collisions with the maze?
y = (playerY - screenYoffset) & 240
x = playerX / tileWidth
temp5 = x + y
if collisionMap[temp5] then...
;paint maze with ones here
data collisionMap
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
end
I will have to make my screenheight and playfield a little smaller so it's just 20x12 metatiles if this works
-
7 hours ago, RevEng said:The issue of the sprites disappearing for a frame is related to your frame index, which alternates between 0 and 2, and you have 2 enemy (tallsprite) frames. With the changes in the last version of 7800basic, you should access these 2 frames with a frame parameter of 0 and 1.
I switched back to the old behavior with the setting "set deprecated frameheight" at the top of the source, and the blinking is gone.
I downloaded latest ADS and changed the frame index, it didnt't affect the level three flickering at all for me?
-
I changed the temp variables, that wasn't it, only one color is wrong and it's only after the first fade in, it just stops turning brighter, but for the next levels it works as it should, but nevermind that, It will probably solve itself when the bigger problems gets solved.
Here it is
I would also appreciate any tips for improvements or optimization of the code
-
I get a little flickering of some sprites
$7000 to $7fff used as zone memory, allowing 28 display objects per zone.
with doublebuffer on and
$5000 to $7fff used as zone memory, allowing 43 display objects per zone.
I get allmost, if not exactly the same flickering
Also, when I replaced all drawscreens, like the one in my fade in loop with doublebuffer flip, the colors after my fade in wasn't right, do I need to do something to compensate, like twice as many loops? Or maybe doublebuffer just uses one of the temp variables I'm using
-
Oh ow, to much going on on level three, will doublebuffer help? I tried it but weird graphics slowly takes over the screen, as if something is being overwritten while I play
-
6 minutes ago, SmittyB said:I suppose in that case I'd do it by decrementing a set of delay counters and in those if statements have '&& delayCounter1=0'.
Might not be the most efficient but it would easy to set up and change if needed.
I think I will try that, atleast I can look at it and know what's going on, THANKS!
-
5 minutes ago, SmittyB said:For fade-ins I do pretty much the same as the fade-outs.
To set it up I'll set the actual palettes to black for as long as I need, but then I'll set the temp copies to be #$x0 where x is the colour I want then increment my counters.
Rather than checking if the brightness is greater than 0 I check if it's less that my target brightness for that colour.
customTemp1=$50 : customTemp2 = $A0 : customTemp3 = $90 : customTemp4 = $00 FadeInLoop if customTemp1&#$0F < #$0A then customTemp1=customTemp1+1 if customTemp2&#$0F < #$0B then customTemp2=customTemp2+1 if customTemp3&#$0F < #$06 then customTemp3=customTemp3+1 if customTemp4&#$0F < #$0F then customTemp4=customTemp4+1 P6C2 = customTemp1 P7C2 = customTemp2 P0C2 = customTemp3 P1C2 = customTemp4I think that would increase the brightness for all colors every frame until they reach the target? I need to fade in a different way, imagine the fade out in reverse.
-
1
-
-
I was wondering if you could read half the byte for the brightness, that's very nice!
How do you fade in? That's the trickiest part, I guess there's no easy way, I set the.. registers? to black and variables to the darkest brightness of the color, then use the loop counter to determine when it's time to increase the brightness, and when to update the register from black to the variable.
_P0C1 = $80 : _P0C2 = $80 : _P0C3 = $80 _P1C1 = $a0 : _P1C2 = $a0 : _P1C3 = $a0 P0C1 = $00 P0C2 = $00 P0C3 = $00 P1C1 = $00 P1C2 = $00 P1C3 = $00
fadeIn for temp6 = 0 to 13 if temp6 >= (13 - 6) then P0C1 = _P0C1 if temp6 >= (13 - 9) then P0C2 = _P0C2 if temp6 >= (13 - 13) then P0C3 = _P0C3 if temp6 >= (13 - 6) then P1C1 = _P1C1 if temp6 >= (13 - 9) then P1C2 = _P1C2 if temp6 >= (13 - 13) then P1C3 = _P1C3 ;delay for temp5 = 0 to 1 restorescreen drawscreen next if temp6 > (13 - 6) then _P0C1 = _P0C1 + 1 if temp6 > (13 - 9) then _P0C2 = _P0C2 + 1 if temp6 > (13 - 13) then _P0C3 = _P0C3 + 1 if temp6 > (13 - 6) then _P1C1 = _P1C1 + 1 if temp6 > (13 - 9) then _P1C2 = _P1C2 + 1 if temp6 > (13 - 13) then _P1C3 = _P1C3 + 1 next return thisbank
The brightness is suppose to end on 6, 9 and d, I think it's right?
-
1
-
-
On 11/27/2020 at 2:55 PM, RevEng said:I'm not seeing anything there that should cause freezing or crashing. (assuming your "gosub loadlevel" is being called from the same bank containing loadlevel.
Feel free to shoot me some source in PM, so I can track down the source of the crash.
I don't know what I changed but it works now.
I started working on fade out and fade in routines, for fade out the color goes black after the darkest color, that happens to the darkest colors in the palette first, and they stay black while the other colors keep fading out until all are black, for fade in the brightest colors in the intended palette appears first while the darker ones remain black.. you get the idea.
It's alot of work to get right and I remembered that the NES C library I tried had functions for that
pal_bright(4); // can be a value 0 (all black) to 8 (all white), 4 = normal, the palette as it's defined
with that function it's extremely easy to fade in or out by just making your own little C function and using a variable instead of a number
I guess the palettes gets stored as tables, and then these tables are used to alter those values?
;void __fastcall__ pal_bright(unsigned char bright); _pal_bright: tax lda palBrightTableL,x sta <PAL_PTR lda palBrightTableH,x ;MSB is never zero sta <PAL_PTR+1 sta <PAL_UPDATE rts palBrightTableL: .byte <palBrightTable0,<palBrightTable1,<palBrightTable2 .byte <palBrightTable3,<palBrightTable4,<palBrightTable5 .byte <palBrightTable6,<palBrightTable7,<palBrightTable8 palBrightTableH: .byte >palBrightTable0,>palBrightTable1,>palBrightTable2 .byte >palBrightTable3,>palBrightTable4,>palBrightTable5 .byte >palBrightTable6,>palBrightTable7,>palBrightTable8 palBrightTable0: .byte $0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f ;black palBrightTable1: .byte $0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f palBrightTable2: .byte $0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f palBrightTable3: .byte $0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f palBrightTable4: .byte $00,$01,$02,$03,$04,$05,$06,$07,$08,$09,$0a,$0b,$0c,$0f,$0f,$0f ;normal colors palBrightTable5: .byte $10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$1a,$1b,$1c,$00,$00,$00 palBrightTable6: .byte $10,$21,$22,$23,$24,$25,$26,$27,$28,$29,$2a,$2b,$2c,$10,$10,$10 ;$10 because $20 is the same as $30 palBrightTable7: .byte $30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$3a,$3b,$3c,$20,$20,$20 palBrightTable8: .byte $30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30 ;white .byte $30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30 .byte $30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30 .byte $30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30,$30
If I wanted to do something similar in 7800basic I would start by putting the palettes in tables, but I don't know how to alter it with another brightness table?
If no one else knows then I would like to know how you fade in and out because my way feels wrong, to complicated.
-
1
-
-
How do I plot a new level without the game freezing or crashing?
clearscreen gosub loadLevel savescreen
I load the first level like that before the loop,
but I haven't found any clearscreen/savescreen/restorescreen/drawscreen combo that works for loading a new level?
loadLevel level = level + 1 on level goto _1 _1 _2 _3 _4 _1 memcpy tilemap tiledMap8x8 540 plotmapfile tiledMap8x8.tmx tilemap 0 1 20 27 goto done _2 memcpy tilemap tiledMap8x8 540 plotmapfile tiledMap8x8.tmx tilemap 0 1 20 27 goto done _3 goto done _4 done dotCounter = 0 return thisbank
-
20 hours ago, Synthpopalooza said:Det ser underbart ut!!! 😁
Det är Defender_2600's förtjänst!!
One of my superpowers happens to be playing synthpop on my synthesizer 👆 plink plink, plonk plonk
-
1
-
1
-
-
1 hour ago, Defender_2600 said:Fantastic update!
P.S. I had inserted that pixel (see image) to make the tile more square and symmetrical in the central area. Just my opinion.
BTW I'm sure you noticed the one pixel space between the M and S, and how far the S looks from the E, and how the S seems to need one or two more pixels before it falls over, that stuff bothers me to.
I will try to fix it.
-
4
-
-
It's an awesome time to be a half-decent programmer that likes retro games to, 7800 basic is fantastic, and I really can't believe what mksmith has achieved with Atari Dev Studio WHILE making pretty huge game projects himself, I think I need to learn how to type with more than two fingers.
The original game was just a demo to demonstrate a NES library for the cc65 compiler I believe, but maybe we can add some fun stuff to it, I allready have one idea.
-
7
-
-
I agree it looks better, I was just testing some stuff
-
4
-
1
-
-
WOW! Thanks alot!!!!!! That was exactly what I wished someone would respond, but that was very wishful thinking.
Nailed the colors 👌
-
5
-
-
I am continuing it, just in 160A mode with a 320B top screen routine
I have a question tho, I found some palettes in the C source for chase
const unsigned char palTitle[16]={ 0x0f,0x0f,0x0f,0x0f,0x0f,0x1c,0x2c,0x3c,0x0f,0x12,0x22,0x32,0x0f,0x14,0x24,0x34 }; const unsigned char palGame1[16]={ 0x0f,0x11,0x32,0x30,0x0f,0x1c,0x2c,0x3c,0x0f,0x09,0x27,0x38,0x0f,0x11,0x21,0x31 }; const unsigned char palGame2[16]={ 0x0f,0x11,0x32,0x30,0x0f,0x11,0x21,0x31,0x0f,0x07,0x27,0x38,0x0f,0x13,0x23,0x33 }; const unsigned char palGame3[16]={ 0x0f,0x11,0x32,0x30,0x0f,0x15,0x25,0x35,0x0f,0x05,0x27,0x38,0x0f,0x13,0x23,0x33 }; const unsigned char palGame4[16]={ 0x0f,0x11,0x32,0x30,0x0f,0x19,0x29,0x39,0x0f,0x0b,0x27,0x38,0x0f,0x17,0x27,0x37 }; const unsigned char palGame5[16]={ 0x0f,0x11,0x32,0x30,0x0f,0x16,0x26,0x36,0x0f,0x07,0x27,0x38,0x0f,0x18,0x28,0x38 }; const unsigned char palGameSpr[16]={ 0x0f,0x0f,0x29,0x30,0x0f,0x0f,0x26,0x30,0x0f,0x0f,0x24,0x30,0x0f,0x0f,0x21,0x30 };
I don't know if they are PAL or NTSC colors, but if I just remove the 0x part and assume NTSC I can't find all the needed colors,
is there some other way to convert the colors?
-
5
-
-
Ok, with the graphics I make in the sprite editor I sometimes can clearly see that the darkest and brightest colors should be flipped when I run it, my palettes are allways darkest to brightest, so I switch the 1 and 3 in the incgraphic, and it's still not right, can that even happen or am I going colorblind?

Chase
in Atari 7800 Programming
Posted
Man that's some unusual tilesizes you got 🙂 I played through the entire millie & molly demo but I just enjoyed the game so I'm gonna have to do it again and see what you're doing, I really wanted to keep playing when the demo ended btw☹️
The background pattern and the dot is one tile, when I animated them before with characters it was pretty easy, I just copied the tiles to ram and set the charbase high byte thingy to look for them there, the low byte is in the tiled map table, so nothing is changed in the map itself, just at the location it looks for the tile I originally used when making the map in tiled, I think I just copy pasted the code from SmittyB. I could maybe just had two blocks with the same tiles except for that one and switched between them, that would have been really fast. I'm looking forward to trying the underthehood stuff when I get it to work.
Is there something in the assembly that doesn't like that my screenheight is 224? I can get the player x and y position conversion right by doing some unexplainable +1 and -2, but it changes the tile two columns to the right when I'm on the top and bottom row?
My radioclock just started playing music, 06:30, time to give up.