One more note today... I have found over 140 bytes free, following Dbug's advice. Maybe I'll need it for solving bugs that may appear...
The trick is that I had many places where I needed to set up a pointer this way:
Code: Select all
lda #34
sta tmp0
lda #12
sta tmp0+1
The trick is (something related to this has already posted on the coding forum) using brk along with a interrupt service routine which sets up the pointer. The above code reduces to:
so saving 5 bytes per call. The interrup service routine does the following:
Code: Select all
;Preserve registers
sta sav_A+1
stx sav_X+1
sty sav_Y+1
pla
pha
and #%00010000
bne set_tmp0
; usual interrupt code goes here
...
+ret_isr
;Restore Registers and return
sav_A
lda #00
sav_X
ldx #00
sav_Y
ldy #00
rti
and
Code: Select all
set_tmp0
.(
; Get data using the stored
; ret addr in stack
tsx
lda $103,x
sta zpTemp01+1
lda $102,x
sta zpTemp01
bne skip2
dec zpTemp01+1
skip2
dec zpTemp01
ldy #0
lda (zpTemp01),y
sta tmp0
iny
lda (zpTemp01),y
sta tmp0+1
; Increment the return address to
; jump over the two byte data
; (the address was already +1).
inc $102,x
bne skip
inc $103,x
skip
; Restore registers
; and return
bne ret_isr ; this always jumps
.)
Well and that is all, basically. The main drawback is that it is slower, but shouldn't be noticeable in this case. I put all the code between the usual #ifdef #endif clauses, to conditionally use this or the older version.
Okay, so basically the game is finished. I am touching the init screen (have already done it in hide, need to import it) and also need to touch the score panel and the sound sfx. I have other minor things that I want to do, but it should be all.
So, are you ready for a beta testing?