Use functions in macros to save ~75% of rom space for the file.
This commit is contained in:
@@ -38,30 +38,52 @@ macro fs_draw16x16(screenrow,screencol)
|
|||||||
%fs_draw16x8(<screenrow>+1,<screencol>)
|
%fs_draw16x8(<screenrow>+1,<screencol>)
|
||||||
endmacro
|
endmacro
|
||||||
|
|
||||||
|
macro fs_LDY_screenpos(screenrow,screencol)
|
||||||
|
LDY.w #<screenrow>*$20+<screencol>*2+$1004
|
||||||
|
endmacro
|
||||||
|
|
||||||
macro fs_drawItem(screenrow,screencol,tileAddress)
|
macro fs_drawItem(screenrow,screencol,tileAddress)
|
||||||
LDA.l <tileAddress> : %fs_draw8x8(<screenrow>,<screencol>)
|
LDX.w #<tileAddress>
|
||||||
LDA.l <tileAddress>+2 : %fs_draw8x8(<screenrow>,<screencol>+1)
|
%fs_LDY_screenpos(<screenrow>,<screencol>)
|
||||||
LDA.l <tileAddress>+4 : %fs_draw8x8(<screenrow>+1,<screencol>)
|
JSR DrawItem
|
||||||
LDA.l <tileAddress>+6 : %fs_draw8x8(<screenrow>+1,<screencol>+1)
|
|
||||||
endmacro
|
endmacro
|
||||||
macro fs_drawItemGray(screenrow,screencol,tileAddress)
|
macro fs_drawItemGray(screenrow,screencol,tileAddress)
|
||||||
LDA.l <tileAddress> : AND.w #$E3FF : ORA.w #!FS_COLOR_GRAY : %fs_draw8x8(<screenrow>,<screencol>)
|
LDX.w #<tileAddress>
|
||||||
LDA.l <tileAddress>+2 : AND.w #$E3FF : ORA.w #!FS_COLOR_GRAY : %fs_draw8x8(<screenrow>,<screencol>+1)
|
%fs_LDY_screenpos(<screenrow>,<screencol>)
|
||||||
LDA.l <tileAddress>+4 : AND.w #$E3FF : ORA.w #!FS_COLOR_GRAY : %fs_draw8x8(<screenrow>+1,<screencol>)
|
JSR DrawItemGray
|
||||||
LDA.l <tileAddress>+6 : AND.w #$E3FF : ORA.w #!FS_COLOR_GRAY : %fs_draw8x8(<screenrow>+1,<screencol>+1)
|
|
||||||
endmacro
|
endmacro
|
||||||
|
|
||||||
macro fs_drawItemBasic(address,screenrow,screencol,tileAddress)
|
macro fs_drawItemBasic(address,screenrow,screencol,tileAddress)
|
||||||
LDA.l <address> : AND.w #$00FF : BEQ +
|
LDX.w #<tileAddress>
|
||||||
%fs_drawItem(<screenrow>,<screencol>,<tileAddress>)
|
%fs_LDY_screenpos(<screenrow>,<screencol>)
|
||||||
BRA ++
|
LDA.l <address>
|
||||||
+
|
JSR DrawItemBasic
|
||||||
%fs_drawItemGray(<screenrow>,<screencol>,<tileAddress>)
|
|
||||||
++
|
|
||||||
endmacro
|
endmacro
|
||||||
|
|
||||||
|
DrawItem:
|
||||||
|
LDA.w $0000,X : STA.w $0000, Y
|
||||||
|
LDA.w $0002,X : STA.w $0002, Y
|
||||||
|
LDA.w $0004,X : STA.w $0040, Y
|
||||||
|
LDA.w $0006,X : STA.w $0042, Y
|
||||||
|
RTS
|
||||||
|
DrawItemGray:
|
||||||
|
LDA.w $0000,X : AND.w #$E3FF : ORA.w #!FS_COLOR_GRAY : STA.w $0000, Y
|
||||||
|
LDA.w $0002,X : AND.w #$E3FF : ORA.w #!FS_COLOR_GRAY : STA.w $0002, Y
|
||||||
|
LDA.w $0004,X : AND.w #$E3FF : ORA.w #!FS_COLOR_GRAY : STA.w $0040, Y
|
||||||
|
LDA.w $0006,X : AND.w #$E3FF : ORA.w #!FS_COLOR_GRAY : STA.w $0042, Y
|
||||||
|
RTS
|
||||||
|
DrawItemBasic:
|
||||||
|
AND.w #$00FF : BEQ +
|
||||||
|
JMP DrawItem
|
||||||
|
+
|
||||||
|
JMP DrawItemGray
|
||||||
|
|
||||||
DrawPlayerFile:
|
DrawPlayerFile:
|
||||||
PHX : PHY
|
PHX : PHY : PHB
|
||||||
|
|
||||||
|
SEP #$20 ; set 8-bit accumulator
|
||||||
|
LDA.b #FileSelectItems>>16 : PHA : PLB
|
||||||
|
REP #$20 ; restore 16 bit accumulator
|
||||||
|
|
||||||
LDA !ExtendedPlayerName+$00 : ORA.w #!FS_COLOR_BW
|
LDA !ExtendedPlayerName+$00 : ORA.w #!FS_COLOR_BW
|
||||||
%fs_draw8x16(6,3)
|
%fs_draw8x16(6,3)
|
||||||
@@ -179,25 +201,7 @@ DrawPlayerFile:
|
|||||||
; Moon Pearl
|
; Moon Pearl
|
||||||
%fs_drawItemBasic($700357,8,26,FileSelectItems_pearl)
|
%fs_drawItemBasic($700357,8,26,FileSelectItems_pearl)
|
||||||
|
|
||||||
; ;powder
|
PLB : PLY : PLX
|
||||||
; LDA !FS_INVENTORY_SWAP : AND.w #$0010 : BEQ +
|
|
||||||
; LDA.w #$020A|!FS_COLOR_BROWN
|
|
||||||
; BRA .draw_powder
|
|
||||||
; +
|
|
||||||
; LDA.w #$020A|!FS_COLOR_GRAY
|
|
||||||
; .draw_powder
|
|
||||||
; %fs_draw16x16(2,20)
|
|
||||||
;
|
|
||||||
; ;mushroom
|
|
||||||
; LDA !FS_INVENTORY_SWAP : AND.w #$0020 : BEQ +
|
|
||||||
; LDA.w #$0262|!FS_COLOR_RED
|
|
||||||
; BRA .draw_shroom
|
|
||||||
; +
|
|
||||||
; LDA.w #$0262|!FS_COLOR_GRAY
|
|
||||||
; .draw_shroom
|
|
||||||
; %fs_draw16x16(2,22)
|
|
||||||
|
|
||||||
PLY : PLX
|
|
||||||
LDA.w #$0004 : STA $02 ; thing we wrote over
|
LDA.w #$0004 : STA $02 ; thing we wrote over
|
||||||
RTL
|
RTL
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user