Skip to content

Commit

Permalink
Fixed a ton of things \o/
Browse files Browse the repository at this point in the history
+ Fixes gfx_Shift functions
+ Fixes gfx_GetSprite and gfx_GetSprite_NoClip
+ Fixes gfx_GetClipRegion
+ Fixes gfx_Line
+ Fixes gfx_Tilemap with global tilemap structs
+ Makes clipping routines exclusive
+ Optimizes memset_fast
+ Moves folder structure around so includes go in the include folder
+ Fixes some demos and removes some needless code
+ Adds defines to os_GetCSC values in tice.h
+ Removes invalid defines and prototypes from stdio.h
+ Makes startup module easily editable
+ Proably some more things, but hopefully all the bugs are fixed now :)
  • Loading branch information
mateoconlechuga committed Sep 7, 2016
1 parent 7501400 commit 7d3e9d7
Show file tree
Hide file tree
Showing 54 changed files with 2,808 additions and 782 deletions.
16 changes: 11 additions & 5 deletions CEdev/bin/main_makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#----------------------------
# Startup modules and LibLoad library setup -- feel free to modify these to suit your program.
# Can be found in CEDev/include/asm
#----------------------------
CSTARTUP_ASM := cstartup.asm
LIBHEADER_ASM := libheader.asm
#----------------------------

#----------------------------
#Try not to edit anything below these lines unless you know what you are doing
#----------------------------
Expand All @@ -16,17 +24,15 @@ NULL = >nul 2>&1
#Generate the default names for input and object files
TARGETHEX := $(TARGET).hex
ICON_ASM := iconc.asm
CSTARTUP_ASM := cstartup.asm
LIBHEADER_ASM := libheader.asm

#Objects
ICON_OBJ := $(ICON_ASM:%.asm=%.obj)
CSTARTUP_OBJ := $(CSTARTUP_ASM:%.asm=%.obj)
LIBHEADER_OBJ := $(LIBHEADER_ASM:%.asm=%.obj)

#Get the locations of the startup modules and LibLoad modules
LIBHEADER_LOC := $(CEDEV)/include/ce/asm/$(LIBHEADER_ASM)
CSTARTUP_LOC := $(CEDEV)/include/ce/asm/$(CSTARTUP_ASM)
LIBHEADER_LOC := $(CEDEV)/include/asm/$(LIBHEADER_ASM)
CSTARTUP_LOC := $(CEDEV)/include/asm/$(CSTARTUP_ASM)

#Find all the directories in the source input
ALLDIRS := $(sort $(dir $(wildcard $(SRCDIR)/*/)))
Expand Down Expand Up @@ -87,7 +93,7 @@ endif

#Define the nesassary headers, along with any the user may have defined, where modification should just trigger a build
USERHEADERS := $(call WINPATH,$(foreach dir,$(ALLDIRS),$(wildcard $(dir)*.h)))
HEADERS := $(subst $(space),;,$(call WINPATH,. $(ALLDIRS) $(addprefix $(CEDEV)/,. include/ce/asm include/ce/c include include/std lib/std/ce lib/ce $(LIBLOC))))
HEADERS := $(subst $(space),;,$(call WINPATH,. $(ALLDIRS) $(addprefix $(CEDEV)/,. include include/asm include/lib/ce include/lib/std $(LIBLOC))))
LIBRARIES := $(call WINPATH,$(addprefix $(CEDEV)/lib/std/,ce/ctice.lib ce/cdebug.lib chelp.lib crt.lib crtS.lib nokernel.lib fplib.lib fplibS.lib))
LIBRARIES += $(call WINPATH,$(foreach var,$(L),$(CEDEV)/lib/ce/$(var)/$(var).lib))

Expand Down
Binary file modified CEdev/examples/demo_0/bin/DEMO0.8xp
Binary file not shown.
4 changes: 1 addition & 3 deletions CEdev/examples/demo_0/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ const char Welcome[] = "Welcome to C!";
char Apples[] = "Apples!";
char Oranges[] = "Oranges";

int24_t h = 12;

/* Put all your code here */
void main(void) {
/* uint8_t is an unsigned integer that can range from 0-255. It generally performs faster than just an int, so try to use it when possible */
uint8_t count = h;
uint8_t count;

/* This function cleans up the screen and gets everything ready for the OS */
prgm_CleanUp();
Expand Down
Binary file modified CEdev/examples/demo_1/bin/DEMO1.8xp
Binary file not shown.
22 changes: 4 additions & 18 deletions CEdev/examples/demo_1/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ void main(void) {
/* Turn the whole screen black */
fillScreen(0x00);

/* Wait for a second */
waitSeconds(1);
/* Wait for a key press */
while( !os_GetCSC() );

/* Turn the whole screen red */
fillScreen(0xE0);

/* Wait for a second */
waitSeconds(1);
/* Wait for a key press */
while( !os_GetCSC() );

/* Clean up for the return to the OS */
prgm_CleanUp();
Expand All @@ -43,17 +43,3 @@ void fillScreen(unsigned color) {
/* memset_fast is a way faster implementation of memset; either one will work here though */
memset_fast(lcd_vramArray, color, 320*240*2);
}

/* Wait for a specified about of seconds between 0 and 60 */
/* Note that this will affect the user's actual time on the calculator */
/* A better option would be to use the general purpose timers, since they provide more accurate timming */
void waitSeconds(uint8_t seconds) {
/* Set the inital seconds to 0 */
rtc_SetSeconds(0);

/* Load the 0 seconds into the clock */
rtc_LoadSetTime();

/* Wait until we reach the second needed */
while(rtc_GetSeconds() != seconds+1);
}
Binary file modified CEdev/examples/library_examples/graphics/demo_0/bin/GRAPHX0.8xp
Binary file not shown.
4 changes: 2 additions & 2 deletions CEdev/examples/library_examples/graphics/demo_0/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void print_string_centered(const char *str);

/* Put all your code here */
void main(void) {
const char msg[] = "Hello World!";
const char *msg = "Hello World!";

/* Seed the random numbers */
srand( rtc_Time() );
Expand All @@ -32,7 +32,7 @@ void main(void) {
/* Set the random text color */
gfx_SetTextFGColor( randInt(1,255) );

/* Print a string centered on the screen */
/* Print the message on the screen */
print_string_centered( msg );

/* Wait for a key to be pressed */
Expand Down
50 changes: 0 additions & 50 deletions CEdev/examples/library_examples/graphics/demo_3/GRAPHX3_test.json

This file was deleted.

Binary file modified CEdev/examples/library_examples/graphics/demo_3/bin/GRAPHX3.8xp
Binary file not shown.
2 changes: 0 additions & 2 deletions CEdev/examples/library_examples/graphics/demo_3/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ void main(void) {

/* Shift the screen around a bit */
gfx_ShiftDown(20);
gfx_ShiftRight(20);
gfx_ShiftLeft(20);
gfx_ShiftDown(20);

/* Wait for any key */
Expand Down
Binary file modified CEdev/examples/library_examples/graphics/demo_5/bin/GRAPHX5.8xp
Binary file not shown.
Loading

0 comments on commit 7d3e9d7

Please sign in to comment.