Skip to content

Commit

Permalink
Update source to beta4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
NuVanDibe committed Apr 6, 2022
1 parent b3a2576 commit 86bc592
Show file tree
Hide file tree
Showing 49 changed files with 210 additions and 229 deletions.
4 changes: 3 additions & 1 deletion libfc_visoly_xg1/dual.s
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,16 @@ executeCart:

mov r2, #0x03000000
add r1, r2, #0x7E00
@ add r2, r1, #0x200

bx r1

reset_func:

@ add r1,#0x100
@ mov r3,#0
@0:
@ str r3,[r1, #-4]!
@ str r3,[r1, #4]!
@ cmp r1,r2
@ bne 0b

Expand Down
Binary file modified libfc_visoly_xg1/libflashcart.a
Binary file not shown.
Binary file modified libfc_xrom/libflashcart.a
Binary file not shown.
Binary file modified libpogo/lib/libpogo.a
Binary file not shown.
Binary file modified libpogo/lib/libpogod.a
Binary file not shown.
16 changes: 14 additions & 2 deletions libpogo/source/core_iwram.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,21 @@
#include "rtc.h"

CODE_IN_IWRAM void *memset(void *dest, int v, int l)
{ uchar *d = dest;
while(l--)
{
int l2;
uchar *d;
uint16 v2, *d2 = dest;

v2 = v | (v<<8);

l2 = l>>1;
while (l2--)
*d2++ = v2;

d = (uchar *) d2;
if (l & 1)
*d++ = v;

return dest;
}

Expand Down
35 changes: 16 additions & 19 deletions libpogo/source/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ void execv(const char *cmdname, const char *const *argv)
{
uint32 *p;
uint32 l;
int i = 0;

int fd = open(cmdname, 0);
if(fd >= 0)
Expand All @@ -215,35 +214,30 @@ void execv(const char *cmdname, const char *const *argv)
if((l&0x00007FFF) == 0)
{

memset((void *)(0x02000000), 0, 256*1024);
make_arguments(cmdname, argv);

// Remap for start position of rom
p = (uint32 *)(0x02000000+255*1024);
//if(p[-1] >= 0x08000000)
if(argv[0])
p[-1] -= (l - 0x08000000);

if(!argv[0])
{
p = (uint32 *)(0x02000000);
for(i=0; i<256*256; i++)
p[i] = 0;
}

//reset_io();

SETW(REG_IE, 0);
SETW(REG_IF, 0);
SETW(REG_IME, 0);
//SETW(REG_IE, 0);
//SETW(REG_IF, 0);
//SETW(REG_IME, 0);


SETW(REG_DISPCNT, DISP_MODE_0 | DISP_BG1_ON );
SETW(REG_BG1CNT, 0);
//SETW(REG_DISPCNT, DISP_MODE_0 | DISP_BG1_ON );
//SETW(REG_BG1CNT, 0);

//p = (uint32 *)0x03007FC0;
//for(i=0; i<4*4; i++)
// p[i] = 0;

SETW(REG_SOUNDBIAS, 0x0200);
//SETW(REG_SOUNDBIAS, 0x0200);

#ifdef CARTLIB
fcExecuteRom(l, jump_adress);
Expand All @@ -270,11 +264,12 @@ void execv_mb(const char *cmdname, const char *const *argv)
{
read(fd, (uchar *)0x02000000, 1024*256);

SETW(REG_IE, 0);
SETW(REG_IF, 0);
SETW(REG_IME, 1);
SETW(REG_DISPCNT, DISP_MODE_0 | DISP_BG1_ON );
SETW(REG_BG1CNT, 0);
//SETW(REG_IE, 0);
//SETW(REG_IF, 0);
//SETW(REG_IME, 1);
//SETW(REG_DISPCNT, DISP_MODE_0 | DISP_BG1_ON );
//SETW(REG_BG1CNT, 0);
SoftReset(0xe2);
((void(*)(void))0x02000000)();
}

Expand All @@ -296,6 +291,7 @@ int open(const char *name, int flags)
char *cutname;

if((dev = dev_fromname(name, &cutname)))
{
if(dev->open) {
fd = dev->open(cutname, flags);
if(fd < 0)
Expand All @@ -308,6 +304,7 @@ int open(const char *name, int flags)
return i;
}
}
}
return -1;
}

Expand Down
2 changes: 1 addition & 1 deletion libpogo/source/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void *memory_alloc(int alloc_size)
block = block->next;
}

dprint("Out of memory!\n");
//dprint("Out of memory!\n");
return NULL;
/*
block->next = (MemHead *)&block->data[block->size];
Expand Down
Binary file modified libpogo/source/obj/core_iwram.o
Binary file not shown.
Binary file modified libpogo/source/obj/device.o
Binary file not shown.
Binary file modified libpogo/source/obj/romfilesys.o
Binary file not shown.
Binary file modified libpogo/source/objd/core_iwram.o
Binary file not shown.
Binary file modified libpogo/source/objd/device.o
Binary file not shown.
Binary file modified libpogo/source/objd/romfilesys.o
Binary file not shown.
1 change: 1 addition & 0 deletions libpogo/source/romfilesys.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include "core.h"
#include "device.h"
#include "io.h"
#include "max_file_count.h"
#include "aes.h"

Expand Down
42 changes: 26 additions & 16 deletions makefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Uses rijndael.py from the tlslite package
Usage: makefs.py [-rxmcva:] [--exclude=] pogo.gba root flashme.gba
Usage: makefs.py [-rexmcva:] [--exclude=] pogo.gba root flashme.gba
Made by Kuwanger in Jan/Feb 2006
"""
Expand All @@ -30,6 +30,7 @@
MAXHIDDENDIRSIZE = MAXHIDDENDIRS*ROMFILESIZE

verbose = 0
emptydir_remove = 0
moresecurepad = 0
align_mask = 32767
xrom = 0
Expand Down Expand Up @@ -448,6 +449,7 @@ def __init__(self, path, relative_to_root, plugins_dir, truncate, correct, inhid
count = 0
stats = []
wholefolder = os.listdir(path)
empty_hiddendir = 0
for f in wholefolder:
stats.append([ f, os.stat(path + "/" + f)[ST_MODE] ])
for f in stats:
Expand All @@ -461,29 +463,35 @@ def __init__(self, path, relative_to_root, plugins_dir, truncate, correct, inhid
print "Invalid key", f[0]
sys.exit(5)
self.hiddendir = pogodir(path + "/" + f[0], relative_to_root+f[0] + "/", plugins_dir, truncate, correct, 1)
self.hiddendir.size -= (16*3)
if self.hiddendir.size > MAXHIDDENDIRSIZE:
print "Hidden dir can only be %d entries long. You must remove at least %d. Aborting." % ( MAXHIDDENDIRS, self.hiddendir.size / ROMFILESIZE - MAXHIDDENDIRS )
sys.exit(1)
self.hiddendir.realsize = self.hiddendir.size
self.hiddendir.flags |= HIDDEN | ENCRYPTED
self.hiddendir.name = self.fillname(f[0], 0)
self.hiddendir.size = (self.hiddendir.size + 15) & ~15
self.hiddendir.key = long2chrl(value & ((1 << 128) - 1 - (3<<126)), 16)
self.key = self.hiddendir.key
if emptydir_remove and not self.hiddendir.subdirs and not self.hiddendir.files:
empty_hiddendir = 1
else:
self.hiddendir.size -= (16*3)
if self.hiddendir.size > MAXHIDDENDIRSIZE:
print "Hidden dir can only be %d entries long. You must remove at least %d. Aborting." % ( MAXHIDDENDIRS, self.hiddendir.size / ROMFILESIZE - MAXHIDDENDIRS )
sys.exit(1)
self.hiddendir.realsize = self.hiddendir.size
self.hiddendir.flags |= HIDDEN | ENCRYPTED
self.hiddendir.name = self.fillname(f[0], 0)
self.hiddendir.size = (self.hiddendir.size + 15) & ~15
self.hiddendir.key = long2chrl(value & ((1 << 128) - 1 - (3<<126)), 16)
self.key = self.hiddendir.key
else:
count += 1
dir = pogodir(path + "/" + f[0], relative_to_root + f[0] + "/", plugins_dir, truncate, correct, inhidden)
dir.name = dir.fillname(f[0], correct)
self.subdirs.append(dir)
if not emptydir_remove or dir.subdirs or dir.files or dir.hiddendir:
count += 1
dir.name = dir.fillname(f[0], correct)
self.subdirs.append(dir)
elif S_ISREG(f[1]):
if f[0][f[0].rfind("."):] not in exclude_ext:
if relative_to_root == plugins_dir or f[0][f[0].rfind("."):] not in exclude_ext:
count += 1
file = pogofile(path + "/" + f[0], 0, truncate, correct)
if relative_to_root == plugins_dir:
#print "Plugin:", f[0]
file.flags |= LOWER
self.files.append(file)
if empty_hiddendir:
self.hiddendir = 0
self.size = count*ROMFILESIZE + (16*3)
def generateraw(self):
'''generate the correctly formatted subdirectory, telling
Expand Down Expand Up @@ -575,7 +583,7 @@ def usage(name):
correct = 0
autocorrectchar = ""
try:
opts, args = getopt.gnu_getopt(argv[1:], "rxmcva:", ["romtrunc", "correct", "moresecurepad", "verbose", "xrom", "autocorrectchar=", "exclude="])
opts, args = getopt.gnu_getopt(argv[1:], "rsxmcva:", ["romtrunc", "correct", "subdirempty", "moresecurepad", "verbose", "xrom", "autocorrectchar=", "exclude="])
except getopt.GetoptError:
usage(argv[0])
sys.exit(1)
Expand All @@ -586,6 +594,8 @@ def usage(name):
correct = 1
if o in ("-v", "--verbose"):
verbose = 1
if o in ("-s", "--subdirempty"):
emptydir_remove = 1
if o in ("-a", "--autocorrectchar"):
autocorrectchar = a
if len(autocorrectchar) != 1:
Expand Down
29 changes: 9 additions & 20 deletions shell2/backdrop.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ BackDrop *backdrop_new(uint16 style)
bd->color[1] = Black_Color;
bd->color[2] = Gray_Color;
bd->color[3] = Gray_Color;
bd->color[4] = Dark_Color;

bd->border = 0;
bd->bitmap = NULL;
Expand All @@ -24,6 +25,7 @@ BackDrop *backdrop_new(uint16 style)
void backdrop_set_attribute(BackDrop *bd, int attr, void *val)
{
int l;
int n = attr&0xf;
switch(attr & 0xFF0)
{
case WATR_BITMAP:
Expand All @@ -35,9 +37,11 @@ void backdrop_set_attribute(BackDrop *bd, int attr, void *val)
break;
case WATR_RGB:
l = (int)val;
bd->color[attr & 0xF].r = l>>16;
bd->color[attr & 0xF].g = (l>>8) & 0xff;
bd->color[attr & 0xF].b = l & 0xff;

bd->color[n].r = (l>>16) & 0xff;
bd->color[n].g = (l>>8) & 0xff;
bd->color[n].b = l & 0xff;
bd->color[n].a = l>>24;
break;
case WATR_BORDER:
bd->border = (int)val;
Expand Down Expand Up @@ -95,24 +99,9 @@ void backdrop_render(BackDrop *bd, Rect *r, BitMap *bm)
// Draw inner

if (bm) {
if(bd->style & STYLE_BITMAP)
{
bitmap_blit(bm, r->x, r->y, bd->bitmap, 0, 0, r->w, r->h);
}
else
{
if(bd->style & STYLE_HVRANGE)
{
bitmap_fillrange(bm, r, &bd->color[2], &bd->color[3], bd->style);
}
else
{
bitmap_fillbox(bm, r, TO_RGB16(bd->color[2]));
}
}
backdrop_subrender(bd, r, r, bm);

if(bd->border)
{
if(bd->border) {
int y, w;
int boffs, roffs;
uint16 *d;
Expand Down
2 changes: 1 addition & 1 deletion shell2/backdrop.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ typedef struct
uint16 style;
uchar border;
uchar something;
Color color[4];
Color color[5];
BitMap *bitmap;

} BackDrop;
Expand Down
Binary file modified shell2/backdrop.o
Binary file not shown.
Loading

0 comments on commit 86bc592

Please sign in to comment.