File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change 42
42
;-------------------------------------------------------------------------------
43
43
segment .startup
44
44
45
- call 0020848h ; _RunInicOff
45
+ call 0020848h ; _RunInicOff, assumes iy=flags
46
46
di
47
47
ld hl , __low_bss
48
48
ld bc , 010DE2h ; maximum size of BSS+Heap
@@ -57,31 +57,31 @@ _init:
57
57
ld (__errsp + 1 ) , sp ; save the stack from death
58
58
call _main
59
59
__exit:
60
- ex de , hl
61
60
__errsp:
62
61
ld sp , 0
63
62
pop af
64
- pop hl
65
- ld (hl) , a ; restore flash wait states
66
- push de
63
+ pop de
64
+ ld (de) , a ; restore flash wait states
65
+ pop iy ; restore iy for OS
66
+ push hl ; exit code
67
67
call 0004F0h ; usb_ResetTimers
68
68
69
69
ifdef PRGM_CLEANUP
70
- ld iy , %D00080
71
70
res 4 , (iy + 9 ) ; onInterrupt,(iy+onFlags)
72
71
set 0 , (iy + 3 ) ; graphDraw,(iy+graphFlags)
73
72
call % 0020808 ; _ClrLCDFull
74
73
call % 0020828 ; _HomeUp
75
74
call %0021A3C ; _DrawStatusBar
76
75
endif
77
76
78
- pop hl ; program return value in hl
79
- pop iy ; restore previous iy
77
+ pop hl ; exit code
80
78
ret
79
+
81
80
_exit:
82
- pop de
83
- pop de
81
+ pop hl
82
+ pop hl
84
83
jr __errsp
84
+
85
85
;-------------------------------------------------------------------------------
86
86
segment code
87
87
;-------------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments