Crap 0.1 first assembly project
Posted: Sat Dec 30, 2017 2:58 pm
Well further my resolution for 2018 to spawn my very own crap assembly game I will put my laughable progress here for all to have a chuckle at and hopefully give me a few pointers/obiwan like advice along the way to bring this baby home!
So at the moment I have this...
Mmmm just soak it in... Yes friends, its a chess board. However it needs the chessmen and the pawns. That is the next step, that and fixing the board colour - (needs to be green and white really..) still that is pretty smooth sailing.
In the spirit of crap games, you will need two players, who enter there moves via the keyboard (none of that cursor stuff... well not at the moment anyway..). Because there is no chess computer - no complicated AI, and all that other headache causing stuff. All the 'game' will do is accept user input from the two players, and move the chessmen/pawns about the board, removing the pieces when needed.
That will just require a non-vacant square check, if non-vacant remove the piece from the board and replace with the new piece. pretty simple.
But like a fool I decided to tackle the background first. (well it pretty...)
The assembly code was based of a checker pattern program I found on you tube and abused...
Next task is to create the sprites, then the input, then think about the animation, then the 'rules'. mmmmm will add some more cosmetic fluff like a title bar, infobar at the bottom, to make it less of a cheat i will set the border, paper, in the assembly portion and not the basic boot loader next time also.
This is the listing for my 'project'.. lol this was my first crack at it...
That is ugly and I was ashamed at my lack of a third loop to reduce all those filthy repeated blocks... I had to do something...
but what happened was this...
Who would have thought that a 3 deep nestled loop would go wrong? well I need to look at the code again and try and figure out how i screwed it up..
So at the moment I have this...
Mmmm just soak it in... Yes friends, its a chess board. However it needs the chessmen and the pawns. That is the next step, that and fixing the board colour - (needs to be green and white really..) still that is pretty smooth sailing.
In the spirit of crap games, you will need two players, who enter there moves via the keyboard (none of that cursor stuff... well not at the moment anyway..). Because there is no chess computer - no complicated AI, and all that other headache causing stuff. All the 'game' will do is accept user input from the two players, and move the chessmen/pawns about the board, removing the pieces when needed.
That will just require a non-vacant square check, if non-vacant remove the piece from the board and replace with the new piece. pretty simple.
But like a fool I decided to tackle the background first. (well it pretty...)
The assembly code was based of a checker pattern program I found on you tube and abused...
Next task is to create the sprites, then the input, then think about the animation, then the 'rules'. mmmmm will add some more cosmetic fluff like a title bar, infobar at the bottom, to make it less of a cheat i will set the border, paper, in the assembly portion and not the basic boot loader next time also.
This is the listing for my 'project'.. lol this was my first crack at it...
Code: Select all
org 50000
ld hl, 22528 ;start of screen page
ld a, 4 ;set a to 8 (height)
loop: ld b, 4 ;set b to 8 (width)
row1a: ld (hl), 0 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 0 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 0 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 0 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 127 ;colour is white block
inc hl ;increment hl (screenpos)
ld (hl), 127 ;colour is white block
inc hl ;increment hl (screenpos)
ld (hl), 127 ;colour is white block
inc hl ;increment hl (screenpos)
ld (hl), 127 ;colour is white block
inc hl ;increment hl (screenpos)
djnz row1a ;jump row1 if non-zero (b)
ld b, 4 ;reset b to 16
row1b: ld (hl), 0 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 0 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 0 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 0 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 127 ;colour is white block
inc hl ;increment hl (screenpos)
ld (hl), 127 ;colour is white block
inc hl ;increment hl (screenpos)
ld (hl), 127 ;colour is white block
inc hl ;increment hl (screenpos)
ld (hl), 127 ;colour is white block
inc hl ;increment hl (screenpos)
djnz row1b ;jump row1 if non-zero (b)
ld b, 4 ;reset b to 16
row2a: ld (hl), 127 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 127 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 127 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 127 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 0 ;colour is white block
inc hl ;increment hl (screenpos)
ld (hl), 0 ;colour is white block
inc hl ;increment hl (screenpos)
ld (hl), 0 ;colour is white block
inc hl ;increment hl (screenpos)
ld (hl), 0 ;colour is white block
inc hl ;increment hl (screenpos)
djnz row2a ;jump row1 if non-zero (b)
ld b, 4 ;reset b to 16
row2b: ld (hl), 127 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 127 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 127 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 127 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 0 ;colour is white block
inc hl ;increment hl (screenpos)
ld (hl), 0 ;colour is white block
inc hl ;increment hl (screenpos)
ld (hl), 0 ;colour is white block
inc hl ;increment hl (screenpos)
ld (hl), 0 ;colour is white block
inc hl ;increment hl (screenpos)
djnz row2b ;jump row1 if non-zero (b)
dec a ;decrement a
jr nz, loop ;jump loop if non-zero (a)
ret
end 50000
Code: Select all
org 50000
ld hl, 22528 ;start of screen page
ld a, 4 ;set a to 8 (height)
loop: ld b, 4 ;set b to 8 (width)
row1a: ld c, 4 ;set c to 4 (square)
row1aa: ld (hl), 0 ;colour is black block
inc hl ;increment hl (screenpos)
dec c
djnz row1aa
ld c, 4
row1ab: ld (hl), 127 ;colour is white block
inc hl ;increment hl (screenpos)
dec c
djnz row1ab
djnz row1a ;jump row1 if non-zero (b)
ld b, 4 ;reset b to 16
row1b: ld (hl), 0 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 0 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 0 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 0 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 127 ;colour is white block
inc hl ;increment hl (screenpos)
ld (hl), 127 ;colour is white block
inc hl ;increment hl (screenpos)
ld (hl), 127 ;colour is white block
inc hl ;increment hl (screenpos)
ld (hl), 127 ;colour is white block
inc hl ;increment hl (screenpos)
djnz row1b ;jump row1 if non-zero (b)
ld b, 4 ;reset b to 16
row2a: ld (hl), 127 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 127 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 127 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 127 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 0 ;colour is white block
inc hl ;increment hl (screenpos)
ld (hl), 0 ;colour is white block
inc hl ;increment hl (screenpos)
ld (hl), 0 ;colour is white block
inc hl ;increment hl (screenpos)
ld (hl), 0 ;colour is white block
inc hl ;increment hl (screenpos)
djnz row2a ;jump row1 if non-zero (b)
ld b, 4 ;reset b to 16
row2b: ld (hl), 127 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 127 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 127 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 127 ;colour is black block
inc hl ;increment hl (screenpos)
ld (hl), 0 ;colour is white block
inc hl ;increment hl (screenpos)
ld (hl), 0 ;colour is white block
inc hl ;increment hl (screenpos)
ld (hl), 0 ;colour is white block
inc hl ;increment hl (screenpos)
ld (hl), 0 ;colour is white block
inc hl ;increment hl (screenpos)
djnz row2b ;jump row1 if non-zero (b)
dec a ;decrement a
jr nz, loop ;jump loop if non-zero (a)
ret
end 50000
Who would have thought that a 3 deep nestled loop would go wrong? well I need to look at the code again and try and figure out how i screwed it up..