Skip to content

Commit 1e29c18

Browse files
Fix a few bugs
1 parent e0b6b74 commit 1e29c18

File tree

9 files changed

+27
-28
lines changed

9 files changed

+27
-28
lines changed

Cesium.8xp

3.98 KB
Binary file not shown.

Cesium_French.8xp

4.01 KB
Binary file not shown.

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ To uninstall Cesium, just press [2ND],[+],[2],[1] and delete the following files
5252
* Cesium (AppVar)
5353

5454
### CREDITS ###
55-
(C) January 2017 Matt Waltz
55+
(C) March 2017 Matt Waltz
5656
"MateoConLechuga"
5757
Licensed under BSD 3 Clause.
5858

src/Cesium.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ CesiumIcon: ; Signifies a CesiumOS program (haha)
5858
.db 0FFh,0FFh,0FFh,0DEh,0FFh,0FFh,094h,0B5h,0B5h,06Bh,0FFh,0FFh,0DEh,0FFh,0FFh,0FFh
5959
.db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0B6h,08Ch,06Ch,0B5h,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh
6060
VersionStr:
61-
.db "Cesium Version 2.1.1",0
61+
.db "Cesium Version 2.2.0",0
6262
CesiumEnd:
6363

6464
.echo "Reloader Size:\t\t",CesiumReLoader_End-CesiumReLoader_Start

src/build.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@echo off
22
color 0F
33
:A
4-
tools\spasm -E -T Cesium.asm bin\CESIUM.8xp
4+
tools\spasm -E -T -L Cesium.asm bin\CESIUM.8xp
55
pause
66
goto A

src/routines/exit.asm

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
FullExit:
33
call _boot_ClearVRAM
44
ld a,$2D
5-
ld (mpLcdCtrl),a ; Set LCD to 16bpp
5+
ld (mpLcdCtrl),a ; Set LCD to 16bpp
66
set graphdraw,(iy+graphFlags)
77
res useTokensInString,(iy+clockFlags)
8-
res onInterrupt,(iy+onFlags) ; [ON] break error destroyed
9-
ld hl,CesiumPrgmName
8+
res onInterrupt,(iy+onFlags) ; [ON] break error destroyed
9+
ld hl,CesiumPrgmNameExit
1010
call _Mov9ToOP1
1111
call _ChkFindSym
1212
call _ChkInRam
1313
call nz,_Arc_Unarc
14-
call _ClrTxtShd ; clear text shadow
14+
call _ClrTxtShd ; clear text shadow
1515
call _DrawStatusBar
1616
ld hl,pixelshadow
1717
ld bc,SaveSScreen-pixelShadow
@@ -20,42 +20,44 @@ FullExit:
2020
xor a,a
2121
im 1
2222
ei
23-
ld hl,stub
23+
ld hl,stub ; this should only be done if the setting is active!
2424
ld de,flashRAMCode
2525
ld bc,stubEnd-stub
2626
ldir
2727
jp flashRAMCode
28+
29+
CesiumPrgmNameExit:
30+
.db protProgObj,"CESIUM",0
31+
2832
stub:
2933
relocate(flashRAMCode)
3034
ld hl,userMem
3135
ld de,(asm_prgm_size)
3236
call _DelMem
3337
res apdWarmStart, (iy + apdFlags)
34-
call ClearOldBackup
38+
ld a,(AutoBackup)
39+
or a,a
40+
call nz,ClearOldBackup
3541
ld a,kClear
36-
jp _JForceCmd ; clear the screen like a boss
42+
jp _JForceCmd ; clear the screen like a boss
3743

3844
ClearOldBackup:
39-
di ; let's do some crazy flash things so that way we can save the RAM state...
45+
di ; let's do some crazy flash things so that way we can save the RAM state...
4046
ld a, $D1
4147
ld mb,a
4248
ld.sis sp,$987E
4349
call.is funlock - $D10000
4450
45-
ld a,$3C
46-
call EraseSectorBackup ; this is so we can store the new RAM data \o/
51+
ld b,0
52+
ld de,$3C0000
53+
call _WriteFlashByte ; this is so we can store the new RAM data \o/
4754
4855
call.is flock - $D10000
4956
ld a,$D0
5057
ld mb,a
5158

5259
ret
5360

54-
EraseSectorBackup:
55-
ld bc,$0000F8 ; apparently we can't erase sectors unless we call this routine from flash... Well, I called it from flash now :) (lol, what a secuity flaw)
56-
push bc
57-
jp _EraseFlashSector
58-
5961
#include "routines/ramquit.asm"
6062
endrelocate()
61-
stubEnd:
63+
stubEnd:

src/routines/loader.asm

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ cesiumLoader:
2020
jp nz,RunBasicProgram
2121
call MovePgrmToUserMem ; the program is now stored at userMem -- Now we need to check and see what kind of file it is - C or assembly
2222
push hl
23-
ld hl,ReturnHere
23+
ld hl,ReturnHereIfError
2424
call _PushErrorHandler
25-
ld de,ReturnHere
25+
ld de,ReturnHereNoError
2626
push de
2727
jp UserMem ; simply call userMem to execute the program
2828

@@ -66,10 +66,6 @@ GoodInRAM:
6666
ld (kbdGetKy),a
6767
ei
6868
jp _ParseInp ; run program
69-
70-
SaveRAMStateToFlash:
71-
call SaveRAMState
72-
jp ReturnHere
7369
7470
SaveRAMState:
7571
ld hl,ramsave_sectors_start

src/routines/reloader.asm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@ ErrCatchBASIC:
1616
res textInverse, (iy + textFlags)
1717
call _PutS
1818
call _GetKey
19-
jr +_
19+
jr ReturnHereIfError
2020

2121
ReturnHereBASIC:
22-
ReturnHere: ; handler for returning programs
22+
ReturnHereNoError: ; handler for returning programs
2323
call _PopErrorHandler
24-
_: ld hl,CesiumAppVarNameReloader
24+
ReturnHereIfError: ; handler for returning programs
25+
ld hl,CesiumAppVarNameReloader
2526
call _Mov9ToOP1
2627
call _ChkFindSym
2728
call _ChkInRam

src/tools/NEED_SPASM-NG.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)