diff --git a/games/lemm/Makefile b/games/lemm/Makefile index 5de4d115..98a46ffa 100644 --- a/games/lemm/Makefile +++ b/games/lemm/Makefile @@ -41,7 +41,7 @@ lemm.o: lemm.s zp.inc hardware.inc \ graphics/graphics_test.inc graphics/sprites.inc \ intro_level1.s update_time.s hgr_sprite.s draw_flames.s \ draw_door.s move_lemming.s draw_lemming.s \ - hgr_hlin.s update_menu.s \ + hgr_hlin.s hgr_vlin.s update_menu.s \ interrupt_handler.s keyboard.s draw_pointer.s \ pointer_sprites.inc \ level1.s diff --git a/games/lemm/hgr_vlin.s b/games/lemm/hgr_vlin.s new file mode 100644 index 00000000..f101e6ec --- /dev/null +++ b/games/lemm/hgr_vlin.s @@ -0,0 +1,69 @@ + ;================================= + ; Simple Vertical LINE + ;================================= + ; line from (x,a) to (x,a+y) + ; todo: use Carry to say if X>255 + +hgr_vlin: + ; don't handle run of 0 + cpy #0 + beq done_hgr_vlin + + + ; get initial ROW into (GBASL) + + sta current_row_smc+1 ; save current A +; sty vlin_row_count + + lda div7_table,X + sta x1_save_smc+1 + + and #$1 ; only shift if in odd column? + beq vlin_no_shift_colors + jsr shift_colors +vlin_no_shift_colors: + + + lda mod7_table,X + tax + lda vlin_masks,X + sta vlin_mask_smc+1 + + tya + tax ; get line count into X + +hgr_vlin_loop: + +current_row_smc: + ldy #$dd ; get row info for Y1 into GBASL/GBASH + lda hposn_high,Y + sta GBASH + lda hposn_low,Y + sta GBASL + +x1_save_smc: + ldy #$dd + lda (GBASL),Y + eor HGR_BITS +vlin_mask_smc: + and #$dd + eor (GBASL),Y + sta (GBASL),Y + + inc current_row_smc+1 +; dec vlin_row_count + + dex + bne hgr_vlin_loop + +done_hgr_vlin: + + rts + +;vlin_row_count: .byte $00 + + +vlin_masks: + .byte $81,$82,$84,$88,$90,$A0,$C0 + + diff --git a/games/lemm/lemm.s b/games/lemm/lemm.s index d431013a..90ecae47 100644 --- a/games/lemm/lemm.s +++ b/games/lemm/lemm.s @@ -273,6 +273,7 @@ load_song_chunk_good: .include "draw_door.s" .include "wait.s" .include "hgr_hlin.s" + .include "hgr_vlin.s" .include "update_menu.s" ; pt3 player diff --git a/games/lemm/update_menu.s b/games/lemm/update_menu.s index f9bb5237..9a1376a5 100644 --- a/games/lemm/update_menu.s +++ b/games/lemm/update_menu.s @@ -4,14 +4,28 @@ update_menu: lda #7 jsr set_hcolor - lda #168 + ; two hlins + ldx #144 + lda #168 ldy #15 jsr hgr_hlin ; (x,a) to (x+y,a) - lda #191 ldx #144 + lda #191 ldy #15 jsr hgr_hlin ; (x,a) to (x+y,a) + ; two vlins + + ldx #144 + lda #168 + ldy #47 + jsr hgr_vlin ; (x,a) to (x,a+y) + + ldx #159 + lda #168 + ldy #47 + jsr hgr_vlin ; (x,a) to (x,a+y) + rts