Code:
#include "../tasm/ti84pce.inc"

.org userMem-2
.db tExtTok,tAsm84CeCmp


Start:
   call _homeup
   call _ClrScrnFull
   call create1555Palette
   ld hl, FullImage
   ld de, VRAM
   ld bc, FullImageEnd-FullImage
   ldir
 call getKey

   ret

create1555Palette:
   ld hl,mpLcdPalette
   ld b,0
_cp1555Loop:
   ld d,b
   ld a,b
   and a,%11000000
   srl d
   rra
   ld e,a
   and a,%00011111
   and a,b   \ or a,e
   ld (hl),a \ inc hl
   ld (hl),d \ inc hl
   inc b
   jr nz,_cp1555Loop
   call _boot_ClearVRAM
   ld a,lcdbpp8
   ld (mpLcdCtrl),a
   ret

FullImage:
 an 80x60 sprite
FullImageEnd:


.end
.END


I'm getting the following errors:

Code:
Brass Z80 Assembler 1.0.4.11 - Ben Ryves 2005-2006
--------------------------------------------------
Assembling...
Pass 1 complete. (830ms).
Warning: Data overflows 64KB page limit.
Error: Could not parse expression 'a,%11000000' (Invalid number). [zztemp.asm:27]
Error: Could not parse expression 'a,%00011111' (Invalid number). [zztemp.asm:31]
Error: Could not parse expression 'a,b' (Invalid number). [zztemp.asm:32]
Error: Could not parse expression 'a,e' (Invalid number). [zztemp.asm:32]
Error: Range of relative jump exceeded. (13697003 bytes) [zztemp.asm:36]
Pass 2 complete. (810ms).
Errors: 5, Warnings: 1.
Build failed.
----- There were errors.

What the heck? I don't get why the first 4 are wrong? or even the latter.
Try using spasm, this program works fine for me.
Brass can assemble Z80 assembly, but not eZ80, which is what the CE uses. As PT_ suggested, use spasm-ng instead. And make sure to pass the command-line -E flag to signal eZ80 mode.
Thanks for the help! I was able to compile and run and it fully worked! Just that the palette and coloring was kinda... horrible. lol.

ps: for another assembly project, im trying to find the full 8bpp color palette that the calculator uses. There was a resource I consulted a while back that provided the following code for creating the palette, and also had the palette itself embedded as an image with color values, but I seem unable to relocate said resource. The code piece is this:

Code:

create1555Palette:
   ld hl,mpLcdPalette
   ld b,0
_cp1555Loop:
   ld d,b \ ld a,b
   and a,%11000000
   srl d \ rra
   ld e,a
   and a,%00011111
   and a,b   \ or a,e
   ld (hl),a \ inc hl
   ld (hl),d \ inc hl
   inc b
   jr nz,cp1555Loop
   call _boot_clearVRAM
   ld a,lcdbpp8
   ld (mpLcdCtrl),a
   ret

If someone remembers this or has any idea what im referring to and can post the link, I'd greatly appreciate it. I have looked on ez80 heaven extensively and its not there. I remember using it and another site and I believe the "other site" was the one.
A few updates:
1. Trying to get back into the swing of ez80. My first successful, stable program I compiled this morning. Something that sets a palette then shows the colors with the text value. Only problem is the device name is "YAHTZEE" because i compiled it as such (its a preliminary). Kinda exciting to have a working asm program, however simple it may be Smile
http://www.mediafire.com/file/50cvxca8873be6f/palette.8xp

2. Having a crash with the following code:

Code:
; ## Draw Splash Screen ##
; Set bottom screen yellow
   ld a, cYellow
   ld bc, 320*240
   ld hl,VRAM
   call _MemSet
; Set banner red
   ld a, cRed
   ld bc, 320*50
   ld hl,VRAM
   call _MemSet
; Show name text
   ld hl, cYellow
   ld.sis (textFGColor), hl
   ld hl, cRed
   ld.sis (textBGColor), hl
   ld a,5 \ ld (curRow), a
   ld a, 100 \ ld (curCol),a
   ld hl, fontFlags
   ld a, (hl)
   or a, %00001100
   ld (hl), a
   ld hl, TitleText
   call _PutS


   call _GetKey
   call _boot_clearVRAM
   call resetLCDControls
   call _homeup
   ret

Code should set the screen to yellow, then create a 50-high red banner, starting at the top, with the text "Yahtzee - TI" appearing over it. I see the yellow and red appear just before the crash, allowing me to deduce the crash occurs within the PutS setup. Working on debugging.
I guess that

Code:
ld a, 100 \ ld (curCol),a
crashes, maybe you should change that to "ld a, 10" Wink
Oooohhhh! I feel so dumb! I meant to use penCol/row and the corresponding rom calls. Lol.
Thanks for that!

Edit: Looks like that wasn't the cause of the crash. I also figured that doing ld hl, cYellow (3 bytes), and then ld.sis (textFG/BGColor), hl was causing issues, so i changed all those to ld.sis. It still crashes. I'll step over it in a debugger tomorrow and post my results.


Code:
; Show name text
   ld.sis hl, cYellow
   ld.sis (textFGColor), hl
   ld.sis hl, cRed
   ld.sis (textBGColor), hl
   ld a,5 \ ld (penRow), a
   ld a, 100 \ ld (penCol),a
   ld hl, fontFlags
   ld a, (hl)
   or a, %00001100
   ld (hl), a
   ld hl, TitleText
   call _vPutS
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement