0 Members and 1 Guest are viewing this topic.
LD HL, $1C04 ; Location of where to display Text LD (CurRow), HL LD HL, SomeText LD DE, OP1 LD BC, 5 ; Lengt + the "0" in the end LDIR LD HL, OP1 b_call _PutSSomeText: .DB "Text", 0 ;The above didn't work. ;Neither does this: LD HL, $1C04 ; Location again. LD (PenCol), HL LD HL, SomeText b_call _VPutSSomeText: .DB "Text", 0
LD A, 38 ; X position to display LD (xpos), A LD A, 54 ; Y position do display LD (ypos), A LD B, 10 ; Length of sprite (in Y direction) LD DE, (ypos) LD IX, Sprite ; The sprite CALL ClipSprXORClipSprXOR: ; The actual spriting (from the asm-in-28-days, workt perfectly, but not in APPs appearantly) LD A, %11111111 LD (clip_mask), A LD A, E OR A JP M, ClipTop SUB 64 RET NC NEG CP B JR NC, VertClipDone LD B, A JR VertClipDoneClipTop: LD A, B NEG SUB E RET NC PUSH AF ADD A, B LD E, 0 LD B, E LD C, A ADD IX, BC POP AF NEG LD B, AVertClipDone: LD C, 0 LD A, D CP -7 JR NC, ClipLeft CP 96 RET NC CP 89 JR C, HorizClipDoneClipRight: AND 7 LD C, A LD A, %11111111FindRightMask: ADD A, A DEC C JR NZ, FindRightMask LD (clip_mask), A LD A, D JR HorizClipDoneClipLeft: AND 7 LD C, A LD A, %11111111FindLeftMask: ADD A, A DEC C JR NZ, FindLeftMask CPL LD (clip_mask), A LD A, D ADD A, 96 LD C, 12HorizClipDone: LD H, 0 LD D, H LD L, E ADD HL, HL ADD HL, DE ADD HL, HL ADD HL, HL LD E, A SRL E SRL E SRL E ADD HL, DE LD DE, PlotSScreen ADD HL, DE LD D, 0 LD E, C SBC HL, DE AND 7 JR Z, _Aligned LD C, A LD DE, 11_RowLoop: PUSH BC LD B, C LD A, (clip_mask) AND (IX) LD C, 0_ShiftLoop: SRL A RR C DJNZ _ShiftLoop XOR (HL) LD (HL), A INC HL LD A, C XOR (HL) LD (HL), A ADD HL, DE INC IX POP BC DJNZ _RowLoop RET_Aligned: LD DE, 12_PutLoop: LD A, (IX) XOR (HL) LD (HL), A INC IX ADD HL, DE DJNZ _PutLoop RETSprite: ; Some random Sprite .DB %11111111 .DB %00011000 .DB %00001100 .DB %11111111 .DB %00010000 .DB %00010000 .DB %11110000 .DB %00111100 .DB %00001110 .DB %00000011
But have you equated xpos, ypos and clip_mask to a location on safe ram?
If you want to ease some coding it is easier to use:appsafePutS: ld a,(hl) inc hl or a ret z b_call _PutC jr appPutS ld hl,string call appsafePutSthan relocating the string to ram every time.
You can't use bcalls for text/sprites in an app. You have to write your own routines, or store all text in RAM.
Actually, if you want to take the lazy way out which may or may not be easier in this case, just copy your data to ram first and then you can use your handy dandy bcalls with the ram location. If you have enough room, you can just copy all that data there at the beginning and then you're all set. If not, then you can dynamically copy the text/sprites to the ram only when you need them.