diff --git a/wip-hugo/routines/text/char.inc b/wip-hugo/routines/text/char.inc index 8c19794..0d5c22f 100644 --- a/wip-hugo/routines/text/char.inc +++ b/wip-hugo/routines/text/char.inc @@ -11,9 +11,12 @@ ;; 16-bit value, we reuse bytes from Y_pos Y_pos_offset_hi = $EC Y_pos_offset_lo = Y_pos - ;; 16-bit value, we reuse bytes from code - petski_position_lo = code - petski_position_hi = code + 1 # this clobers the ARGVEK space ik but it's faster. CURSED AF + + ;; What you will see bellow is .. interesting. I want to reuse + ;; code and I need it for a 16-bit pointer. Because 6502 pointers expect the bytes to be besides each other + ;; I need to use code +1 to store data even though its fot ARGVEK. + ;; Thats why it's cursed + petski_position = code ; 16 bit value uses (code +1) ;; values VIC_bank = $4000 diff --git a/wip-hugo/routines/text/char_draw.s b/wip-hugo/routines/text/char_draw.s index d8aff20..81c909c 100644 --- a/wip-hugo/routines/text/char_draw.s +++ b/wip-hugo/routines/text/char_draw.s @@ -19,7 +19,7 @@ initial: ;We first need to clear some memory LDA #$00 - STA petski_position_hi + STA petski_position + 1 STA Y_pos_offset_hi STA X_pos_offset_hi @@ -27,10 +27,10 @@ initial: ;; This is code *8 because 8byte is one character ;; *8 = 2*2*2 ASL code ;Will never owerflow, therefore 8byte - Mult_16 petski_position_lo, petski_position_hi - Mult_16 petski_position_lo, petski_position_hi + Mult_16 petski_position, petski_position + 1 + Mult_16 petski_position, petski_position + 1 ;; Add starting position - Add_16 petski_position_lo, petski_position_hi, #Character_generator_ROM, ! + Add_16 petski_position, petski_position + 1, #Character_generator_ROM, ! ;;Calculate screen_position to use Mov_16 screen_position, screen_position + 1, #VIC_bank @@ -64,11 +64,11 @@ initial: ;; One character is 8 byte, move these bytes to screen LDY #$07 @loop: - LDA (petski_position_lo), Y + LDA (petski_position), Y STA (screen_position), Y DEY BNE @loop - LDA (petski_position_lo), Y + LDA (petski_position), Y STA (screen_position), Y RTS .endproc