Jump to content

bogax

Members
  • Content Count

    902
  • Joined

  • Last visited

Everything posted by bogax

  1. hmm if the download is not working for you you could use the raw button and copy and paste to a text editor and save it as html from there
  2. here's a bit of javascript to generate code http://pastebin.com/6PZ2kLtU save it as html and open it in a browser
  3. I wrote a short routine to test it and apparently rand16 never returns 0 dim rand16 = aux1 scorecolor = $1E COLUPF = $76 for i = 0 to 255 for j = 0 to 255 if rand = 0 then score = score + 1 if !(j & $3F) then drawscreen next score = score + 1000 next scorecolor = $3A loop drawscreen goto loop
  4. despite of what I said here rand actually ranges 1..255 if you set it to 0 it'll stay 0 (its an LFSR) in that link I describe one way. edit if you use rand16, which I recommend, it can (and I assume, does) return 0
  5. or you could actually do it in bB vblank rem ** Enable the TIA bug that causes missile0 to be repeated ; asm ; lda #$ff ; sta HMM0 ; lda #$c0 ; sta WSYNC ; sta HMOVE ; sleep 5 ; sta HMM0 ; end HMM0 = $FF WSYNC = $C0 : HMOVE = $C0 aux1 = $C0 : HMM0 = $C0 return
  6. here I've rearranged your code to be more to my liking I moved the kernel options stuff to the beginning I added a player1color statement I poked holes in player0 so player1 would show through I moved the player0 color assignment (COLUP0 = $00) to just before drawscreen (you'll end up with COLUP0 being the leftover score color from the previous drawscreen otherwise) edit COLUP0 has to be set before the next drawscreen but it doesn't matter where set romsize 2k set kernel_options player1colors pfcolors set optimization inlinerand set optimization speed player1: %00000000 %00011000 %00100000 %01000000 %01110000 %11101000 %10100000 %11100000 end player1color: $42 $44 $46 $48 $4A $4C $4E $50 end player0: %11100111 %10100101 %11101111 %01100100 %01001100 %00000100 %00001111 %00000000 end pfcolors: $00 $1E $1E $1E $00 $92 $D6 $1E $40 $C0 $C0 end playfield: ................................ .........................XXXX... .........................XXXX... .........................XXXX... ................................ ...............................X ..............................XX ............................XXXX .........................XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end COLUBK = $BE player0x=20 player0y=72 loop COLUP0 = $00 drawscreen AUDF0 = 20 AUDC0 = 3 AUDF0 = 3 if joy0left then player0x=player0x-1 if joy0right then player0x=player0x+1 if joy0up then player0y=player0y-1 if joy0down then player0y=player0y+1 player1x=player0x player1y=player0y-2 goto loop
  7. Open System Status Messages DateMessageService 11/06/16 06:10 AM PST: Recent domain name verification emails You may have received an email recently from us with the following subject line: VERIFICATION REQUIRED – Please verify your domain name(s) as soon as possible Please rest assured that these emails are legitimate. ICANN (the governing body for the Internet) requires that all domains have accurate contact information, and we occasionally need to verify this information. Read more in this Help Center article. We ask that you promptly follow the verification instructions in this email. Unverified domains may be suspended until verification is completed. Thank you for your attention to this matter.
  8. oh hell it is my changes temp1digit2 is a 16 bit pointer so it needs two (consecutive) bytes if you specify y it will use y and z specify z and in the version of bB that I'm using it'll use z and aux1 if you're using RevEng's latest and greatest I think he changed that edit since its an alternative to the normal score the logical thing is probably to use the scorepointers so it would be temp1digit2 = scorepointers but I haven't tested that
  9. your temp variable has to be persistent across drawscreens so I don't think that will work if you go into the minkernel and change temp1digit2 = stack1 to, say, temp1digit2 = z it seems to work the minikernel its self uses one stack slot so drawscreen + minikernel must be three that is, one for the call to drawscreen one for drawscreens call to the minikernel and one internal to the minikernel edit it looks to me like the jsr in the minikernel is unneccesary so it could probably be removed (with some other modifications to the minikernel) more edit here I commented some stuff out and moved things around a bit I commented out the four scores stuff and removed the jsr I changed the scores so they use the score variables instead of stack space I used z for temp1digit2 but you could probably use something else you can see if it works for you I didn't test it much even more edit updated to use scorepointers for the temp1digit2 score pointer (instead of z, see below) playerscores_mod.asm
  10. oops you're right I misread it however you use on-gosub in SubPlayerScore and on-gosub uses two it's not hard to rig an equivalent to on-gosub that doesn't use two but it needs a dab of asm and it's a little uglier code wise for your problem you could probably go into the minikernel and give it a different variable than the stack location it uses edit: it looks like the minikernel uses four bytes of stack and you've only got ten drawscreen uses four at least (with the call to the minikernel) sounds like when your code works it's using six so the way I'm figuring it doesn't add up hmm
  11. you're three deep SubMainLoop, SubPlayerScore, SubServeBall and the kernel (drawscreen) uses two.
  12. I think temp7 is only used for bank switching so it's probably safe as long as you're not using multiple banks if all you're doing is drawscreen I think the aux variables (at least some of them) should be safe (they're the bottom of the stack) however they may be used by the kernel depending on the options and of course var44..47
  13. here I've rearranged your code to be more to my liking I moved the kernel options and such to the first thing I removed the multisprite kernel, it doesn't have the options I added player1colors to the kernel options I swapped player0 and player1 'cause player1 has the colors option I turned on the pfscore bar(s) I intialized the left score bar I moved the (setup) stuff that you don't need in the mainloop in to a subroutine at the end I initialized the player0 and player1 locations to where they'd be visible when the game starts I put the player0 and player1 location intialization all on the same line because they're all getting intialized to the same value and it will save time and space (in that case) if they're all (consecutively) on the same line I added actual rem statements to what I took to be rem statements I did not fix player0 to follow player1 don't know what I might have messed up (eg not sure what you had in mind) set tv ntsc set kernel_options player1colors pfcolors pfheights set romsize 4k set smartbranching on const pfscore = 1 rem gamestart gosub setup MainLoop if joy0left then player1x=player1x-1:if player1x<10 then player1x=10 if joy0right then player1x=player1x+1:if player1x>137 then player1x=137 if joy0up then player1y=player1y-1:if player1y<7 then player1y=7 if joy0down then player1y=player1y+1:if player1y>99 then player1y=99 drawscreen goto MainLoop setup pfscorecolor = $26 : pfscore1 = %11111111 player0x = 32 : player0y = 32 : player1x = 32 : player1y = 32 AUDV0 = 6 AUDC0 = 2 AUDF0 = 7 player1color: $40 $40 $40 $40 $40 $00 $06 $06 $02 end rem motorbike player1: %11100000111 %10101110101 %11101000111 %00011101000 %00000101000 %00011010000 %00000010000 %00001111100 %00001000100 end rem player player0: %000001100 %000001000 %000001000 %000001000 %001110000 %001000000 %011111000 %010100000 %011100000 end pfheights: 8 8 8 8 8 8 8 8 8 8 8 end pfcolors: $9C $9A $8A $88 $74 $72 $C4 $C2 $C0 $00 $00 end playfield: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXX XXXXXXXXXXXXXXXXXXXXXXXXX..XXXXX XXXXXXXXXXXXXXXXXXXXXXXX...XXXXX XXXXXXXXXXXXXXXXXXXXXX.....XXXXX XXXXXXXXXXXXXXXXXXX........XXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end return
  14. the kernel uses temp4, temp5 they won't survive drawscreen
  15. Just guessing if you read an item in a table from the next page it takes longer since timing is critical in the kernel bB pads the code with 0s so that (some) tables (eg sprite data) don't cross a page boundary if you remove enough stuff, suddenly the 0 padding disappears and the space left jumps I think you could squeeze out a few more bytes
  16. when I tryed to put stuff in bank 7 DASM complained did you do anything special to get it to work? why not have the sprite addresses in ROM?
  17. more pointing out that they're not very evenly distributed but I don't know what you want
  18. you use return otherbank for the first four ghost routines in bank 5 but I think you only call them from bank 5 if you have a spare bit somewhere use it as a one bit frame counter do two ghosts when it's 0 and the other two when it's 1
  19. rand&108 will produce one of 16 possible numbers 0, 4, 8, 12, 32, 36, 40, 44, 64, 68, 72, 76, 96, 100, 104 or 108 this shows a histogram for the numbers 0..31 R# 0 Is just rand R# 1 is rand & 108 R# 2 is rand & 109 R# 3 is rand & 110 graph_rand0014.bas graph_rand0014.bas.bin
  20. I doubt if the gosubs are much of a problem I notice you're using return otherbank in several place where it looks like you don't need that since the ghosts are moving slowly try increasing the velocity but only moving one ghost per frame
  21. in the standard kernel rand produces a jsr to randomize and produces a new number with the DPC+ kernel it just loads rand unless you've specified inline rand so how often does DPC+ update rand? or does DPC+ not touch rand at all?
  22. it would be something like ; you have to get temp1 in what ever bank has room_shape temp1 = room_shape[room] : goto draw_room_shape bank6 then in bank6 draw_room_shape on temp1 goto rs0 rs1 rs2 rs3 rs4 rs5 rs6 rs7 rs8 rs9 rs10 rs11 rs12 rs13 rs14 rs15 rs16 rs17 rs18 rs19 rs20 rs21 rs22 rs23 rs24 I used rs instead of draw_room_shape because there's a limit to how much you can put on a line if you just have to you can break the line up or there are ways to put/use the addresses (labels) in data statements which involves microscopic amounts of asm I'd just use short labels if possible you could have up to 256 labels in two data statements and data statements can span multiple lines temp2 is right after temp1 the jmp( ) instuction takes the low byte of its target from the location specified (in this case temp1) and the high byte from the following location bB prepends a "." to labels in the asm it emits > specifies the high byte of the (two byte) label, < specifies the low byte so one way to use data statements would be temp2 = labelhi[temp1] : temp1 = labello[temp1] asm jmp(temp1) end data labelhi >.draw_room_shape_0, >.draw_room_shape_1, >.draw_room_shape_2, (etc) . . >.draw_room_shape_24, end data labello <.draw_room_shape_0, <.draw_room_shape_1, <.draw_room_shape_2, (etc) . . <.draw_room_shape_24, end
  23. added a scatter plot mode the scatter plot plots a pixel with x = the previous number and y = the current number it should work now with routines 0..99 although it still has the same 20 you'd need to add a routine and change the Number_of_Rand_Routines constant and change the on_gosub that selects amongst the routines rearranged the function selection now you move right and left to select a function and use up_down to change it there's an indicator for what you're doing/where you are the indicator is just a character or two over the score digits the three score digits on the left are R reseeding enable S scatter table enable L LCG enable 1 is enabled 0 disabled the fourth digit from the left is the rand select R8 0 for 8 bit rand 16 1 for rand 16 L 2 for the LCG the two digits on the right are the routine select number R# (use your imagination) 0..19 if the rand digit is 2 for the LCG that's all you get (no rand8 or rand16) if LCG is selected the LCG enable bit is set (but has no effect) and if the scatter table is enabled it will look up a number using the LCG result (which it didn't do before) otherwise the same rand8 or rand16 get XORed with the LCG if it's enabled the result is run through the scatter table if it's enabled if the LCG is enabled the scatter function just looks up a new value in the scatter table if LCG is disabled it XORs with the previous MyRandSeed value and returns that and uses the result to look up a new MyRandSeed value to XOR with next time (no particular reason for the lag) to switch between histogram and scatter plot hold the joy0fire and the mode will toggle every 2 seconds as indicated by the score color. whatever you release fire on is what you get I also added a bunch of extra wordy names to the code for RT (but no leading under scores, you've got to draw the line somwhere ) edit: fixed a couple bugs now it's perfect so I expect this to be the final version graph_rand0012.bas graph_rand0012.bas.bin
  24. " I had a compiling weirdness. It went suddenly from having 128 or 118 bytes left to -6 or -16 left, " I'd guess you squeezed something something that has to be page aligned and it jumped to the next page boundary
  25. almost done I was thinking of integrating a scatter plot function and maybe a modified score kernel-minikernel to make something less cryptic than numbers for the random number selection fixed some more bugs moved some other stuff to subroutines added comments graph_rand0010.bas graph_rand0010.bas.bin
×
×
  • Create New...