i really need BIG help. In the Newcoleco coding library is a superb fonction called put_frame. Here is the source code :
; gpfram0.s
.module put_frame
; global from this code
.globl _put_frame
; put_frame (void *table, byte x, byte y, byte width, byte height)
.area _CODE
_put_frame:
exx
pop hl
exx
pop hl
pop de
pop bc
push bc
push de
push hl
exx
push hl
exx
push ix
push iy
call 0x080b
pop iy
pop ix
ret
It take a memory zone (*table) of characters of widht and height, an display it at position x,y. If it's out of the screen, it's okay, it don't crash anything.
I really can't read assembly. But What i'd like to to, is if this routine want to put a char
at a position x > 24, then, it don't do put the char.
Can somebody change easily this assembly routine to do that ?! Or is it not possible because it call a bios routine at 0X080b ???
By the way, there is the put_frame0 routine, who don't check "boundary" ... Maybe it's possible to modify ...
; gp9fram0.s
.module put_frame0
.globl calc_offset
; global from this code
.globl _put_frame0
; put_frame0 (void *table, byte x, byte y, byte width, byte height)
.area _CODE
_put_frame0:
exx
pop hl
exx
pop hl
pop de
call calc_offset
pop bc
push bc
push de
push hl
exx
push hl
exx
loop:
push bc
push de
push hl
ld b,#0
xor a
call 0x1fdf
pop hl
pop de
pop bc
push bc
ld b,#0
add hl,bc
ex de,hl
ld bc,#0x0020
add hl,bc
ex de,hl
pop bc
dec b
ld a,b
jr nz,loop
ret
Edited by bfg.gamepassion, Thu Dec 8, 2011 10:44 AM.













