Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dad3262
commit 961c2e3
Showing
12 changed files
with
495 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
all: decompress.c | ||
all: decompress.c extractor.c | ||
|
||
decompress.c: decompress.asm | ||
fasmg $< decompress | ||
xxd -i decompress > $@ | ||
rm -f decompress | ||
|
||
extractor.c: extractor.asm | ||
fasmg $< extractor | ||
xxd -i extractor > $@ | ||
rm -f extractor | ||
|
||
.PHONY: all clean | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
include '../deps/fasmg-ez80/ez80.inc' | ||
include './ti84pceg.inc' | ||
|
||
macro print msg, offset | ||
display msg | ||
repeat 1,x:offset | ||
display `x, 10 | ||
end repeat | ||
end macro | ||
|
||
relocaddr := ti.plotSScreen | ||
|
||
extractableprgm: | ||
ld hl,0 | ||
extractentrylabel := $% - 3 | ||
ld de,relocaddr | ||
ld bc,0 | ||
extractsizelabel := $% - 3 | ||
ldir | ||
jp relocaddr | ||
.relocate: | ||
org relocaddr | ||
extractprgm: | ||
ld hl,0 | ||
extracttotalsizelabel := $% - 3 | ||
call ti.ErrNotEnoughMem | ||
ld hl,ti.userMem | ||
ld de,(ti.asm_prgm_size) | ||
call ti.DelMem ; remove ourseleves | ||
xor a,a | ||
sbc hl,hl | ||
ld (ti.asm_prgm_size),hl | ||
ld hl,extractdata | ||
.loop: | ||
ld a,(hl) | ||
or a,a | ||
jp z,ti.userMem | ||
push hl | ||
call ti.Mov9ToOP1 | ||
.find: | ||
call ti.ChkFindSym | ||
jp c,.notfound | ||
call ti.ChkInRam | ||
jr nz,.inarc | ||
call ti.PushOP1 | ||
call ti.Arc_Unarc | ||
call ti.PopOP1 | ||
jr .find | ||
.inarc: | ||
ex de,hl | ||
ld de,9 | ||
add hl,de | ||
ld e,(hl) | ||
add hl,de | ||
inc hl | ||
call ti.LoadDEInd_s | ||
push hl | ||
push de | ||
ld de,ti.userMem | ||
ld hl,(ti.asm_prgm_size) | ||
add hl,de | ||
ex de,hl | ||
pop hl | ||
push de | ||
push hl | ||
call ti.InsertMem | ||
pop hl | ||
push hl | ||
ld de,(ti.asm_prgm_size) | ||
add hl,de | ||
ld (ti.asm_prgm_size),hl | ||
pop bc | ||
pop de | ||
pop hl | ||
ldir | ||
pop hl | ||
ld bc,9 | ||
add hl,bc | ||
jr .loop | ||
.notfound: | ||
pop hl | ||
ld a,0 | ||
jp ti.JError | ||
extractdata: | ||
|
||
display 10 | ||
print "#define EXTRACTOR_ENTRY_OFFSET ", extractentrylabel | ||
print "#define EXTRACTOR_PRGM_SIZE_OFFSET ", extractsizelabel | ||
print "#define EXTRACTOR_EXTRACT_SIZE_OFFSET ", extracttotalsizelabel | ||
print "#define EXTRACTOR_APPVARS_OFFSET ", $% | ||
display 10 | ||
print "size: ", $% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
unsigned char extractor[] = { | ||
0x21, 0x00, 0x00, 0x00, 0x11, 0x66, 0x94, 0xd0, 0x01, 0x00, 0x00, 0x00, | ||
0xed, 0xb0, 0xc3, 0x66, 0x94, 0xd0, 0x21, 0x00, 0x00, 0x00, 0xcd, 0x2c, | ||
0x07, 0x02, 0x21, 0x81, 0xa8, 0xd1, 0xed, 0x5b, 0x8c, 0x11, 0xd0, 0xcd, | ||
0x90, 0x05, 0x02, 0xaf, 0xed, 0x62, 0x22, 0x8c, 0x11, 0xd0, 0x21, 0xed, | ||
0x94, 0xd0, 0x7e, 0xb7, 0xca, 0x81, 0xa8, 0xd1, 0xe5, 0xcd, 0x20, 0x03, | ||
0x02, 0xcd, 0x0c, 0x05, 0x02, 0xda, 0xe6, 0x94, 0xd0, 0xcd, 0x98, 0x1f, | ||
0x02, 0x20, 0x0e, 0xcd, 0x28, 0x06, 0x02, 0xcd, 0x48, 0x14, 0x02, 0xcd, | ||
0xc4, 0x05, 0x02, 0x18, 0xe4, 0xeb, 0x11, 0x09, 0x00, 0x00, 0x19, 0x5e, | ||
0x19, 0x23, 0xcd, 0x9c, 0x1d, 0x02, 0xe5, 0xd5, 0x11, 0x81, 0xa8, 0xd1, | ||
0x2a, 0x8c, 0x11, 0xd0, 0x19, 0xeb, 0xe1, 0xd5, 0xe5, 0xcd, 0x14, 0x05, | ||
0x02, 0xe1, 0xe5, 0xed, 0x5b, 0x8c, 0x11, 0xd0, 0x19, 0x22, 0x8c, 0x11, | ||
0xd0, 0xc1, 0xd1, 0xe1, 0xed, 0xb0, 0xe1, 0x01, 0x09, 0x00, 0x00, 0x09, | ||
0x18, 0xa0, 0xe1, 0x3e, 0x00, 0xc3, 0x90, 0x07, 0x02 | ||
}; | ||
unsigned int extractor_len = 153; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.