diff options
Diffstat (limited to 'frontends/calculator/CEdev/examples/random')
| -rw-r--r-- | frontends/calculator/CEdev/examples/random/autotester.json | 30 | ||||
| -rw-r--r-- | frontends/calculator/CEdev/examples/random/bin/DEMO.8xp | bin | 0 -> 381 bytes | |||
| -rw-r--r-- | frontends/calculator/CEdev/examples/random/bin/DEMO.bin | bin | 0 -> 305 bytes | |||
| -rw-r--r-- | frontends/calculator/CEdev/examples/random/bin/DEMO.map | 143 | ||||
| -rw-r--r-- | frontends/calculator/CEdev/examples/random/makefile | 15 | ||||
| -rw-r--r-- | frontends/calculator/CEdev/examples/random/obj/main.src | 69 | ||||
| -rw-r--r-- | frontends/calculator/CEdev/examples/random/readme.md | 9 | ||||
| -rw-r--r-- | frontends/calculator/CEdev/examples/random/screenshot.png | bin | 0 -> 213249 bytes | |||
| -rw-r--r-- | frontends/calculator/CEdev/examples/random/src/main.c | 19 | ||||
| -rw-r--r-- | frontends/calculator/CEdev/examples/random/test/expected.bin | bin | 0 -> 153600 bytes |
10 files changed, 285 insertions, 0 deletions
diff --git a/frontends/calculator/CEdev/examples/random/autotester.json b/frontends/calculator/CEdev/examples/random/autotester.json new file mode 100644 index 0000000..b41ad50 --- /dev/null +++ b/frontends/calculator/CEdev/examples/random/autotester.json @@ -0,0 +1,30 @@ +{ + "rom": "84pce_515.rom", + "transfer_files": [ + "bin/DEMO.8xp" + ], + "target": { + "name": "DEMO", + "isASM": true + }, + "sequence": [ + "action|launch", + "hashWait|1", + "key|enter", + "hashWait|2" + ], + "hashes": { + "1": { + "description": "VRAM filled with output of random()", + "start": "vram_start", + "size": "vram_16_size", + "expected_CRCs": [ "5FB4A617" ] + }, + "2": { + "description": "Back to the home screen (exit check)", + "start": "vram_start", + "size": "vram_16_size", + "expected_CRCs": [ "FFAF89BA", "101734A5", "9DA19F44" ] + } + } +} diff --git a/frontends/calculator/CEdev/examples/random/bin/DEMO.8xp b/frontends/calculator/CEdev/examples/random/bin/DEMO.8xp Binary files differnew file mode 100644 index 0000000..fabdb82 --- /dev/null +++ b/frontends/calculator/CEdev/examples/random/bin/DEMO.8xp diff --git a/frontends/calculator/CEdev/examples/random/bin/DEMO.bin b/frontends/calculator/CEdev/examples/random/bin/DEMO.bin Binary files differnew file mode 100644 index 0000000..fa7ca25 --- /dev/null +++ b/frontends/calculator/CEdev/examples/random/bin/DEMO.bin diff --git a/frontends/calculator/CEdev/examples/random/bin/DEMO.map b/frontends/calculator/CEdev/examples/random/bin/DEMO.map new file mode 100644 index 0000000..294fb77 --- /dev/null +++ b/frontends/calculator/CEdev/examples/random/bin/DEMO.map @@ -0,0 +1,143 @@ +Segment Base Top High Length +-------- ------ ------ ------ ------- +icon D1A882 D1A882 0h +launcher D1A882 D1A882 0h +libs D1A882 D1A882 0h +startup D1A882 D1A8C1 3Fh +cleanup D1A8C1 D1A8D5 14h +exit D1A8D5 D1A8DB 6h +code D1A8DB D1A9A0 C5h +data D1A9A0 D1A9B0 10h +strsect D1A9B0 D1A9B0 0h +text D1A9B0 D1A9B0 0h +bss D031F6 D031F6 D13FD6 0h +header D1A87F D1A882 3h + +Label Value +------------------------- ------ +_os_DisableHomeTextBuffer = D1A8DB +_os_EnableHomeTextBuffer = D1A8ED +_random = D1A8FF +__state = D1A9A0 +_boot_GetBootMajorVer = 000080 +_boot_GetHardwareVer = 000084 +_boot_GetBootMinorVer = 00008C +_boot_DebugPrintf = 0000B4 +_boot_ClearVRAM = 000374 +_boot_TurnOff = 000388 +_boot_NewLine = 000390 +_boot_Set6MHzMode = 00039C +_boot_Set48MHzMode = 0003A0 +_boot_Set6MHzModeI = 0003A4 +_boot_Set48MHzModeI = 0003A8 +_boot_GetBatteryStatus = 0003B0 +_boot_WaitShort = 0003B4 +_boot_CheckOnPressed = 00057C +_boot_SetDate = 000598 +_boot_GetDate = 0005A8 +_boot_GetTime = 0005B0 +_boot_SetTime = 0005B4 +_boot_IsAfterNoon = 0005C8 +_os_NewLine = 0207F0 +_os_PushErrorHandler = 021C78 +_os_PopErrorHandler = 021C7C +_os_ThrowError = 021C80 +_os_RealCopy = 021C84 +_os_RealAsinRad = 021C88 +_os_RealAcosRad = 021C8C +_os_RealAtanRad = 021C90 +_os_RealAdd = 021C94 +_os_CplxSquare = 021C98 +_os_RealCompare = 021C9C +_os_RealCosRad = 021CA0 +_os_RealRadToDeg = 021CA4 +_os_RealDiv = 021CA8 +_os_RealExp = 021CAC +_os_RealFloor = 021CB0 +_os_RealToStr = 021CB4 +_os_RealFrac = 021CB8 +_os_RealGcd = 021CBC +_os_RealRoundInt = 021CC0 +_os_RealLcm = 021CC4 +_os_RealLog = 021CC8 +_os_RealMax = 021CCC +_os_RealMin = 021CD0 +_os_RealMul = 021CD4 +_os_RealNcr = 021CD8 +_os_RealNeg = 021CDC +_os_RealNpr = 021CE0 +_os_RealPow = 021CE4 +_os_RealDegToRad = 021CE8 +_os_RealRandInt = 021CEC +_os_RealInv = 021CF0 +_os_RealMod = 021CF4 +_os_RealRound = 021CF8 +_os_RealSinRad = 021CFC +_os_RealSqrt = 021D00 +_os_RealSub = 021D04 +_os_RealTanRad = 021D08 +_os_StrToReal = 021D0C +_os_RealInt = 021D10 +_os_SetFlagBits = 021D14 +_os_ResetFlagBits = 021D18 +_os_TestFlagBits = 021D1C +_os_SetFlagByte = 021D20 +_os_GetFlagByte = 021D24 +_os_GetCursorPos = 021D28 +_os_PutStrFull = 021D2C +_os_PutStrLine = 021D30 +_os_SetCursorPos = 021D34 +_os_AppInit = 021D40 +_os_GetKey = 021D38 +_os_GetCSC = 021D3C +_os_DisableCursor = 021DE4 +_os_EnableCursor = 021DE8 +_os_FontDrawText = 021E00 +_os_FontGetHeight = 021E14 +_os_FontGetWidth = 021E18 +_os_InitDrawing = 021E1C +_os_SetDrawBGColor = 021E20 +_os_SetDrawFGColor = 021E24 +_os_FontSelect = 021E28 +_os_RclAns = 021E70 +_os_SetTimer1 = 021EC8 +_os_DisableTimer1 = 021ECC +_os_GetSystemStats = 021ED4 +_os_GetDrawBGColor = 021EE4 +_os_GetDrawFGColor = 021EE8 +_os_FontGetID = 021EEC +_os_RealToInt24 = 021EF4 +_os_Int24ToReal = 021EF8 +_os_ForceCmdNoChar = 021FA8 +_os_GetSymTablePtr = 021FB0 +_os_NextSymEntry = 021FB4 +_os_ChkFindSym = 021FB8 +_os_MemChk = 021FF0 +_os_SetTimer2 = 022080 +_os_DisableTimer2 = 022084 +_os_FloatToReal = 022170 +_os_RealToFloat = 022174 +_os_FontDrawTransText = 022178 +_os_CreateAppVar = 022184 +_asm_MoveDown = 0207F4 +_asm_MoveUp = 020800 +_asm_ClrLCDFull = 020808 +_asm_ClrLCD = 02080C +_asm_ClrTxtShd = 020818 +_asm_HomeUp = 020828 +_asm_RunIndicOn = 020844 +_asm_RunIndicOff = 020848 +_asm_DelRes = 020E5C +_asm_DisableAPD = 021134 +_asm_EnableAPD = 021138 +_asm_DrawStatusBar = 021A3C +_asm_ArcChk = 022040 +__frameset = D1A956 +__ccleanup = D1A8C1 +_errno = D008DC +_init = D1A882 +_exit = D1A8D7 +__exit = D1A8B0 +__exitsp = D1A8B0 +__errsp = D1A8B0 +_main = D1A964 diff --git a/frontends/calculator/CEdev/examples/random/makefile b/frontends/calculator/CEdev/examples/random/makefile new file mode 100644 index 0000000..1f1b36b --- /dev/null +++ b/frontends/calculator/CEdev/examples/random/makefile @@ -0,0 +1,15 @@ +# ---------------------------- +# Set NAME to the program name +# Set ICON to the png icon file name +# Set DESCRIPTION to display within a compatible shell +# Set COMPRESSED to "YES" to create a compressed program +# ---------------------------- + +NAME ?= DEMO +COMPRESSED ?= NO +ICON ?= iconc.png +DESCRIPTION ?= "C SDK Demo" + +# ---------------------------- + +include $(CEDEV)/include/.makefile diff --git a/frontends/calculator/CEdev/examples/random/obj/main.src b/frontends/calculator/CEdev/examples/random/obj/main.src new file mode 100644 index 0000000..9aa4a54 --- /dev/null +++ b/frontends/calculator/CEdev/examples/random/obj/main.src @@ -0,0 +1,69 @@ +; Zilog eZ80 ANSI C Compiler Release 3.4
+; -optsize -noreduceopt -nomodsect -peephole -globalopt
+; -localcse -const=ROM
+ FILE "SRC\MAIN.C"
+ .assume ADL=1
+ SEGMENT CODE
+; 1 #include <stdbool.h>
+; 2 #include <stddef.h>
+; 3 #include <stdint.h>
+; 4 #include <tice.h>
+; 5
+; 6 #include <stdio.h>
+; 7 #include <stdlib.h>
+; 8 #include <string.h>
+; 9
+; 10 void main(void) {
+_main:
+ LD HL,-3
+ CALL __frameset
+; 11 /* Fill VRAM with random data */
+; 12 uint32_t *lcd_Ram_i, *lcd_Ram_end = (uint32_t *) ((int) lcd_Ram + LCD_SIZE);
+; 13 for (lcd_Ram_i = (uint32_t *) lcd_Ram; lcd_Ram_i < lcd_Ram_end; lcd_Ram_i++) {
+ LD BC,13893632
+ LD (IX+-3),BC
+ JR L_3
+L_1:
+; 14 *lcd_Ram_i = random();
+ CALL _random
+ LD IY,(IX+-3)
+ LD (IY),HL
+ LD (IY+3),E
+ LEA IY,IY+4
+ LD (IX+-3),IY
+; 15 }
+L_3:
+ LD BC,14047232
+ LD HL,(IX+-3)
+ OR A,A
+ SBC HL,BC
+ JR C,L_1
+; 16
+; 17 /* Wait for a key press */
+; 18 while (!os_GetCSC());
+L_5:
+ CALL _os_GetCSC
+ OR A,A
+ JR Z,L_5
+; 19 }
+ LD SP,IX
+ POP IX
+ RET
+
+
+;**************************** _main ***************************
+;Name Addr/Register Size Type
+;_os_GetCSC IMPORT ----- function
+;_random IMPORT ----- function
+;lcd_Ram_i IX-3 3 variable
+
+
+; Stack Frame Size: 9 (bytes)
+; Spill Code: 0 (instruction)
+
+
+ XREF _os_GetCSC:ROM
+ XREF _random:ROM
+ XREF __frameset:ROM
+ XDEF _main
+ END
diff --git a/frontends/calculator/CEdev/examples/random/readme.md b/frontends/calculator/CEdev/examples/random/readme.md new file mode 100644 index 0000000..776d1f8 --- /dev/null +++ b/frontends/calculator/CEdev/examples/random/readme.md @@ -0,0 +1,9 @@ +### Random Fill Screen Demo + +This is a simple demo to demonstrate filling the screen with random colors. + + + +--- + +This demo is a part of the C SDK Toolchain for use on the CE. diff --git a/frontends/calculator/CEdev/examples/random/screenshot.png b/frontends/calculator/CEdev/examples/random/screenshot.png Binary files differnew file mode 100644 index 0000000..409044e --- /dev/null +++ b/frontends/calculator/CEdev/examples/random/screenshot.png diff --git a/frontends/calculator/CEdev/examples/random/src/main.c b/frontends/calculator/CEdev/examples/random/src/main.c new file mode 100644 index 0000000..83477e4 --- /dev/null +++ b/frontends/calculator/CEdev/examples/random/src/main.c @@ -0,0 +1,19 @@ +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> +#include <tice.h> + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +void main(void) { + /* Fill VRAM with random data */ + uint32_t *lcd_Ram_i, *lcd_Ram_end = (uint32_t *) ((int) lcd_Ram + LCD_SIZE); + for (lcd_Ram_i = (uint32_t *) lcd_Ram; lcd_Ram_i < lcd_Ram_end; lcd_Ram_i++) { + *lcd_Ram_i = random(); + } + + /* Wait for a key press */ + while (!os_GetCSC()); +} diff --git a/frontends/calculator/CEdev/examples/random/test/expected.bin b/frontends/calculator/CEdev/examples/random/test/expected.bin Binary files differnew file mode 100644 index 0000000..4e42d97 --- /dev/null +++ b/frontends/calculator/CEdev/examples/random/test/expected.bin |