;Duelito ;©1999 Bokudono. ;(this "game" can be freely copied and modified, I only wanted to see ;my name next to ©). ; ;I use TASM. The directives are for it. This file can be assembled with ;"tasm -65 -b -f00 duelito.asm" and will work inmediately, just changing ;the name from .obj to .nes. ; ;These are the variables. The number is the memory address. I use these ;directives to make this easier. All begin with V for avoid confusion with ;labels for jumping or constants (begin with C). Vcontrol1 =0 ;joypad Vcolgomba =1 ;column of goomba Vlingomba =2 ;line of goomba Vcolmario =3 ;column of mario Vlinmario =4 ;line of mario Vstatsmario =5 ;(mariodead,left,mariocantjump,mariojumps,tile+8,tile+4,nomove,left) ;This is the status of Mario. The bits are flags for the following: ;bit 7 Mario is dead. ;bit 6 Mario is walking to the left. ;5 Mario cant jump (the use of 2 flags/variables is for allowing ; variable height jumps). ;4 Mario is jumping. ;3 For the animation while walking, tile number is increased ; 8 (00001000b). This is not a recommended form of doing an animation, ; due to its inflexibility. ;2 The same, but only 4. Mario is made of 4 tiles, so this shows the ; next image. ;1 Mario is not walking nor jumping. ;0 Same as bit 6. Vcont =6 ;a counter Vaux =7 ;an auxiliar which is loaded with several things Vjmpheitmario =8 ;height of mario jump Vjmpheitgomba =9 ;height of goomba jump. In fact he jumps always the ; same height, but I copied the mario part. Vstatsgomba =0Ah ;(goombadead,0,0,0,0,0,goombacantjump,goombajumps) ; Goomba status. Cfloorlevel =8Bh ;height of the floor for mario and goomba. It is ; a constant for quick adjustment. ; ; ; ; .org 7FF0h ;iNES header .db 4eh,45h,53h,1ah,2h,0,0,0,0,0,0,0,0,0,0,0 ; ; ;the code begins at 8000h ; begin ldx #0FFh ;reset stack txs ;this must be done always to begin ; vblank lda 2002h ;wait for vblank bpl vblank ; lda #00000000b ;control PPU 1 sta 2000h lda #10011110b ;control PPU 2 sta 2001h ; lda #0 ;address of the patterns sta 2006h sta 2006h ; ldx #0 ;this loop copies patterns to the pattern table tilecopy1 lda 9000h,x sta 2007h inx cpx #0F0h bne tilecopy1 ; ldx #0 ;continue tilecopy2 lda 90F0h,x sta 2007h inx cpx #0F0h bne tilecopy2 ; lda #20h ;Name table address. This is for the place where sta 2006h ;floor begins. In NESticle it appears lower than lda #0A0h ;where it is supposed to be set, so the code sta 2006h ;seems to produce a higher floor (as can be seen in ; FWNES). ldy #6 ;a loop to write the floor. Since the tile numbers rocks ldx #10h ;are 18h,19h,1Ah and 1Bh, rocks1 lda #18h ;this writes a row of sta 2007h ;18h,19h,18h,19h,18h,19h,... lda #19h ;(length of screen is 32 / 20h tiles) sta 2007h dex bne rocks1 ldx #10h rocks2 lda #1Ah ;and another of sta 2007h ;1Ah,1Bh,1Ah,1Bh,1Ah,1Bh,... lda #1Bh sta 2007h dex bne rocks2 dey ;As X is a counter for a pair of tiles, Y is a bne rocks ;counter for a pair of rows. This is supposed to ; make 6 rows of 4X4 tile blocks, but NESticle does ; not. lda #23h ;attribute table sta 2006h lda #0C0h sta 2006h ; ldx #40h ;loop to set all high bit color to 0 lda #00000000b attribs sta 2007h dex bne attribs ; lda #3Fh ;background palette sta 2006h lda #0h sta 2006h ; lda #21h ;color values. Use Chris Covell's RGB to see the sta 2007h ;colors lda #0Fh sta 2007h lda #16h sta 2007h lda #38h sta 2007h ; lda #3Fh ;sprite palette sta 2006h lda #10h sta 2006h ; lda #21h ;goomba colors sta 2007h lda #16h sta 2007h lda #38h sta 2007h lda #0Fh sta 2007h ; lda #21h ;mario colors sta 2007h lda #16h sta 2007h lda #27h sta 2007h lda #18h sta 2007h ; initvar lda #0B0h ;initialize variables sta Vcolgomba lda #Cfloorlevel sta Vlingomba lda #50h sta Vcolmario lda #Cfloorlevel sta Vlinmario lda #00000000b sta Vstatsmario lda #0 sta Vcont sta Vjmpheitgomba sta Vstatsgomba lda #Cfloorlevel sta Vjmpheitmario jmp mainloop ;jump to main loop ;--------------------------------------------------- ;--------------------------------- ; Mario Jump mariosturn lda Vstatsmario ;check if Mario is walking and #2 beq activemario jmp lazymario ;if he isn't, go to Mario not moving ; activemario lda Vstatsmario ;if he is, check if he is jumping and #10h beq notjumping ; lda Vlinmario ;if he is, compare his position with the cmp Vjmpheitmario ;height of jump bmi toohigh ; dec Vlinmario ;if he is still below the height, move he up jmp jumpmario ;a pixel, and go to sprite assignment ; ; toohigh lda Vstatsmario ;if he passed the limit, and #11101111b ;set him to "not jumping" sta Vstatsmario ; lda #20h ;and to "can't jump" ora Vstatsmario sta Vstatsmario ; notjumping lda Vlinmario ;if he is not jumping, check if he is cmp #Cfloorlevel ;on the ground beq onground ; inc Vlinmario ;if not, move him down a pixel and go to jmp jumpmario ;sprite assignment ; onground lda Vstatsmario ;if he is on the ground, and #11011111b ;set him to "can jump" sta Vstatsmario ; lda #Cfloorlevel ;and jump height to floor sta Vjmpheitmario jmp walkmario ;and go to sprite assignment ;---------------------------- ;---------------------------------------------- Main Loop mainloop inc Vcont ;counter lda Vcont ;only need a loop of 32 times and #00011111b bne no0 ;reset mario image cycle every 32 times lda Vstatsmario and #11110011b sta Vstatsmario lsr ;???? (maybe I changed the code and this was left behind). bpl gogoomba ;Unconditional branch. It's the same as ; "jmp gogoomba". The bit 7 of Vstatsmario was cleared, ; so the program will always go to gogoomba. I used ; this because a branch is faster than a jump. Well, ; actually this little detail won't affect the speed, ; but it is a good habit, I think. no0 cmp #12 ;Is the counter 12 (8+4)? bne no4 lda #4 ;if yes, the 2nd image will be used (sets the bit 3 ora Vstatsmario and #11110111b ;and clears the bit 4) sta Vstatsmario bne gogoomba ;another unconditional branch no4 cmp #24 ;Is the counter 24? bne gogoomba lda #8 ;if yes, the 3rd image will be used (see above) ora Vstatsmario and #11111011b sta Vstatsmario ; ; ;-------------------------- gogoomba lda Vcont ;goomba walks every 2 cycles and #1 beq continue ; lda Vstatsgomba ;if goomba is dead, doesn't walk bmi continue ; lda Vcolgomba ;if the distance between goomba and mario is less sbc Vcolmario ;than 24h (48h is used, for left and right), cmp #48h bpl toofar lda Vstatsgomba ;then goomba jumps and #2 ;but first we must check he isn't already jumping bne toofar ora #1 sta Vstatsgomba toofar lda Vcolgomba ;jumping or not, compare goomba column cmp Vcolmario ;with mario to follow him bmi gombalftmario dec Vcolgomba bne compcol ;I planned this to be an unconditional ; branch, but is the reason of the bug that ; makes impossible to cross the left side of ; the screen. I didn't realized that until now. gombalftmario inc Vcolgomba ; ; ; compcol ldx #1Bh ;are they together? lda Vcolmario ;This checks a range of 14 (0Eh) columns around Mario. clc ;Since the column number is the left border of both adc #0Eh ;images, first we add 14... tay samecolumn cpy Vcolgomba ;and compare 27 times, beq itssamecol dey ;decreasing the column one by one (Y is used because dex ;A can't be decreased). bne samecolumn beq continue ;continue when loop ends ; ; itssamecol ldx #8 ;They are together, so we'll check if Mario lda Vlinmario ;is over Goomba. clc adc #0Fh ;similar to the column comparison, but not tay ;to both sides. marioover cpy Vlingomba beq mariowins ;if yes, Mario wins dey dex bne marioover ; ; ldx #15h ;Now to check if Goomba is over Mario mariounder cpy Vlingomba beq mariodied dey dex bne mariounder beq continue ; ; ; mariowins lda #60h ;Mario won sta Vjmpheitmario ;this little jump makes Mario rebound lda Vstatsmario and #11011111b ora #10h sta Vstatsmario ; lda Vstatsgomba ;set Goomba to "dead" ora #80h sta Vstatsgomba jmp continue ; ; mariodied lda #80h ;Mario lost ora Vstatsmario ;set to "dead" sta Vstatsmario ; ; ; continue jsr delay ;continue main loop. Spend some time. ; lda Vstatsgomba ;Check if Goomba is dead bpl spcmustcont ;if not, continue main loop ; lda Vlingomba ;compare goomba line with floor cmp #Cfloorlevel bmi fallcorpse ;if goomba is still in air, fall ; lda Vstatsmario ;if goomba fell, but mario is still in air, and #30h ;continue main loop bne spcmustcont ; lda Vstatsmario ;if both are in ground, set Mario as "dead" ora #80h ;to stop action sta Vstatsmario jmp gameover ; fallcorpse inc Vlingomba ;goomba falls ; ; ; ; spcmustcont jsr readjoypad1 ;continue main loop. Read the joypad buttonornot lda Vcontrol1 ;check if any button is pressed and #0FFh ;this is of no use, I forgot to delete it bne wouldberight ;if any button pressed, go check which one ; lda Vstatsmario ;if no button is pressed, check if mario and #00110000b ;is jumping bne wouldberight ;if he is, continue ; lda Vstatsmario ;if not, check if he is dead bmi gameover ; lda #2 ;if not, set him as "no movement" ora Vstatsmario sta Vstatsmario lsr ;seems I used this for an unconditional branch, ; but since Mario is not dead, this is not ; necessary. And is better to use JMP instead ; of 2 instructions. bpl fin ;unconditional branch ; ; wouldberight lda Vstatsmario ;set Mario to "movement" and #11111101b sta Vstatsmario ; lda Vcontrol1 ;check if right pressed and #1 beq noright ; inc Vcolmario ;if yes, move Mario to right, and lda #10111110b ;set him to "facing right" and Vstatsmario sta Vstatsmario ; ; noright lda Vcontrol1 ;check if left pressed and #2 beq noleft ; dec Vcolmario ;if yes, move Mario to left, and lda #01000001b ;set him to "facing left" ora Vstatsmario sta Vstatsmario ; ; noleft lda Vcontrol1 ;check if A pressed and #80h beq noAbutton ; lda Vstatsmario ;check if he is already jumping, he can't and #20h ;jump higher bne noAbutton ; lda Vstatsmario ;set him to "jumping" ora #10h sta Vstatsmario ; lda Vjmpheitmario ;check if the height of the jump he'll do cmp #50h ;is not too much (50h is the top line) bmi noAbutton dec Vjmpheitmario ;if not, decrease the line that he'll reach ; ; noAbutton lda Vstatsmario ;check if Mario is dead bpl fin ; jsr readjoypad1 ;read joypad lda Vcontrol1 ;check if Start is pressed and #10h beq gameover ;if not, stay here jmp begin ;if yes, begin again gameover jmp noAbutton ;this seems to be of no use, maybe would be ; better BEQ noAbutton above, but... ; fin jmp gomba ;go to sprite assignment ;-------------------------------------------------------------------------- ; SUBROUTINES ;-------------------------------------------------------------------------- ;------------------------------------------ Read joypad 1 readjoypad1 lda #1 ;reset joypad 1 sta 4016h lda #0 sta 4016h ; sta Vcontrol1 ;and clear the variable ; ; ldx #8 ;a loop to read 8 times, bit by bit ; control1 lda 4016h ;use only the last bit and #1 ; ora Vcontrol1 ;insert it in the variable ; asl A ;move it a position to left ; sta Vcontrol1 ;store in memory ; dex ;loop control bne control1 ; ; the first bit read (button A) was shifted ; to C, so we need to recover it bcc nobuttona ;if it is 0, there is no need for the next ; lsr A ;shift back to right ora #10000000b ;insert 1 in bit 7 bne endbuttona ;unconditional branch ; nobuttona lsr A ;if the bit is 0, simply shift back ; endbuttona sta Vcontrol1 ;store in the variable ; rts ;go back ;------------------------------------------ Delay delay pha ;save in stack A and X. In fact this is not needed, txa ;since the only point from this subroutine is called pha ;not needs preservation of the values in A and X. ; ldx #0FFh ;a loop of 255 cycles ; delaycycle lda 8000h,X ;this instruction is used because is one of the dex ;slowest bne delaycycle ; pla ;recover X and A tax pla rts ;go back ;-------------------------------------------------- ; SPRITE ASSIGNMENT ;-------------------------------------------------- ;In fact these are not subroutines. I copied the blocks ;from the main loop here to keep the program intelligible. ;Also, the sprite assignment is only efficient in walking Mario. ;To understand Mario, look first at standing Mario. Walking is complex (it ;can be done in a simpler way, but I wanted efficient code). ;------------------------------------------- Mario walks walkmario lda 2002h ;wait for vblank bpl walkmario ; ; The sprite number is not assigned because ; Goomba's part is always executed first ;sprite 1 lda Vlinmario ;line number sta 2004h ; clc ;use Mario status to decide the frame lda #00001100b ;depending on timing, 0, 4 or 8 will be and Vstatsmario ;added to the tile number (Mario is made ; up of 4 tiles, adding 4 is to use next ; image and 8 for the other) adc #7 ;tile number of first image sta Vaux ;save tile number ; lda #1 ;if he is facing right, A will be 0; and Vstatsmario ;otherwise A will be 1 ; clc ;add tile number. If Mario is facing left, adc Vaux ;this will add 1 to tile number sta 2004h ; lda Vstatsmario ;use status to set "flip x" in 0 or 1 and #01000000b ; ora #00000001b ;and use next 4 colors sta 2004h ; lda Vcolmario ;column number sta 2004h ; ;sprite 2 lda Vlinmario ;line sta 2004h ; clc lda #1 ;choose frame, as above. and Vstatsmario sta Vaux lda #00001100b ;+4 o +8 and Vstatsmario adc #8 ;tile 8 (the second) sec sbc Vaux ;if he is facing left, substract 1 to tile sta 2004h ;number ; lda Vstatsmario ;set flip x and #01000000b ora #00000001b ;use next 4 colors sta 2004h ; lda Vcolmario ;add 8 to column clc adc #8 sta 2004h ; ;sprite 3 lda Vlinmario ;line+8 clc adc #8 sta 2004h ; clc ;the same lda #00001100b ;+4 o +8 and Vstatsmario adc #9 ;numtile sta Vaux lda #1 ;left? and Vstatsmario clc adc Vaux sta 2004h ; lda Vstatsmario ;set flip x and #01000000b ora #00000001b ;colors sta 2004h ; lda Vcolmario ;column sta 2004h ; ;sprite 4 lda Vlinmario ;line+8 clc adc #8 sta 2004h ; clc ;this again lda #1 ;left? and Vstatsmario sta Vaux lda #00001100b ;+4 o +8 and Vstatsmario adc #0Ah ;numtile sec sbc Vaux sta 2004h ; lda Vstatsmario ;flip x and #01000000b ora #00000001b sta 2004h ; lda Vcolmario ;column+8 clc adc #8 sta 2004h ; jmp mainloop ;return to main loop ;------------------------------------------ Mario is standing lazymario lda 2002h ;wait for vblank bpl lazymario ; ;sprite 1 lda Vlinmario ;line sta 2004h ; lda #1 ;if he is facing left, add 1 to tile number and Vstatsmario clc adc #0Bh ;tile number sta 2004h ; lda Vstatsmario ;use status to set "flip x" and #01000000b ora #00000001b ;use 2nd group of 4 colors sta 2004h ; lda Vcolmario ;column sta 2004h ; ;sprite 2 lda Vlinmario ;line sta 2004h ; lda #1 ;if he is facing left, substract 1 from and Vstatsmario ;tile number sta Vaux sec ;this probably is not needed, but... lda #0Ch sbc Vaux sta 2004h ; lda Vstatsmario ;set flip x and colors and #01000000b ora #00000001b sta 2004h ; lda Vcolmario ;column+8 clc adc #8 sta 2004h ; ;sprite 3 lda Vlinmario ;line+8 clc adc #8 sta 2004h ; lda #1 ;left? and Vstatsmario clc adc #0Dh sta 2004h ; lda Vstatsmario ;flip and #01000000b ora #00000001b sta 2004h ; lda Vcolmario ;column sta 2004h ; ;sprite 4 lda Vlinmario ;line+8 clc adc #8 sta 2004h ; lda #1 ;left? and Vstatsmario sta Vaux sec lda #0Eh sbc Vaux sta 2004h ; lda Vstatsmario ;flip and #01000000b ora #00000001b sta 2004h ; lda Vcolmario ;column+8 clc adc #8 sta 2004h ; jmp mainloop ;return to main loop ;--------------------------------------- Mario jumps ;This is the same as "Mario is standing". I'm tired of typing the same thing. jumpmario lda 2002h bpl jumpmario lda Vlinmario ;(0:mario0) sta 2004h lda #1 ;volteado and Vstatsmario clc adc #13h sta 2004h lda Vstatsmario ;volteado and #01000000b ora #00000001b sta 2004h lda Vcolmario sta 2004h lda Vlinmario ;(1:mario0) sta 2004h lda #1 ;volteado and Vstatsmario sta Vaux sec lda #14h sbc Vaux sta 2004h lda Vstatsmario ;volteado and #01000000b ora #00000001b sta 2004h lda Vcolmario clc adc #8 sta 2004h lda Vlinmario ;(3:mario0) clc adc #8 sta 2004h lda #1 ;volteado and Vstatsmario clc adc #15h sta 2004h lda Vstatsmario ;volteado and #01000000b ora #00000001b sta 2004h lda Vcolmario sta 2004h lda Vlinmario ;(4:mario0) clc adc #8 sta 2004h lda #1 ;volteado and Vstatsmario sta Vaux sec lda #16h sbc Vaux sta 2004h lda Vstatsmario ;volteado and #01000000b ora #00000001b sta 2004h lda Vcolmario clc adc #8 sta 2004h jmp mainloop ;-------------------------------------- Goomba gomba lda 2002h ;wait for Vblank bpl gomba ; lda Vstatsgomba ;check if is alive bpl goombaalive jmp goombadied ; goombaalive lda Vstatsgomba ;if goomba is alive, then and #1 ;check if he is jumping beq hnojumping ; lda Vlingomba ;if he is, compare height with 50h cmp #50h bmi htoohigh ; dec Vlingomba ;if he still is below the 50h line, go up jmp jumpgomba ; htoohigh lda Vstatsgomba ;if he passed the 50h limit, and #11111110b ;set him to "not jumping" sta Vstatsgomba ;(to stop elevation) ; lda #2 ;and to "can't jump" ora Vstatsgomba ;(this is probably not necessary, but sta Vstatsgomba ;I copied the code for Mario) ; hnojumping lda Vlingomba ;if he is not jumping, check if he is on cmp #Cfloorlevel ;the floor beq honground ; inc Vlingomba ;if not, make him fall a pixel jmp jumpgomba ; honground lda Vstatsgomba ;if he is on the ground, set him to and #11111101b ;"can jump" sta Vstatsgomba ; ; ; jumpgomba ;This is the sprite assignment for Goomba ;assign sprite 1 lda #0 ;the sprite number is 0 (the first). Later it sta 2003h ;increases automatically. ; lda Vlingomba ;set line number sta 2004h ; lda #4 ;tile number sta 2004h ; lda #0 ;attributes sta 2004h ; lda Vcolgomba ;column sta 2004h ; ;sprite 2 lda Vlingomba ;line sta 2004h ; lda #4 ;tile number (is the same tile) sta 2004h ; lda #01000000b ;attributes (flip x, the other side of his face) sta 2004h ; lda Vcolgomba ;add 8 (tile size) to column number clc adc #8 sta 2004h ; ;sprite 3 lda Vlingomba ;add 8 (tile size) to line number clc adc #8 sta 2004h ; lda Vstatsmario ;use Mario status for animation and #4 ;and check if he is on 2nd frame bne novcont1 ; lda #6 ;if Mario is not in 2nd frame, use... bne sivcont1 ;(unconditional branch) ; novcont1 lda #5 ;if Mario is in 2nd frame, use the tile 5 sta 2004h lda #0 ;and "no flip x" in attributes beq snvcont1 ;(unconditional branch) ; sivcont1 sta 2004h ;...next tile, and set lda #40h ;attributes to "flip x" snvcont1 sta 2004h ; lda Vcolgomba ;column sta 2004h ; ;sprite 4 lda Vlingomba ;add 8 to line clc adc #8 sta 2004h ; lda Vstatsmario ;the same as above, but to the other side and #4 bne novcont2 ; lda #5 ;if Mario=2nd frame, use previous tile bne sivcont2 ; novcont2 lda #6 ;if not, use the normal one (6) sta 2004h lda #0 ;and no flip beq snvcont2 ; sivcont2 sta 2004h lda #40h ;use flip ; snvcont2 sta 2004h ; lda Vcolgomba ;add 8 to column clc adc #8 sta 2004h ; ; jmp mariosturn ;go to actions of Mario ; ; ; ; If Goomba is dead goombadied lda #0 ;the first sprite (as above) sta 2003h ;sprite 1 lda Vlingomba ;line sta 2004h ; lda #0 ;tile number is 0 (empty). Goomba is half-size now, sta 2004h ;but since position is related to the firts tile, ; continues using 4. ; lda #0 ;attributes sta 2004h ; lda Vcolgomba ;column sta 2004h ; ;sprite 2 lda Vlingomba ;same as above sta 2004h lda #0 sta 2004h lda #01000000b sta 2004h lda Vcolgomba clc adc #8 sta 2004h ; ;sprite 3 lda Vlingomba ;line+8 clc adc #8 sta 2004h ; lda #17h ;tile number (squashed goomba) sta 2004h ; lda #0 ;attributes sta 2004h ; lda Vcolgomba ;column sta 2004h ; ;sprite 4 lda Vlingomba ;line+8 clc adc #8 sta 2004h ; lda #17h ;tile sta 2004h ; lda #01000000b ;flip x sta 2004h ; lda Vcolgomba ;column+8 clc adc #8 sta 2004h ; jmp mariosturn ;go to mario actions ;--------------------------------------------------------- ; GRAPHICS ;-------------------------------------------------------- ;I included the graphics here for quick debugging. ;Another reason is that "copy duelito.obj+duelito.chr duelito.nes" is not ;working. Only the second file is copied. Anybody knows why? .org 9000h ;begin in 9000h ;0(numtile) .db 0,0,0,0,0,0,0,0 .db 0,0,0,0,0,0,0,0 ;1 .db 0,0,0,0,0,0,0,0 .db 0,0,0,0,0,0,0,0 ;2 .db 0,0,0,0,0,0,0,0 .db 0,0,0,0,0,0,0,0 ;3 .db 0,0,0,0,0,0,0,0 .db 0,0,0,0,0,0,0,0 ;4 .db 00000011b,00000111b,00001111b,00011111b,00111111b,01110111b,01110111b,11110101b ;gomba(0) .db 0,0,0,0,00011000b,00001100b,00001111b,00001110b ;5 .db 11110001b,0FFh,01111000b,0,0,00011000b,00011100b,00001110b ;gomba(1) .db 00001110b,0,00000111b,00001111b,00001111b,00011111b,00011111b,00001110b ;6 .db 10001111b,0FFh,00011110b,0,00001100b,00111110b,01111110b,01111100b ;gomba(2) .db 01110000b,0,11100000b,11110000b,11111100b,11111110b,11111110b,01111100b ;7 .db 7h,0Fh,14,14h,00010110b,18h,0,3Fh ;mario0(0) .db 0,0,0Fh,1Fh,1Fh,1Fh,7h,3Ch ;8 .db 0C0h,0F8h,40h,40h,20h,78h,0,0C0h ;mario0(1) .db 0,0,0E0h,0F8h,0FCh,0F8h,0F0h,0C0h ;9 .db 3Fh,0Eh,0Fh,1Fh,3Fh,7Ch,70h,38h ;mario0(2) .db 0FCh,0EDh,0C0h,0,0,60h,70h,38h ;A .db 0F0h,0F8h,0E4h,0FCh,0FCh,7Ch,0,0 ;mario0(3) .db 7Eh,1Eh,4h,0Ch,0Ch,0Ch,0,0 ;B .db 7,0Fh,0Eh,14h,16h,18h,0,0Fh ;mario1(0) .db 0,0,0Fh,1Fh,1Fh,1Fh,7,0Dh ;C .db 0C0h,0F8h,40h,40h,20h,78h,0,0C0h ;mario1(1) .db 0,0,0E0h,0F8h,0FCh,0F8h,0F0h,0C0h ;D .db 1Fh,1Fh,1Fh,1Ch,0Ch,7,7,7 ;mario1(2) .db 1Eh,1Ch,1Eh,0Fh,7,0,7,7 ;E .db 0F0h,60h,0F0h,70h,0E0h,0E0h,0F0h,80h ;mario1(3) .db 70h,90h,0,80h,0,0E0h,0F0h,80h ;F .db 0,00000011b,00000111b,00000111b,00001010b,00001011b,00001100b,0 ;mario2(0) .db 0,0,0,00000111b,00001111b,00001111b,00001111b,00000011b ;10 .db 0,11100000b,11111100b,00100000b,00100000b,00010000b,00111100b,0 ;mario2(1) .db 0,0,0,11110000b,11111100b,11111110b,11111100b,11111000b ;11 .db 00000111b,00000111b,00000111b,00011111b,00011111b,00111110b,00100001b,1 ;mario2(2) .db 00000111b,0Fh,00011011b,00011000b,10h,30h,21h,1 ;12 .db 11100000b,11100000b,11100000b,0F0h,0F0h,11100000b,11000000b,11100000b ;mario2(3) .db 11111000b,11111100b,11111000b,0,0,0,11000000b,11100000b ;13 .db 7,0Fh,0Eh,14h,16h,18h,0,0Fh ;mario3(0) .db 0,0,0Fh,1Fh,1Fh,1Fh,7,0Dh ;14 .db 0,0E0h,0FCh,27h,27h,11h,3Eh,4 ;mario3(1) .db 7,7,3,0F7h,0FFh,0FFh,0FEh,0FCh ;15 .db 3Fh,7Fh,3Fh,0Fh,1Fh,3Fh,7Fh,4Fh ;mario3(2) .db 3Eh,7Fh,0FFh,0E2h,50h,38h,70h,40h ;16 .db 0F8h,0F9h,0F9h,0B7h,0FFh,0FFh,0E0h,0 ;mario3(3) .db 0E8h,71h,1,4Bh,3,3,0,0 ;17 .db 3,1Fh,7Fh,0C3h,0FFh,0,0,7Ch ;squashed gomba .db 0,0,1Ch,3Fh,0,1Fh,0Fh,7Ch ;18 .db 07Fh,80h,80h,80h,80h,80h,80h,80h ;block(0) .db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ;19 .db 0DEh,61h,61h,61h,71h,5Eh,7Fh,61h ;block(1) .db 0BFh,0BEh,0BEh,0BEh,0AEh,0A1h,0BEh,0BEh ;1A .db 80h,80h,0C0h,0F0h,0BFh,8Fh,81h,7Eh ;block(2) .db 0FFh,0FFh,3Fh,0CFh,0F0h,0FEh,0FEh,81h ;1B .db 61h,61h,0C1h,0C1h,81h,81h,83h,0FEh ;block(3) .db 0BEh,0BEh,7Eh,7Eh,0FEh,0FEh,0FCh,81h ;---------------------------------------------------------------------------- .org 0FF00h ;NMI interruption. This is not used, control PPU 1 rti ;is set to don't do it. ; .org 0FFFAh ;interruption vectors .db 0,0FFh,0,80h,0,80h ;the useless NMI is in FF00h, and the ; program begins in 8000h .end