Eagle Posted August 18, 2022 Share Posted August 18, 2022 (edited) µSoukoban - link JS7800 Select - change level Start - restart level 100 levels from https://www.onlinespiele-sammlung.de/sokoban/sokobangames/robsy/ converted by @zbyti I saw his Soukoban versions in MadPascal for the A8 and I decided to do ASM versions for the A7800. The goal was to keep the code as short as possible Source code attached in MADS. GFX by me (I apologize... ) Below main code restart ldy #20 ;wait 20 frames jsr DelayVB mva #$00 level_complete jsr copy_level main jsr Find_Sokoban ;result in X jsr Joystick ;use X from Find_Sokoban jsr Check_level_complete jsr Put_on_screen jsr Console_Switches ; lda Level_complete beq Main ; inc Level_number jmp Restart joystick lda SWCHA and #$F0 cmp #$F0 bne joy_used rts joy_used ldy #12 ;wait 12 frames jsr DelayVB cmp #%10110000 ;left bne joy_right Test_tile -1,-2 joy_right cmp #%01110000 ;right bne joy_up Test_tile +1,+2 joy_up cmp #%11100000 ;up bne joy_down Test_tile -8,-16 joy_down cmp #%11010000 ;down bne endjoy Test_tile +8,+16 endjoy rts ;@ player ;+ player on deck ;. deck ;$ crate ;* crate on deck ; floor ; ;2 bytes patterns pattern .byte '+ @ +.@.' replace .byte '.@ @.+ +' ;3 bytes patterns pattern3 .byte '+$ @$ +* @* +$.@$.+*.@*.' replace3 .byte '.@$ @$.+$ +$.@* @*.+* +*' ; checktiles ldy #$00 @ lda tile1 cmp pattern,y bne @+ lda tile2 cmp pattern+1,y bne @+ mva replace,y Tile1 mva replace+1,y Tile2 rts @ :2 iny cpy #8 bne @-1 ; ldy #$00 @ lda tile1 cmp pattern3,y bne @+ lda tile2 cmp pattern3+1,y bne @+ lda tile3 cmp pattern3+2,y bne @+ mva replace3,y Tile1 mva replace3+1,y Tile2 mva replace3+2,y Tile3 rts @ :3 iny cpy #24 bne @-1 rts find_sokoban ldx #64-1 @ lda scr,x cmp #'@' beq found_sokoban cmp #'+' beq found_sokoban dex bpl @- found_sokoban rts ;Z=0 - found, X= where is check_level_complete ldx #64-1 @ lda scr,x cmp #'.' beq level_not_finish cmp #'+' beq level_not_finish dex bpl @- lda #$01 ;level completed sta level_complete level_not_finish rts copy_level mwa #lvl sour mwa #scr dest mva level_number temp mva #$00 temp+1 :6 mulu2 adw sour temp ldy #$00 @ lda (sour),y sta (dest),y iny cpy #64 bne @- rts put_on_screen mwa #scr sour mwa #buffor dest ldy #$00 @ lda (sour),y tax lda tabscr,x asl @ sta (dest),y iny cpy #64 bne @- rts uSokoban.a78 uSokobanSourceCode.zip Edited August 18, 2022 by Eagle 9 Quote Link to comment Share on other sites More sharing options...
gambler172 Posted August 19, 2022 Share Posted August 19, 2022 Hi Eagle Now adding some sound and we have a good game 😉 2 Quote Link to comment Share on other sites More sharing options...
Eagle Posted August 19, 2022 Author Share Posted August 19, 2022 @gambler172 I share my code so that everyone can make changes, add music, sfx, change graphics (160B or 320B will cost maybe few lines of code), title screen or end screen. Also code is ready for any other formats of levels from other platforms (full screen as well) If anyone want make changes any feel free to ask. I’d be happy to help. 3 Quote Link to comment Share on other sites More sharing options...
Traxx Posted August 21, 2022 Share Posted August 21, 2022 Awesome Quote Link to comment Share on other sites More sharing options...
Traxx Posted August 21, 2022 Share Posted August 21, 2022 (edited) It kinda reminds me of my game,I like yours better though https://www.youtube.com/watch?v=lA1yPY1QsqM Edited August 21, 2022 by Traxx 1 Quote Link to comment Share on other sites More sharing options...
gambler172 Posted August 21, 2022 Share Posted August 21, 2022 Hi Eagle Made it through all 100 levels. Had a lot of fun. Just for info... On real hardware SELECT starts a level And START selects a level 😉 I would like.to see an ending sequence When finishing Level 100.....there is only a blank screen. Great work Greetings Walter 2 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.