A92: The bugging code from TINX 0.50


[Prev][Next][Index][Thread]

A92: The bugging code from TINX 0.50



Here's the code that (most likely) bugs:




;**************************************
;* Clear the screen and move the line *
;**************************************
	jsr		flib[clr_scr]

	move.l		lcd_mem_ptr,a6
	lea		115*30(a6),a6
	lea		(121-115)*30(a6),a5

	moveq		#14,d0
\cloop	move.w		#0,(a5)+
	move.w		#$FFFF,(a6)+
	dbra		d0,\cloop

;**********************
;* Plot the big title *
;**********************
	lea		bigtitle(PC),a5
	move.l		lcd_mem_ptr,a6
	lea		116*30(a6),a6
	moveq		#11,d0
\ploop	move.l		(a5)+,(a6)+
	move.l		(a5)+,(a6)+
	move.l		(a5)+,(a6)+
	add.l		#18,a6
	dbra		d0,\ploop

;******************************************
;* Remove the "BUSY" indicator if present *
;******************************************
	move.w		#ACTIVITY_IDLE,-(a7)
	jsr		romlib[set_activity]

;***************************************
;* Draw wind and fire boxes, with text *
;***************************************
;* The boxes *
	move.l		#122+239*65536,-(a7)
	move.l		#117+135*65536,-(a7)
	jsr		flib[frame_rect]

;	move.w		#127,6(a7)
	addq.w		#5,6(a7)
;	move.w		#122,2(a7)
	addq.w		#5,2(a7)
	jsr		flib[frame_rect]

;* The text *
	move.w		#0,-(a7)
	jsr		romlib[set_font]

	move.w		#1,-(a7)
	pea		str_wind(PC)
	move.l		#117+118*65536,-(a7)
	jsr		romlib[puttext]
	move.l		#123+112*65536,(a7)
;	addq.l		#5,4(a7)
	addq.w		#5,6(a7)
	jsr		romlib[puttext]

	lea		22(a7),a7

;#########################################################################
;#                                                                       #
;#                         INTRO/TITLE SCREEN                            #
;#                                                                       #
;#########################################################################

;***************************************************
;* Scrolling in the title screen (only first time) *
;***************************************************
;	clr.l		d3
	lea		titlepic(PC),a0
	move.l		field_ptr,a1
	jsr		hufflib[extract]
	moveq		#0,d3
	move.l		#(111+DRAW_ROW)*30,d0
\oloop	move.l		lcd_mem_ptr,a0
	add.l		d0,a0
	move.l		d0,d1
	move.l		field_ptr,a1
\iloop	move.w		(a1)+,(a0)+
	addq.l		#2,d1
	cmp.l		#(112+DRAW_ROW)*30,d1
	bne.s		\iloop

	move.w		frame_time,d3
;	mulu.w		#4,d3
	lsl.w		#2,d3
\dloop	dbra		d3,\dloop

	sub.l		#30,d0
	cmp.l		#DRAW_ROW*30,d0
	bne.s		\oloop

Intro:
	lea		titlepic(PC),a0
	move.l		lcd_mem_ptr,a1
	lea		DRAW_ROW*30(a1),a1
;	add.l		#DRAW_ROW*30,a1
	jsr		hufflib[extract]
	bsr		wait_nokey




 Variables
 ---------
lcd_mem_ptr	Pointer to LCD mem (in preparation of Fargo II)
bigtitle	The small "TINX" at the bottom of the screen
str_wind	Strings containing "Wind" and "Power"
titlepic	Imported Huffman packed title picture
field_ptr	Pointer to a part of the allocated memory
DRAW_ROW	Pixelrow to start drawing on the LCD screen
frame_time	Delay variable
wait_nokey	Self-explanatory

 Theories
 --------
* Hufflib needs the two adresses to be longword aligned
* Something else is not longword aligned when it should be
* We're reading/writing in non-allocated memory



Any and all help is greatly appreciated.
If you don't have the 0.50 version with the bugging code, tell me ,and I'll
send it to you.
Bug reports: Please tell *exactly* how far in the above code you think
you've come when the error occurs - i.e. what's on the screen, exactly?


Thanks to all in advance - this is driving me nuts!


Niklas Brunlid
PQF Quote follows:

DROP THE SCYTHE, AND TURN AROUND SLOWLY.
        -- Dirty Death
           (Terry Pratchett, Reaper Man)


Follow-Ups: