New ps1/exe version from Jens.

committer: mfx <mfx> 1049665152 +0000
This commit is contained in:
Markus F.X.J. Oberhumer
2003-04-06 21:39:12 +00:00
parent b8a9b321fa
commit a1064dc2cb
4 changed files with 234 additions and 206 deletions
+47 -45
View File
@@ -32,18 +32,23 @@
#include <mr3k/macros.ash>
#define SZ_REG 4
do_regs MACRO _w
_w at,0(sp)
_w a0,4(sp)
_w a1,8(sp)
_w a2,12(sp)
_w a3,16(sp)
_w v0,20(sp)
_w v1,24(sp)
_w ra,28(sp)
_w at,SZ_REG*0(sp)
_w a0,SZ_REG*1(sp)
_w a1,SZ_REG*2(sp)
_w a2,SZ_REG*3(sp)
_w a3,SZ_REG*4(sp)
_w v0,SZ_REG*5(sp)
_w v1,SZ_REG*6(sp)
_w ra,SZ_REG*7(sp)
do_regs ENDM
DEFINE REG_SZ = (8*4)
#define REG_SZ (8*SZ_REG)
#define HI(a) (a >> 16)
#define LO(a) (a & 0xffff)
ORG 0
@@ -52,19 +57,14 @@ DEFINE REG_SZ = (8*4)
; =============
entry:
; __PSXPREP0__ ; needed by packer to calc the LS value
; __PS1MAIN0__
addiu at,zero,'LS' ; size of decomp. routine
sub sp,at ; adjust the stack with this size
; __PSXPREPZ__ ; needed by packer to calc the LS value
; __PSXSTSZ0__ ; needed by packer to calc the LS value
subu sp,at ; adjust the stack with this size
do_regs sw ; push used regs
; __PSXSTSZZ__
; __PSXMAIN0__
subiu a0,at,REG_SZ ; a0 = counter copyloop
addiu a3,sp,REG_SZ ; get offset for decomp. routine
move a1,a3
lui a2,'DH' ; load decomp routine HI offset
ori a2,'DL' ; and the LO offset
li a2,'DCRT' ; load decompression routine's offset
copyloop:
addi a0,-4
lw at,0(a2) ; memcpy *a2 -> at -> *a1
@@ -73,23 +73,21 @@ copyloop:
bnez a0,copyloop
addiu a1,4
lui a0,'CH' ; load COMPDATA HI offset
ori a0,'CL' ; and the LO part
; lui a1,'LH' ; compressed data length
; ori a1,'LL' ; HI and LO !disabled
; __PSXMAINZ__
li a0,'COMP' ; load COMPDATA HI offset
; li a1,'CDSZ' ; compressed data size !disabled
; __PS1MAINZ__
; =============
; __PSXJSTA0__
lui a2,'OH' ; load DECOMPDATA HI offset
; __PS1JSTA0__
lui a2,HI('DECO') ; load DECOMPDATA HI offset
jr a3
ori a2,'OL' ; load DECOMPDATA LO offset
; __PSXJSTAZ__
; __PSXJSTH0__
jr a3 ;
lui a2,'OH' ; same for HI only !(offset&0xffff)
; __PSXJSTHZ__
ori a2,LO('DECO') ; load DECOMPDATA LO offset
; __PS1JSTAZ__
; __PS1JSTH0__
jr a3
lui a2,HI('DECO') ; same for HI only !(offset&0xffff)
; __PS1JSTHZ__
; =============
; ============= DECOMPRESSION
@@ -104,17 +102,17 @@ copyloop:
# define SMALL
#endif
; __PSXDECO0__
; __PSXDECOZ__
; __PSXN2BD0__
; __PS1DECO0__
; __PS1DECOZ__
; __PS1N2BD0__
#include <mr3k/n2b_d.ash>
; __PSXN2BDZ__
; __PSXN2DD0__
; __PS1N2BDZ__
; __PS1N2DD0__
#include <mr3k/n2d_d.ash>
; __PSXN2DDZ__
; __PSXN2ED0__
; __PS1N2DDZ__
; __PS1N2ED0__
#include <mr3k/n2e_d.ash>
; __PSXN2EDZ__
; __PS1N2EDZ__
; =============
@@ -146,18 +144,18 @@ memset_unaligned:
; =============
; __PSXEXIT0__
; __PS1EXIT0__
li t2,160 ; flushes
jalr ra,t2 ; instruction
li t1,68 ; cache
do_regs lw ; pop used regs
DW 'JPEP' ; marker for the entry jump
addu sp,at
; __PSXEXITZ__
; __PS1EXITZ__
; =============
; __PSXPHDR0__
; __PS1PHDR0__
DB 85,80,88,33 ; 0 UPX_MAGIC_LE32
; another magic for PackHeader::putPackHeader
DB 161,216,208,213 ; UPX_MAGIC2_LE32
@@ -168,15 +166,19 @@ memset_unaligned:
DW 0 ; 24 original file size
DB 0 ; 28 filter id
DB 0 ; 29 filter cto
DB 0 ; unused
DB 0 ; unsused
DB 45 ; 31 header checksum
; __PSXPHDRZ__
; __PS1PHDRZ__
; =============
; __PS1RGSZ0__
DW REG_SZ
; __PS1RGSZZ__
eof:
; section .data
DW -1
DH eof
; vi:ts=8:et:nowrap
+31 -32
View File
@@ -1,4 +1,4 @@
/* l_ps1.h -- created from l_ps1.bin, 1590 (0x636) bytes
/* l_ps1.h -- created from l_ps1.bin, 1570 (0x622) bytes
This file is part of the UPX executable compressor.
@@ -26,17 +26,17 @@
*/
#define NRV_LOADER_ADLER32 0x6ad553ee
#define NRV_LOADER_CRC32 0x7be8c655
#define NRV_LOADER_ADLER32 0x0cf34d3a
#define NRV_LOADER_CRC32 0xd78b1eb4
unsigned char nrv_loader[1590] = {
83, 76, 1, 36, 34,232,161, 3, 0, 0,161,175, 4, 0,164,175, /* 0x 0 */
unsigned char nrv_loader[1570] = {
83, 76, 1, 36, 35,232,161, 3, 0, 0,161,175, 4, 0,164,175, /* 0x 0 */
8, 0,165,175, 12, 0,166,175, 16, 0,167,175, 20, 0,162,175, /* 0x 10 */
24, 0,163,175, 28, 0,191,175,224,255, 36, 36, 32, 0,167, 39, /* 0x 20 */
33, 40,224, 0, 72, 68, 6, 60, 76, 68,198, 52,252,255,132, 32, /* 0x 30 */
33, 40,224, 0, 67, 68, 6, 60, 84, 82,198, 52,252,255,132, 32, /* 0x 30 */
0, 0,193,140, 4, 0,198, 36, 0, 0,161,172,251,255,128, 20, /* 0x 40 */
4, 0,165, 36, 72, 67, 4, 60, 76, 67,132, 52, 72, 79, 6, 60, /* 0x 50 */
8, 0,224, 0, 76, 79,198, 52, 8, 0,224, 0, 72, 79, 6, 60, /* 0x 60 */
4, 0,165, 36, 79, 67, 4, 60, 80, 77,132, 52, 69, 68, 6, 60, /* 0x 50 */
8, 0,224, 0, 79, 67,198, 52, 8, 0,224, 0, 69, 68, 6, 60, /* 0x 60 */
33, 72, 0, 0, 1, 0, 11, 36, 33, 64,128, 0, 60, 0, 17, 4, /* 0x 70 */
127, 0, 34, 49, 6, 0, 64, 16, 1, 0, 3, 36, 0, 0, 2,145, /* 0x 80 */
1, 0, 8, 37, 0, 0,194,160,248,255, 0, 16, 1, 0,198, 36, /* 0x 90 */
@@ -106,28 +106,27 @@ unsigned char nrv_loader[1590] = {
16, 0,167,143, 20, 0,162,143, 24, 0,163,143, 28, 0,191,143, /* 0x 490 */
80, 69, 80, 74, 33,232,161, 3, 85, 80, 88, 33,161,216,208,213, /* 0x 4a0 */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 4b0 */
0, 0, 0, 0, 0, 0, 0, 45, 80, 83, 88, 80, 82, 69, 80, 48, /* 0x 4c0 */
0, 0, 0, 0, 80, 83, 88, 80, 82, 69, 80, 90, 8, 0, 0, 0, /* 0x 4d0 */
80, 83, 88, 83, 84, 83, 90, 48, 8, 0, 0, 0, 80, 83, 88, 83, /* 0x 4e0 */
84, 83, 90, 90, 40, 0, 0, 0, 80, 83, 88, 77, 65, 73, 78, 48, /* 0x 4f0 */
40, 0, 0, 0, 80, 83, 88, 77, 65, 73, 78, 90, 92, 0, 0, 0, /* 0x 500 */
80, 83, 88, 74, 83, 84, 65, 48, 92, 0, 0, 0, 80, 83, 88, 74, /* 0x 510 */
83, 84, 65, 90,104, 0, 0, 0, 80, 83, 88, 74, 83, 84, 72, 48, /* 0x 520 */
104, 0, 0, 0, 80, 83, 88, 74, 83, 84, 72, 90,112, 0, 0, 0, /* 0x 530 */
80, 83, 88, 68, 69, 67, 79, 48,112, 0, 0, 0, 80, 83, 88, 68, /* 0x 540 */
69, 67, 79, 90,112, 0, 0, 0, 80, 83, 88, 78, 50, 66, 68, 48, /* 0x 550 */
112, 0, 0, 0, 80, 83, 88, 78, 50, 66, 68, 90,148, 1, 0, 0, /* 0x 560 */
80, 83, 88, 78, 50, 68, 68, 48,148, 1, 0, 0, 80, 83, 88, 78, /* 0x 570 */
50, 68, 68, 90,220, 2, 0, 0, 80, 83, 88, 78, 50, 69, 68, 48, /* 0x 580 */
220, 2, 0, 0, 80, 83, 88, 78, 50, 69, 68, 90, 68, 4, 0, 0, /* 0x 590 */
77, 83, 69, 84, 66, 73, 71, 48, 68, 4, 0, 0, 77, 83, 69, 84, /* 0x 5a0 */
66, 73, 71, 90, 76, 4, 0, 0, 77, 83, 69, 84, 83, 77, 76, 48, /* 0x 5b0 */
76, 4, 0, 0, 77, 83, 69, 84, 83, 77, 76, 90, 80, 4, 0, 0, /* 0x 5c0 */
77, 83, 69, 84, 65, 76, 71, 48, 80, 4, 0, 0, 77, 83, 69, 84, /* 0x 5d0 */
65, 76, 71, 90, 96, 4, 0, 0, 77, 83, 69, 84, 85, 65, 76, 48, /* 0x 5e0 */
96, 4, 0, 0, 77, 83, 69, 84, 85, 65, 76, 90,116, 4, 0, 0, /* 0x 5f0 */
80, 83, 88, 69, 88, 73, 84, 48,116, 4, 0, 0, 80, 83, 88, 69, /* 0x 600 */
88, 73, 84, 90,168, 4, 0, 0, 80, 83, 88, 80, 72, 68, 82, 48, /* 0x 610 */
168, 4, 0, 0, 80, 83, 88, 80, 72, 68, 82, 90,200, 4, 0, 0, /* 0x 620 */
255,255,255,255,200, 4 /* 0x 630 */
0, 0, 0, 0, 0, 0, 0, 45, 32, 0, 0, 0, 80, 83, 49, 77, /* 0x 4c0 */
65, 73, 78, 48, 0, 0, 0, 0, 80, 83, 49, 77, 65, 73, 78, 90, /* 0x 4d0 */
92, 0, 0, 0, 80, 83, 49, 74, 83, 84, 65, 48, 92, 0, 0, 0, /* 0x 4e0 */
80, 83, 49, 74, 83, 84, 65, 90,104, 0, 0, 0, 80, 83, 49, 74, /* 0x 4f0 */
83, 84, 72, 48,104, 0, 0, 0, 80, 83, 49, 74, 83, 84, 72, 90, /* 0x 500 */
112, 0, 0, 0, 80, 83, 49, 68, 69, 67, 79, 48,112, 0, 0, 0, /* 0x 510 */
80, 83, 49, 68, 69, 67, 79, 90,112, 0, 0, 0, 80, 83, 49, 78, /* 0x 520 */
50, 66, 68, 48,112, 0, 0, 0, 80, 83, 49, 78, 50, 66, 68, 90, /* 0x 530 */
148, 1, 0, 0, 80, 83, 49, 78, 50, 68, 68, 48,148, 1, 0, 0, /* 0x 540 */
80, 83, 49, 78, 50, 68, 68, 90,220, 2, 0, 0, 80, 83, 49, 78, /* 0x 550 */
50, 69, 68, 48,220, 2, 0, 0, 80, 83, 49, 78, 50, 69, 68, 90, /* 0x 560 */
68, 4, 0, 0, 77, 83, 69, 84, 66, 73, 71, 48, 68, 4, 0, 0, /* 0x 570 */
77, 83, 69, 84, 66, 73, 71, 90, 76, 4, 0, 0, 77, 83, 69, 84, /* 0x 580 */
83, 77, 76, 48, 76, 4, 0, 0, 77, 83, 69, 84, 83, 77, 76, 90, /* 0x 590 */
80, 4, 0, 0, 77, 83, 69, 84, 65, 76, 71, 48, 80, 4, 0, 0, /* 0x 5a0 */
77, 83, 69, 84, 65, 76, 71, 90, 96, 4, 0, 0, 77, 83, 69, 84, /* 0x 5b0 */
85, 65, 76, 48, 96, 4, 0, 0, 77, 83, 69, 84, 85, 65, 76, 90, /* 0x 5c0 */
116, 4, 0, 0, 80, 83, 49, 69, 88, 73, 84, 48,116, 4, 0, 0, /* 0x 5d0 */
80, 83, 49, 69, 88, 73, 84, 90,168, 4, 0, 0, 80, 83, 49, 80, /* 0x 5e0 */
72, 68, 82, 48,168, 4, 0, 0, 80, 83, 49, 80, 72, 68, 82, 90, /* 0x 5f0 */
200, 4, 0, 0, 80, 83, 49, 82, 71, 83, 90, 48,200, 4, 0, 0, /* 0x 600 */
80, 83, 49, 82, 71, 83, 90, 90,204, 4, 0, 0,255,255,255,255, /* 0x 610 */
204, 4 /* 0x 620 */
};