[TI ASM] Splash Screen In Greyscale
Moderator: MaxCoderz Staff
- L4E_WakaMol-King
- Maxcoderz Staff
- Posts: 342
- Joined: Tue 01 Nov, 2005 6:34 am
There's got to be a simple greyscale routine out there somewhere that I can just plug my picture into...
Desolate was virtually flickerless when I played it... so I know it can be done...
Desolate was virtually flickerless when I played it... so I know it can be done...
- Now Under Development - [Progress]
Yes, if you ditch the sound idea, you can just use a greyscale package. Not that that will be perfect, but you'll get a lot closer to perfection a lot faster
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
- L4E_WakaMol-King
- Maxcoderz Staff
- Posts: 342
- Joined: Tue 01 Nov, 2005 6:34 am
Here's my updated code, Jim e.
- Interrupts disabled
- IonFastCopy
- Direct key input instead of _getkey
The best value for TEST_VALUE was about 2200 or 2550... but it's still flickery and fairly wavey.
- Interrupts disabled
- IonFastCopy
- Direct key input instead of _getkey
The best value for TEST_VALUE was about 2200 or 2550... but it's still flickery and fairly wavey.
Code: Select all
ld hl,2000 ; TEST_VALUE = 2200 or 2550
ld (TEST_VALUE),hl
di ; Disable interrupts
lp_greyscale_loop:
ld hl,Splash1 ; Draw Layer 1
call disp_pic
ld hl,Splash2 ; Draw Layer 2
call disp_pic
ld hl,Splash2 ; Draw Layer 2
call disp_pic
ld c,1 ; Read in a key
ld a,$FF
out (c),a
ld a,%11111110
out (c),a
in b,(c)
bit 3,b ; Increase TEST_VALUE on [UP]
jr z, increase_test
bit 0,b ; If [DEL] not pressed, loop
jr nz, lp_greyscale_loop
jp main_game_start ; Goto start of game
disp_pic: ; Display a picture to the screen
ld de,PLOTSSCREEN
ld bc,768
ldir
call IonFastCopy
ld bc,(TEST_VALUE) ; Loop for greyscale timing
delayloop:
dec bc ; 6 tstates
ld a,b ; 4 tstates
or c ; 4 tstates
jp nz,delayloop ; 10 tstates
ret
increase_test:
ld bc,1
ld hl,(TEST_VALUE)
add hl,bc
ld (TEST_VALUE),hl
ld a,0
ld (curcol),a
bcall(_disphl)
bcall(_getkey)
nop
nop
nop
jr lp_greyscale_loop
- Now Under Development - [Progress]
- L4E_WakaMol-King
- Maxcoderz Staff
- Posts: 342
- Joined: Tue 01 Nov, 2005 6:34 am
The getkey you see in there is to pause the program after incrementing the TEST_VALUE. Basically, TEST_VALUE starts at 2000, and every time you press the UP key, it adds one to it. When you do that, it pauses the program and displays the value of TEST_VALUE on the screen... that way when you get to the best value of TEST_VALUE, you can write down what it is.
I could be wrong, but since that getkey only executes once every time that you press the UP key, and not during the actual greyscale display loop, I doubt it is affecting the quality of the greyscale.
I could be wrong, but since that getkey only executes once every time that you press the UP key, and not during the actual greyscale display loop, I doubt it is affecting the quality of the greyscale.
- Now Under Development - [Progress]
- L4E_WakaMol-King
- Maxcoderz Staff
- Posts: 342
- Joined: Tue 01 Nov, 2005 6:34 am
Same problems . It seems that the best value for TEST_VALUE is somewhere around 2250 now.
Could _disphl be the problem?
Could _disphl be the problem?
Code: Select all
ld hl,2000 ; TEST_VALUE = 2200 or 2550
ld (TEST_VALUE),hl
di ; Disable interrupts
lp_greyscale_loop:
ld hl,Splash1 ; Draw Layer 1
call disp_pic
ld hl,Splash2 ; Draw Layer 2
call disp_pic
ld hl,Splash2 ; Draw Layer 2
call disp_pic
ld c,1 ; Read in a key
ld a,$FF
out (c),a
ld a,%11111110
out (c),a
in b,(c)
bit 3,b ; Increase TEST_VALUE on [UP]
jr z, increase_test
bit 2,b ; If [DEL] not pressed, loop
jr nz, lp_greyscale_loop
jp main_game_start ; Goto start of game
disp_pic: ; Display a picture to the screen
ld de,PLOTSSCREEN
ld bc,768
ldir
call IonFastCopy
ld bc,(TEST_VALUE) ; Loop for greyscale timing
delayloop:
dec bc ; 6 tstates
ld a,b ; 4 tstates
or c ; 4 tstates
jp nz,delayloop ; 10 tstates
ret
increase_test:
ld bc,1
ld hl,(TEST_VALUE)
add hl,bc
ld (TEST_VALUE),hl
ld a,0
ld (curcol),a
bcall(_disphl)
ld c,1 ; Check for [LEFT] key
key_in_loop:
ld a,$FF
out (c),a
ld a,%11111110
out (c),a
in b,(c)
bit 1,b
jp nz, key_in_loop
nop
nop
nop
jr lp_greyscale_loop
- Now Under Development - [Progress]
- Jim e
- Calc King
- Posts: 2457
- Joined: Sun 26 Dec, 2004 5:27 am
- Location: SXIOPO = Infinite lives for both players
- Contact:
You seem to be under estimating the amount of tuning you need to do. I meant for you to out right remove getkey(not replace). Just get rid of the disp hl and getkey. And add in a decreaser as well YOU'LL NEED IT. When you exit, thats when you can disphl.
Last thing try a TEST_VALUE of 1000. That might do better.
Last thing try a TEST_VALUE of 1000. That might do better.
- L4E_WakaMol-King
- Maxcoderz Staff
- Posts: 342
- Joined: Tue 01 Nov, 2005 6:34 am
- L4E_WakaMol-King
- Maxcoderz Staff
- Posts: 342
- Joined: Tue 01 Nov, 2005 6:34 am
Success!
~ 758 is the magic number. Jim e, thank you so much!
Now for the music... Lol!
(Don't have a 2.5 mm converter yet, so that won't come till later.)
~ 758 is the magic number. Jim e, thank you so much!
Now for the music... Lol!
(Don't have a 2.5 mm converter yet, so that won't come till later.)
- Now Under Development - [Progress]